a and b are congruent modulom or a≡b(modm) (a congruence) if they leave the same remainder when divided by m (its modulus)
a≡b(modm) if the
difference between a and b
is a multiple of m →m∣(a−b) or a−b=km
a and b not congruent modulo m, we write a≡b(modm)
Theorem 2
a and b are int, m is positive int
then a≡b(modm) if and only if (amodm)=(bmodm).
Theorem 3
a and b are congruent modulo int m ⇐> there is int k, that a=b+km
Theorem 4: the congruent modulo of 2 products & sums
if a≡b(modm), and c≡d(modm), then
a+c≡b+d(modm)ac≡bd(modm)
Corollary 5
m is positive int, a and b are int
(a+b)modm=((amodm)+(bmodm))modmabmodm=((amodm)(bmodm))modmanmodm=(amodm)nmodm
hard parts:
-1 (mod 10) = 9, means adding 9 more to its positive get 10
how to imagine modulo of negative numbers
imagine number line contains only from 0 to 9, and loop back. After 9, we go back to 0. If we start at 0 and move 1 step left (which is -1), we would land on 9
⇒−1mod10=9
Note on modular arithmetic
a set Zm with both mod addition or multiplication is commutative ring