GATE CSE
First time here? Checkout the FAQ!
x
+1 vote
127 views
a mod n : tell the formula ?
asked in Mathematical Logic by Active (2.5k points) 15 47 | 127 views

2 Answers

+1 vote
Best answer

In arithmetic modulo b, we express any $a$  as $nb + r$, where $r$ must be a non-negative integer.

-4 can be expressed as $-2 * 2 + 0$, So -4 mod 2 = 0

One good example would be -2 mod 6.

-2 can be expressed as $(-1 * 6) + 4$, so -2 mod 6 = 4.

Hope it's clear now.

answered by Loyal (4k points) 6 12 27
selected by
+1 vote
I dont give exact answer,but i can give you approach that i follows.

Lets say we have a number n (say 13),now if i find mod of this with some number(+ve) say m=4, it will give me 1(13%4).

Now suppose i add multiple of 4(4x) into n.Say 13+(4*2),will it change my Mode?No way ,right?

Now say i have -ve number -13,now if i add multiple of 4,that is greater that 13 say 16,now it becomes -13+16,which is 3%4=3.

Hope this clears,-4mod2,will be (-4+2*3)=(-4+6)=(2)mod2,which is 0.
answered by Veteran (14.9k points) 12 103 309
ya right but tell

-9 mod 4 =3

rt?
there is a formula behind that

i searched google but it showing confusion. somebody know that

a mod n formula ?
@wanted: you're right.  -9 mod 4 indeed equals 3.

You can check my answer to get precise mathematical definition.
yes.You can write as (-9mod4)=(-9+12)mod4=(3)mod4=3
tie buddy

Related questions

0 votes
1 answer
1
0 votes
1 answer
2
asked in Algorithms by neha singh Active (1.9k points) 10 32 73 | 185 views
0 votes
1 answer
3


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Top Users Oct 2017
  1. Arjun

    23240 Points

  2. Bikram

    17038 Points

  3. Habibkhan

    7096 Points

  4. srestha

    6008 Points

  5. Debashish Deka

    5430 Points

  6. jothee

    4928 Points

  7. Sachin Mittal 1

    4762 Points

  8. joshi_nitish

    4278 Points

  9. sushmita

    3954 Points

  10. Rishi yadav

    3744 Points


Recent Badges

Notable Question tajar
Notable Question Imarati Gupta
Notable Question set2018
Popular Question jothee
Notable Question set2018
Notable Question Pavan Kumar Munnam
Notable Question iarnav
Popular Question makhdoom ghaya
Popular Question Satyam
Popular Question radha gogia
27,254 questions
35,075 answers
83,756 comments
33,185 users