MTH 210 Modular Arithmetic 1 Dr Anthony Bonato
MTH 210 Modular Arithmetic 1 Dr. Anthony Bonato Ryerson University
Even vs odd • simple way to “split up” integers: – even vs odd • a number n is even if it has 2 as a divisor – we write 2 | n • otherwise, it is odd
• use [0] to denote even integers • use [1] to denote odd integers • [0] = 0, ± 2, ± 4, ± 6 … • [1] = ± 1, ± 3, ± 5 …
Weird arithmetic • [0] + [0] = [0] – “even plus even is even” • [0] + [1] = [1] – “even plus odd is odd” • [1] + [1] = [0] – “odd plus odd is even”
Weird arithmetic • [0] x [0] = [0] – “even times even is even” • [0] x [1] = [1] – “even times odd is even” • [1] x [1] = [1] – “odd times odd is odd”
Congruences • x ≡ y (mod 2) if 2 divides x – y • write: 2 | (x-y) • eg: 4 ≡ 0 (mod 2), 17 ≡ 1 (mod 2)
Key facts • x ≡ y (mod 2) then y ≡ x (mod 2) • x ≡ x (mod 2) • If x ≡ y (mod 2) and y ≡ z (mod 2), then x ≡ z (mod 2)
General congruences • m > 2 an integer • x ≡ y (mod n) if n | (x-y) • eg 13 ≡ 1 (mod 12), 23 ≡ 3 (mod 5)
Key facts • x ≡ y (mod n) then y ≡ x (mod n) • x ≡ x (mod n) • If x ≡ y (mod n) and y ≡ z (mod n), then x ≡ z (mod n)
• [m] = {x | x ≡ m (mod n)} – called equivalence classes (mod n) or congruence classes • eg if n = 3, then [2] = {x: remainder of 2 when 3 divides x}
Exercises
MTH 210 Modular Arithmetic II Dr. Anthony Bonato Ryerson University
Key facts • Given a ≡ c (mod n) and b ≡ d (mod n) 1. 2. 3. 4. a + b ≡ c + d (mod n) a - b ≡ c - d (mod n) ab ≡ cd (mod n) For all integers k > 0, ak ≡ ck (mod n)
Exercises
- Slides: 14