SOLUTION: I need some help understanding modula. I put -101 mod 3 into a mod calculator and the answer comes up as 3. Shouldn't it be 2? -101 / 3 = 33 with 2 remaining. Or does it change

Algebra.Com
Question 921969: I need some help understanding modula.
I put -101 mod 3 into a mod calculator and the answer comes up as 3.
Shouldn't it be 2?
-101 / 3 = 33 with 2 remaining.
Or does it change somehow with a negative?

Found 2 solutions by rothauserc, Theo:
Answer by rothauserc(4718)   (Show Source): You can put this solution on YOUR website!
You handle the same way you handle positive numbers.
29 ≡ 2 (mod 3)
-101 ≡ -2 (mod 3)
definition of modulus
a congruent b mod m
our example is -101 congruent b mode 3, implies that
-101 -b = 3k for some integer k and therefore -101 -b / 3
-101 -(-2) / 3 = -99 / 3, says that
-101 is congruent to -2 mod 3

Answer by Theo(13342)   (Show Source): You can put this solution on YOUR website!
it does change with a negative number but i came up with a different answer than you did.

i got:

101 modulo 3 = 2
-101 modulo 3 = 1

i believe the rule is as follows:




-x modulo y = y - x modulo y

where x >= 0 so that, if x = 5, then -5 is equal to -x.

based on that rule, -101 module 3 is equal to 3 minus 101 module 3 which is equal to 3 minus 2 which is equal to 1.

-101 modulo 3 is not 3 as you stated.

i verified with an online modulo calculator and with excel mod function.

the results of my excel calculations are shown below:

these results confirm the rule is good.

$$$

it was difficult to find a reference on the web that didn't confuse me more than i was before i started looking.

after a while i was able to piece it together.

some of the better links i looked at are shown below.

as you will be able to see, there are numerous different methods for how to calculate the modulo of a negative number.

https://www.khanacademy.org/computing/computer-science/cryptography/modarithmetic/a/what-is-modular-arithmetic

https://www.khanacademy.org/computing/computer-science/cryptography/modarithmetic/a/the-quotient-remainder-theorem

https://answers.yahoo.com/question/index?qid=20080922034737AAsFEfY

http://www.miniwebtool.com/modulo-calculator/?number1=-340&number2=60

http://mathforum.org/library/drmath/view/52343.html












RELATED QUESTIONS

D. Perform the modular arithmetic as indicated. 1. (37 + 45) mod 12 2. (42 + 35) mod 3 (answered by ikleyn)
I am too much confused when it arrives to finding argument of a complex number. Please... (answered by ikleyn)
≡ Mod 2 ∩ ≡ Mod 3 Is an equivalent relation on Z? ≡ Mod 2 ∪ ≡ Mod 3 Is an... (answered by ikleyn)
Calculate 9^563 mod907 Identify which one of the following options gives the... (answered by ikleyn,math_tutor2020)
Please kind person, I need your help. Can you please assist me with this question?... (answered by jim_thompson5910)
1. Modular arithmetic. Evaluate the following: a. Which of the following are true (put a (answered by ikleyn)
Find the number of years it will take for $31,000 to grow to 33,405.06 at 3% interest... (answered by scott8148,ankor@dixie-net.com)
) Prove that for any positive integers a and b, gcd(a,b) · lcm(a,b) = a·b. b) If the... (answered by Shin123)
Hello. My question is {{{(2x-3)(x+4)=6}}} I need to solve by factoring. I tried to but (answered by richard1234)