1 Modular Arithmetic
- Definition of Congruence: a≡b(mod n) iff n | (a−b) .
- Reminder Lemma: a≡b(mod n) iff rem(a,n) = rem(b,n) .
- 29≡mod 7 15 .
- Corollary: a≡rem(a,n) (mod n) .
- t congruence modulo n is that it defines a partition of the integers into n sets so that congruent numbers are all in the same set.
2 Reminder Arthmetic
- General Principle of Remainder Arithmetic:
- replace each integer operand by its remainder on division by n,
- keep each result of an addition or multiplication in the range [0..n) by immediately replacing any result outside that range by its remainder on division by n.
- The set of integers in the range [0..n) together with the operations +n and ∙n is referred to as Zn , the ring of integers modulo n.
3 Multiplicative Inverses and Cancelling
- The multiplicative inverse of a number x is another number x−1 such that x−1x=1 .
- Integers that have no prime factor in common are called relatively prime, namely gcd(a,b)=1.
- The following are equivalent for
k∈[0..n)
:
gcd(k,n)=1
k has an inverse in Zn
k is cancellable in Zn
Reference
[1] Lehman E, Leighton F H, Meyer A R. Mathematics for Computer Science[J]. 2015.