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

Congruence

If m and n are integers and m≠0, the division algorithm states that n can be expressed in the
form
n = qm+r, where 0 ≤ r < |m|
for unique integers q and r. These integers q and r are called the quotient and remainder,
respectively, in the division of n by m.

Example 1: When 34 is divided by 9, the quotient is 3 and the remainder is 7, because


34 = 3·9 + 7 and 0 ≤ 7 < 9.
On the other hand, although
-34 = 3·(-9) + (-7)
3 is not the quotient in the division of -34 by -9, because -7 is not a possible remainder. (Why
not?) In this case, we have
-34 = 4·(-9) + 2 and 0 ≤ 2 < 9,
So that 4 is the quotient and 2 is the remainder in the division of -34 by -9.

If the remainder in the division of n by m is 0, then we say that n is divisible by m (or that m
divides n). That is, n=qm for some integer q.

Now let m be an integer greater than 1. If x and y are integers, we say that x is congruent to y
modulo m if x-y is divisible by m. (This is the single most important definition you should
understand and remember in this topic). If x is congruent to y modulo m, we write x≡y (mod m);
otherwise, we write x≢ y (mod m).
Another way to say that x is congruent to y modulo m is that when x and y are divided by m,
they have the same remainder:
x= ml + r
y=mk +r, where l,k are integers
So, x-y = (ml+r) - (mk +r) = ml + r -mk - r = ml - mk = m(l-k), which is to say that m divides x-y.

Example 2: True or false?


3 ≡ 24 (mod 7)
98 ≡ 43 (mod 11)
42 ≢ 5 (mod 8)
4 ≢ 29 (mod 6)

Example 3: Can you give me some examples of daily usage of congruence?


Another common (though less known) usage of congruence is in error detecting codes, for
example, an ISBN (=international standard book number). It is a 10-digit number uniquely
identifying each published book. The last of these digits is the so-called check digit, and it is
used to identify errors that can occur when ISBNs are transmitted. How? The check digit can
take 11 values (0 through 9, or X, which stands for 11). In a given number, the check digit is
determined according to the following rule: first multiply the first digit of ISBN by 10, the second
digit by 9, …, the tenth digit by 2, and take the sum of the products:
s= 10x1+9x2+...+2x9 where xi is the ith digit of ISBN
Then the check digit, let’s call it d, is chosen in such a way that s+d ≡ 0 (mod 11).
How does it help in detecting mistakes? Suppose I suggest that for this class you purchase the
book with the number 0-13-602040-2 and you wish to check whether it is indeed the book you
need and there’s no typo that would result in a wrong purchase. Work this out; is there a book
with this number and do you want it?

The notation x≡y (mod m) suggests that this relation is analogous to that of equality. In fact, it is,
given that this relation on the set of integers, called congruence modulo m, is in fact an
equivalence relation. Ascertain that this is so by showing that this relation is reflexive,
symmetric, and transitive.

The equivalence classes for congruence modulo m are called congruence classes modulo m.
The set of all the congruence classes modulo m will be denoted by Zm (also often denoted by
Z/m). Any two congruence classes modulo m are either equal or disjoint. (Why?) Moreover, in
Zm, [x]=[y] of and only if x≡y (mod m) (recall that [x] denotes the equivalence class of x, which, in
this case, are all integers that have the same remainder as x when divided by m). Thus, if r is
the remainder in the division of x by m, then [x]=[r] in Zm. So there are m distinct congruence
classes in Zm:
[0],[1],[2],...,[m-1]. These correspond to the m possible remainders when dividing by m.

Example 3: In Z3, what are the distinct congruence classes? What is the union of all the
congruence classes in Z3?

We can define operations of addition and multiplication in Zm( we will then see that congruences
behave just like integers in many ways):
[x]+[y]=[x+y] and [x][y]=[xy]

We need to convince ourselves that these definitions make sense and that they don’t depend on
the way in which congruences classes are represented. For example, in Z3, [0]=[9] (0 and 9
both have remainder of 0 when divided by 3) and [2]=[11] (why?); so we must be certain that
[0]+[2] and [9]+[11] give the same answer.

Theorem 1: If x≡x’ (mod m) and y≡y’ (mod m), then


(a) x+y≡x’+y’ (mod m)
(b) xy≡x’y’ (mod m)
Proof: We observe that, if x≡x’ (mod m) and y≡y’ (mod m), then there are integers a and b such
that m divides x-x’, so x-x’=am, so x=am+x’ and, similarly, y-y’=bm so y’=bm+y’. We use these
facts to prove (a):
x+y=(am+x’)+(bm+y’)=m(a+b)+x’+y’
Then (x+y)-(x’+y’)=m(a+b), so (x+y)-(x’+y’) is divisible by m.
To prove (b):
xy=(am+x’)(bm+y’)=abm2+x’bm+amy’+x’y’=m(abm+x’b+ay’)+x’y’
So xy-x’y’=(amb+x’b+ay’)m, and since the expression in the parentheses is an integer, we
conclude that xy-x’y’ is divisible by m. ▢
n n
Notice that part (b) of Theorem 1 implies that if x≡z (mod m), then x ≡z (mod m) for all positive
integers n, and [x]n=[z]n by definition of multiplication in Zm.

Example 4: Here are a few examples of modular arithmetic in Z6.


[5]+[3]=[5+3]=[8]=[2] since 8≡2 (mod 6).
[5]· [3] = [5 · 3] = [15] = [3] because 15≡3 (mod 6)
[8]4=[2]4=[24]=[16]=[4] since 8≡2 (mod 6) and 16≡4 (mod 6).

Example 5: In Z8, compute


[4]+[7]=[4+7]=[11]=[3]
[4]·[7]=[4·7]=[28]=[4]
[7]9=[-1]9=[(-1)9]=[-1]=[7]

Example 6: Find the last digit of the sum 2403+791+688+2339 by using congruence (i.e.
without computing the sum). Note that this is equivalent to finding the remainder of this sum
when divided by 10, so you should work in Z10:
2403+791+688+2339 ≡ 3 + 1 + 8 + 9 ≡ 11 ≡ 1 (mod 10)

Example 7: Suppose we start a biology experiment at 9 am today, and it should run for 38
hours. At what time will it finish?
9+38 ≡ 9 + 14 ≡ 23 (mod 24)
Which is what time and day? It’s 11 pm on the next day after the experiment’s start.

Example 8: What day of week will November 7, 2025 be? We need to count the number of days
from today till the specified date in Z7 in order to determine the day of week.

Let’s do a tiny example to get the method straight: say, today is Tuesday May 5, and I want to
know what day of week will May 15 be. There are 15-5=10 days from today till May 15 (note that
I included May 15 but excluded May 5 from the count of days). 10 mod 7 is 3, so I need to add
three days to Tuesday, which gives us Friday as the day of week for May 15 (which is the day
for the final exam for the 9 am section).

Now let’s use this method to find what day of week November 7, 2025 will be. (You might want
to know that Russia celebrates the revolution -- which took place in 1917 -- on November 7).
There are four full years (2021,2022,2023,2024), of which 2024 is a leap year. This gives us
365+365+365+366≡1+1+1+2≡5 (mod 7)

How many days are there in 2020 after May 5? I will subtract the number of days from the
beginning of the year until May 5 (including May 5) from the total number of days in 2020 (which
is a leap year):
366-31-29-31-30-5≡2-3-1-3-2-5≡2 (mod 7)
How many days are there in 2025 until 7 November (including Nov. 7)? To save on calculations,
I will again subtract the number of days after Nov. 7 from the total number of days in the year
(30-7=23 days in November and 31 days in December):
365-23-31≡1-2-3≡-4≡3 (mod 7)
Now we add the three values we’ve got from in the incomplete 2020, complete 2021-2024, and
incomplete 2025:
5+2+3≡3 (mod 7)
So I need to add 3 days to Tuesday which gives me Friday. (You can double check the answer
in a calendar).

Example 9: What are the last two digits of 71942? We need to find the remainder when this
number is divided by 100, so we will use arithmetic modulo 100. You can do it in two different
ways:
(i) We will successively reduce the power while computing the remainder modulo 100:
71942 ≡ (72)971 ≡ (49)971≡49·49970≡49·(492)485≡49·1485≡49 (mod 100)

(ii) Let’s raise 7 to powers 1,2, and so on, and see what happens:
71≡7 (mod 100), 72≡49 (mod 100), 73≡43 (mod 100), 74 ≡ 1 (mod 100), 75 ≡ 7 (mod 100), 76≡49
(mod 100), and so on.
Note that 74≡1 (mod 100), so for any positive integer k, 74k≡(74)k≡1k≡1 (mod 100).
Now we rewrite 71942≡71940·72≡7485·4·72≡1·72≡49 (mod 100), and therefore the last two digits of
71942 are 49.
Another way to think of this approach is as follows: when 7 is raised to successive powers, the
remainders modulo 100 repeat with a period of 4: 7,49,42,1,... (once we reach 1 as a remainder,
the cycle will repeat itself). So we want to know which of these 4 possible remainders we end up
with once 7 is raised to the power of 1942. For this, we ask what 1942 is congruent to modulo 4,
which is 2. This means we end up with the second value of remainder in the cycle of 4 possible
remainders, which is in this case 49.

Example 10: Use congruence to prove that, for each positive integer n, n2-2 is not divisible by 3.
We shall prove that when n2-2 is divided by 3, there’s a non-zero remainder. We consider all
cases of n when divided by 3: [0],[1],and [2].
If n≡0 (mod 3): n2-2≡02-2≡-2≡1 (mod 3)
If n≡1 (mod 3): n2-2≡12-2≡1-2≡-1≡2 (mod 3)
If n≡2 (mod 3): n2-2≡22-2≡4-2≡2 (mod 3)
Thus, we have shown that n2-2 is not divisible by 3.

Example 11: Use congruence to prove that for each positive integer n, n4-n2 is divisible by 6.
This example is similar to the one above. We will show that n4-n2 is divisible by 6 by considering
all cases of n when divided by 6 and show that in each case the remainder is zero. I will work
out just a couple of cases here (you will have a total of 6 cases):
If n≡0 (mod 6): n4-n2≡04-02≡0 (mod 6)
If n≡1 (mod 6): n4-n2≡14-12≡1-1≡0 (mod 6)
If n≡2 (mod 6): n4-n2≡24-22≡16-4≡12≡0 (mod 6)
And so on.

You might also like