Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Mathematics for Computer Science Congruence mod n

MIT 6.042J/18.062J

If a ≡ b (mod n) &
Cancellation &
≡ d (mod n),
Inverses (mod n) c
then a+c ≡ b+d (mod n)
then a⋅c ≡ b⋅d (mod n)
Albert R Meyer, March 7, 2012 lec 5W.1 Albert R Meyer, March 7, 2012 lec 5W.2

Congruence mod n cancellation (mod n)


So arithmetic (mod n) a lot
like ordinary arithmetic
When can you cancel k?
the main difference:
8·2 ≡ 3·2 (mod 10)
—when k has no common
8 ≡ 3 (mod 10) factors with n
no arbitrary cancellation
lec 5W.3 lec 5W.4
Albert R Meyer, March 7, 2012 Albert R Meyer, March 7, 2012

4/2/08 2:20PM
1
inverses (mod n) inverses (mod n)
If gcd(k,n)=1, then have k’ sk + tn = 1
k’·k ≡ 1 (mod n). sk + tn ≡ 1 (mod n)
k’ is an inverse mod n of k sk + t0 ≡ 1 (mod n)
pf: sk + tn = 1, so sk ≡ 1 ((mod n))
just let k’ be s so s is an inverse of k
Albert R Meyer, March 7, 2012 lec 5W.5 Albert R Meyer, March 7, 2012 lec 5W.6

cancellation (mod n) cancellation (mod n)


If a·k ≡ b·k (mod n)
summary:
and gcd(k,n) = 1, then
k is cancellable (mod n) iff
multiply by k’:
k has an inverse (mod n) iff
(a·k)·k’ ≡ (b·k)·k’ (mod n)
kgcd(k,n)=1
is relatively prime to n
1
a·(k·k’) ≡ b·(k·k’)
1
so a ≡ b (mod n)
lec 5W.7 lec 5W.8
Albert R Meyer, March 7, 2012 Albert R Meyer, March 7, 2012

4/2/08 2:20PM
2
MIT OpenCourseWare
http://ocw.mit.edu

6.042J / 18.062J Mathematics for Computer Science


Spring 2015

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms .

You might also like