Fun With Modular Arithmetic

@ Bob 1 mod 4 - 3 mod 4 = -2 mod 4 = 2 mod 4

Good article, there is just a small mistake :
“The modular properties apply to integers, so what we can say is that b cannot be an integer.”

Actually, b could be an integer if a wasn’t an integer.
For exemple take :
3a+5b=6
3a+4b=2
taking mod 3 you have :
2b=0 mod 3 ie b=0 mod 3
b=2 mod 3
According to you that would mean b isn’t an integer.

Except the solution of this system is a=-14/3 and b=4.

All you can deduce from this contradiction ( that b=0 mod 3 and b=2 mod 3 ) is that a and b aren’t both integer.

what a nice page… i love it, thanks a lot …it fascinates me about the power of modulo, and that,s why …I’m gonna make a study on that…thanks…

@Joann: Thanks!

Is there a good book you could recommend for starting out with modular arithmetic?

Thanks

Thank you so much :slight_smile:

Hi,

I recently saw the following video:

In which at 4min and 35seconds, following math-e-magic happens:
16^54 mod 17
becomes (I get this part)
((3^24 mod 17)^54) mod 17
becomes
3^(24*54) mod 17 (I did not get this part)

Can I request you to please explain the last conversion?

Thank you for your time!

@Ingrid: You’re welcome!

LOL thanks

@Math student: Thanks for the note, glad you enjoyed it!

Very Good Illustration

I loved this article , it’s interesting and I really wasn’t know where we apply the modular arithmetic in our daily life…Thank you very very much:)))))

So, why can’t we say that 5.5==2.5 mod 3?

[…] how the the 3Hz cycle starts at 0, gets to position 3, then position "6" (with only 4 positions, 6 modulo 4 = 2), then position "9" (9 modulo 4 = […]

As always, great article! I remember the feeling I got when I finally had the Chinese Remainder Theorem explained to me (over IRC), including getting the meshing mod equations together and multiplicative inverse part.

@David: You were so close to the answer of your question! if you would just resort to paper and pencil and using the clock math you yourself explained nicely :

for a negative n you simply mark the clock anti clockwise with negative numbers, of course the marking of the zero at top of the clock stays the same. The rest of the procedure is the same as widely known. If you want to know the remainder of a positive integer you move clockwise a number of steps equal to that number.Else :slight_smile: if you have a negative number that you want to know the reminder of, you move Anticlockwise. In both cases the marking you land on is your answer. As you see the clock math is the best analogy to visualize the modular math whatever the sign of the integers involved.

how can this be solved 2x+3y=13,2x-y=1

how can this be solved 2x+3y=13(mod 5),2x-y=1(mod 5)

how to take addition of modulo 2^32

your work is very comprehensive.please keep it up