Professional Documents
Culture Documents
Module2 Lec1 PDF
Module2 Lec1 PDF
Module2 Lec1 PDF
Congruence
2.1 Lecture 1
Preamble: In this lecture we will introduce the notion of congruence. We will show
that for any integer n, congruence modulo n is an equivalence relation on the set Z
of integers. We will define complete and reduced system of residues. We will deduce
divisibility criterion for 9 and 11 as a simple application of the notion of congruence.
2.1.1 Congruence
≡ mod n
on Z by
a ≡ b mod n if and only if n | (a − b).
For example,
12 ≡ 3 mod 9, 31 ≡ 6 mod 5.
26
MODULE 2. CONGRUENCE Lecture 1
Now,
• a ≡ a modulo n ∀a ∈ Z as n | (a − a).
n | (a − b) =⇒ n | (b − a) ∀a, b ∈ Z.
n | (a − b) ⇔ (−n) | (a − b).
PROPOSITION 2.4. a ≡ b mod n if and only if they leave the same remainder upon
division by n.
a = nq + r, 0 ≤ r ≤ n − 1,
b = nl + r, 0≤s≤n−1
=⇒ (a − b) = n(p − l) + (r − s).
0 ≤ r ≤ n − 1, 0≤s≤n−1
=⇒ −(n − 1) ≤ (r − s) ≤ (n − 1).
27
MODULE 2. CONGRUENCE Lecture 1
Hence n | (r − s) implies r − s = 0.
COROLLARY 2.5. If a leaves the remainder r upon division by n then a and r are in
the same congruence class modulo n, i.e., [a] = [r].
COROLLARY 2.6. For any integer n, there are n distinct congruence classes modulo n.
DEFINITION 2.7. A set of congruence classes is called a complete residue system if any
given integer belongs to one of the congruence classes in the set.
Thus, the set {[0], [1], · · · , [n − 1]} is an example of a complete residue system for n.
This complete residue system of n is usually denoted by Zn .
Congruence modulo n has many interesting properties which simplify a lot of computa-
tions. Some of these properties are listed below.
1. x ≡ y mod n =⇒ x + c ≡ y + c mod n ∀c ∈ Z.
3. x ≡ y mod n =⇒ cx ≡ cy mod n ∀c ∈ Z.
4. x ≡ y mod n =⇒ xk ≡ y k mod n ∀k ∈ N.
5. x ≡ y mod n =⇒ f (x) ≡ f (y) mod n for any polynomial f (x) with integer
coefficients.
7. ax ≡ ay mod n =⇒ x ≡ y mod n
gcd(a,n) .
28
MODULE 2. CONGRUENCE Lecture 1
The first of the above properties follow easily from definition of congruence. Observe
that a ≡ b mod n implies that we can write as a = b + nk for some integer k. For the
second property above,
The third property follows from the second by taking z = w = c. The fourth property
follows from the second by taking z = x, w = y to start with, then z = x2 , w = y 2 etc.
Then the fifth is a consequence of the preceding properties. The sixth property is clear
too, as
d | n, n | (a − b) =⇒ d | (a − b).
For the seventh property, we cancel the gcd d of n = dn1 and a = da1 to obtain
n | a(x − y)
=⇒ n1 | a1 (x − y)
=⇒ n1 | (x − y).
As n1 and a1 are coprime, the last step follows from corollary 1.15 in lecture 4, module 1.
Property 8 is a special case of the seventh. The last property follows from the definition
of the lcm.
We will now demonstrate the usefulness of the notion of congruence with some simple
applications. We will derive divisibility criterion for integers 9 and 11 using congruence.
and let
S = bk + bk−1 + · · · + b1 + b0 ,
29
MODULE 2. CONGRUENCE Lecture 1
Now,
10 ≡ 1 mod 9
=⇒ 10k ≡ 1 mod 9
=⇒ bk · 10k + bk−1 · 10k−1 + · · · + b1 · 10 + b0 ≡ bk + bk−1 + · · · + b1 + b0 mod 9
=⇒ m ≡ S mod 9.
PROPOSITION 2.9. A positive integer is divisible by 11 if and only if the sum of its
digits with alternate signs in its decimal expansion is divisible by 11.
and let
A = (−1)k bk + (−1)k−1 bk−1 + · · · − b1 + b0 . Now,
10 ≡ −1 mod 11
=⇒ 10k ≡ (−1)k mod 11
=⇒ bk · 10k + bk−1 · 10k−1 + · · · + b1 · 10 + b0 ≡ (−1)k bk + (−1)k−1 bk−1 + · · · − b1 + b0 mod 11
=⇒ m ≡ A mod 11.
30