Modular 3
Modular 3
PETER MCNAMARA
Bucknell University
and Trinity College Dublin
Main definition
a≡b (mod m) if
m | a−b i.e. m divides a − b.
Motivating Problem.
We know how to find k that satisfies 77k ≡ 1 (mod 100). How?
1
2
1. EUCLID’S ALGORITHM
Two problems:
(a) Find gcd(153, 442) = d .
(b) Find r and s such that r (153) + s(442) = d .
136 = 8 . 17 + 0 d = gcd(17, 0) = 17
= 3 . 153 − 442.
Answer: r = 3 and s = −1
3
Solution.
100 = 1 . 77 + 23
77 = 3 . 23 + 8
23 = 2 . 8 + 7
8 = 1.7 + 1
7 = 7.1 + 0
1=8−7
= 8 − (23 − 2 . 8)
= 3 . 8 − 23
= 3(77 − 3 . 23) − 23
= 3 . 77 − 10 . 23
= 3 . 77 − 10(100 − 77)
= 13 . 77 − 10 . 100
Thus
13 . 77 ≡ 1 + 10 . 100 ≡ 1 (mod 100).
Answer: 13
5
We get
≡ 97 (mod 100).
6
x ≡ a1 (mod n1),
x ≡ a2 (mod n2),
x ≡ a3 (mod n3),
... ... ...
x ≡ ak (mod nk ).
Proof (as time permits). Since n1 and n2 are coprime, we can find
r and s such that
1 = r n1 + s n 2 .
So
s n 2 ≡ 1 − r n1 ≡ 1 (mod n1),
r n1 ≡ 1 − s n 2 ≡ 1 (mod n2).
Now consider n3, and use the same technique to find y such that
y ≡ a3 (mod n3),
y ≡x (mod n1n2),
so
y ≡ x ≡ a1 (mod n1),
y ≡ x ≡ a2 (mod n2).
And so on...
If x 0 is another solution, then x 0 −x is divisible by n1, n2, ... , nk . Since
the ni have no common factors, x 0 − x is divisible by n1n2 · · · nk ,
i.e.,
x0 ≡ x (mod n1n2 · · · nk ).
8
In seats:
n = a1 s n2 + a2 r n1
= 10 . (−7) . 47 + 13 . 10 . 33
= 10(13 . 33 − 7 . 47)
= 10(429 − 329)
= 1000 .
n ≡ 1 (mod 2),
n ≡ 2 (mod 3),
n ≡ 3 (mod 4),
n ≡ 4 (mod 5),
n ≡ 5 (mod 6),
n ≡ 6 (mod 7),
n ≡ 7 (mod 8),
n ≡ 8 (mod 9),
n ≡ 9 (mod 10).
n ≡ 4 (mod 5),
n ≡ 6 (mod 7),
n ≡ 7 (mod 8),
n ≡ 8 (mod 9).
10
.
The first positive solution is n = −1 + 5 . 7 . 8 . 9 = −1 + 2520 =
2519 .