0% found this document useful (0 votes)
42 views48 pages

Unit Iii

The document discusses number theory and concepts such as divisibility, greatest common divisor (GCD), prime numbers, and the Euclidean algorithm. It defines key terms and provides examples. The Euclidean algorithm is described as a method to determine the GCD of two integers by repeatedly dividing the larger number by the smaller number and setting the remainder equal to the new smaller number, until reaching a remainder of zero. This process generates a system of equations where the final non-zero remainder is the GCD.

Uploaded by

mish 1995
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views48 pages

Unit Iii

The document discusses number theory and concepts such as divisibility, greatest common divisor (GCD), prime numbers, and the Euclidean algorithm. It defines key terms and provides examples. The Euclidean algorithm is described as a method to determine the GCD of two integers by repeatedly dividing the larger number by the smaller number and setting the remainder equal to the new smaller number, until reaching a remainder of zero. This process generates a system of equations where the final non-zero remainder is the GCD.

Uploaded by

mish 1995
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 48

UNIT-III

Number theory
Introduction:
The part of mathematics devoted to the study of the set of integers and their properties is
known as number theory. In this chapter we will develop some of the important concepts of
number theory including many of those used in computer science.
Number theory plays an essentially role in cryptography. Number theory has become an
essential tool in providing computer and Internet security.
Divisibility:
If 𝑎 and 𝑏 are integers with 𝑏 ≠ 0, we say that 𝑏 divides 𝑎 if there is an integer 𝑘 such
𝑏
that 𝑎 = 𝑘 × 𝑏, or equivalently, if is an integer. When 𝑏 divides 𝑎 we say that 𝑏 is a factor or
𝑎

divisor of 𝑎, and that 𝑎 is a multiple of 𝑏. The notation 𝑏 | 𝑎 denotes that 𝑏 divides 𝑎.


We write 𝑏 ∤ 𝑎 when a does not divide b.
Example: 3 | 12 𝑏𝑒𝑐𝑎𝑢𝑠𝑒 12 = 4 × 3 and 3 ∤ 7.
Properties of divisibility of integers: Let 𝒂, 𝒃, 𝒄 be the integers:
(i) If 𝑎 | 1, then 𝑎 = ±1.
(ii) If 𝑎 | 𝑏 and 𝑏 | 𝑎, then 𝑎 = ±𝑏.
(iii) Any integer 𝑎 ≠ 0, divides 0.
(iv) If 𝑎 | 𝑏 and 𝑏 | 𝑎, then 𝑎 | 𝑐.
(v) If 𝑎 | 𝑔 and 𝑏 | ℎ, then 𝑏 | (𝑚𝑔 + 𝑛ℎ) for arbitrary integers 𝑚 and 𝑛.
(vi) If 𝑎 | 𝑏 or 𝑎 | 𝑐, then 𝑎 | 𝑏𝑐.
(vii) If 𝑎 | 𝑏 and 𝑐 | 𝑑, then 𝑎𝑐 | 𝑏𝑑.
Proof:
(i) If 𝑎 | 1 , then by definition, 1 = 𝑘 ∙ 𝑎, for some 𝑘 ∈ ℤ.
Since, 𝑘 and 𝑎 are integers, therefore, 𝑘 = ±1 and 𝑎 = ±1.
(ii) Let 𝑎 | 𝑏 and 𝑏 | 𝑎,
then by definition, there exist two integers 𝑘1 and 𝑘2 such that 𝑏 = 𝑘1 𝑎 and 𝑎 = 𝑘2 𝑏.
∴ 𝑎 = 𝑘2 𝑏 = 𝑘2 𝑘1 𝑎
⟹ 𝑘2 𝑘1 = 1
⟹ 𝑘1 = ±1 and 𝑘2 = ±1
∴ 𝑎 = 𝑘2 𝑏 = ±𝑏.
(iii) Let 𝑎 be a non-zero integer,
So, 0=0∙𝑎 ⟹ 𝑎 | 0, so 𝑎 divides 0.
(iv) Let 𝑎 | 𝑏 and 𝑏 | 𝑐,
⟹ 𝑏 = 𝑘1 𝑎 and 𝑐 = 𝑘2 𝑏 for some 𝑘1 , 𝑘2 ∈ ℤ.
⟹ 𝑐 = 𝑘2 𝑘1 𝑎,
Since 𝑘2 𝑘1 ∈ ℤ, 𝑎 | 𝑐.
(v) Let 𝑎 | 𝑔 and 𝑎 | ℎ,
⟹ 𝑔 = 𝑘1 𝑎 and ℎ = 𝑘2 𝑎 for some 𝑘1 , 𝑘2 ∈ ℤ.
Now, Let 𝑚, 𝑛 be arbitrary integers
then 𝑚𝑔 + 𝑛ℎ = 𝑚𝑘1 𝑎 + 𝑛𝑘2 𝑎 = 𝑚𝑘1 + 𝑛𝑘2 𝑎.
Since 𝑚𝑘1 + 𝑛𝑘2 is also an integer, therefore 𝑎 | (𝑚𝑔 + 𝑛ℎ).
(vi) Assume 𝑎 | 𝑏, ⟹ 𝑏 = 𝑘1 𝑎 for some integer 𝑘1
Now, 𝑏𝑐 = 𝑘1 𝑎𝑐 = 𝑘1 𝑐 𝑎
Since 𝑘1 𝑐 ∈ ℤ, 𝑎 | 𝑏𝑐.
Similarly, we can prove this when 𝑎 | 𝑐.
(vii) Let 𝑎 | 𝑏 and 𝑐 | 𝑑,
⟹ 𝑏 = 𝑘1 𝑎 and 𝑑 = 𝑘2 𝑐 for some 𝑘1 , 𝑘2 ∈ ℤ.
Then, 𝑏𝑑 = 𝑘1 𝑎 𝑘2 𝑐 = (𝑘1 𝑘2 ) 𝑎𝑐, with 𝑘1 𝑘2 ∈ ℤ ⟹ 𝑎𝑐 | 𝑏𝑑 .
Greatest common divisor:
The largest integer that divides both of two integers is called the greatest common divisor of
these integers.
Let 𝑎 and 𝑏 be integers, not both zero. The largest integer 𝑑 such that 𝑑 | 𝑎 and 𝑑 | 𝑏 is called
the greatest common divisor of 𝑎 and 𝑏. The greatest common divisor of 𝑎 and 𝑏 is denoted by
gcd(𝑎, 𝑏).
More formally, the positive integer 𝑑 is said to be greatest common divisor if,
(i) 𝑑 | 𝑎 and 𝑑 | 𝑏
(ii) If 𝑐 | 𝑎 and 𝑐 | 𝑏 , then 𝑐 ≤ 𝑑.
or
gcd 𝑎, 𝑏 = max{ 𝑘, 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 𝑘 𝑎 𝑎𝑛𝑑 𝑘 𝑏}
Example: gcd 60, 24 = 12.
Note: Greatest common divisor of two numbers is always a positive number. Hence
gcd(𝑎, 𝑏) = gcd(−𝑎, 𝑏) = gcd(𝑎, −𝑏) = gcd −𝑎, −𝑏 .
In general, gcd 𝑎, 𝑏 = gcd 𝑎 , 𝑏 .
Result: If 𝑑 = gcd 𝑎, 𝑏 , then there exist integers 𝑥 and 𝑦 such that 𝑑 = 𝑎𝑥 + 𝑏𝑦.
Prime numbers:
An integer 𝑝 > 1 is called a prime number, if its only positive divisors are 1 and 𝑝.
An integer greater than 1 that is not prime is called composite.
Example: 2, 3, 5, 7, 11, 13,… are prime numbers.
4, 10, 15, 21,… are composite numbers.
Relatively prime or co-prime numbers:
Two integers 𝑎 and 𝑏 are said to be relatively prime if gcd 𝑎, 𝑏 = 1.
Example: 27 and 35 are relatively prime numbers, because gcd 27, 35 = 1.
Result: If 𝑎, 𝑏 are relatively primes, then there exist integers 𝑥 and 𝑦 such that
1 = 𝑎𝑥 + 𝑏𝑦.
Some useful properties of relatively prime numbers:
(i) If 𝑎 | 𝑐 and 𝑏 | 𝑐 with gcd 𝑎, 𝑏 = 1, then 𝑎𝑏 | 𝑐.
Proof: Let 𝑎 | 𝑐 and 𝑏 | 𝑐,
⟹ 𝑐 = 𝑘1 𝑎 and 𝑐 = 𝑘2 𝑏 for 𝑘1 , 𝑘2 ∈ ℤ.
Also given that gcd 𝑎, 𝑏 = 1 , therefore there exist two integers 𝑥 and 𝑦 such that
𝑎𝑥 + 𝑏𝑦 = 1.
Multiplying both sides of the equation by 𝑐, we get
𝑎𝑐𝑥 + 𝑏𝑐𝑦 = 𝑐
𝑎(𝑘2 𝑏)𝑥 + 𝑏(𝑘1 𝑎)𝑦 = 𝑐 = 𝑎𝑏(𝑘2 𝑥) + 𝑎𝑏(𝑘2 𝑦)
or 𝑎𝑏 𝑘2 𝑥 + 𝑘2 𝑦 = 𝑐, therefore 𝑎𝑏 | 𝑐.
(ii) If 𝑎 | 𝑏𝑐 with gcd 𝑎, 𝑏 = 1, then 𝑎 | 𝑐.
Proof: Since gcd 𝑎, 𝑏 = 1 , there exist two integers 𝑥 and 𝑦 such that
𝑎𝑥 + 𝑏𝑦 = 1.
Multiply the above equation by 𝑐, then we get 𝑎𝑐𝑥 + 𝑏𝑐𝑦 = 𝑐.
Since 𝑎| 𝑏𝑐 and 𝑎 | 𝑎𝑐, 𝑎 |𝑎𝑐𝑥 + 𝑏𝑐𝑦,
therefore, 𝑎 | 𝑐.

The Division Algorithm:


When an integer is divided by a positive integer, there is a quotient and a remainder, as the
division algorithm shows.
THE DIVISION ALGORITHM: Let 𝑎 be an integer and 𝑏 a positive integer. Then there are
unique integers 𝑞 and 𝑟, with 0 ≤ 𝑟 < 𝑏, such that 𝑎 = 𝑏 𝑞 + 𝑟.
In the equality given in the division algorithm, 𝑏 is called the divisor, 𝑎 is called the
dividend, 𝑞 is called the quotient, and 𝑟 is called the remainder.
Example: 𝑎 = 11, 𝑏 = 7 ; 11 = 1 × 7 + 4 ; here 𝑟 = 4, 𝑞 = 1.
𝑎 = −11, 𝑏 = 7 ; −11 = −2 × 7 + 3 ; here 𝑟 = 3, 𝑞 = −2.

Theorem: If 𝑎 and 𝑏 are two integers such that 𝑎 = 𝑞 𝑏 + 𝑟, then gcd 𝑎, 𝑏 = gcd 𝑏, 𝑟 .
Proof: Let gcd 𝑎, 𝑏 = 𝑑,
then 𝑑 | 𝑎 and 𝑑 | 𝑏
⟹ 𝑑 | 𝑎−𝑞𝑏 ,
i.e., 𝑑 | 𝑟 ∵ 𝑟 = 𝑎 − 𝑞𝑏 .
Therefore 𝑑 is a common divisor.
On the other hand, if 𝑐| 𝑏 and 𝑐 |𝑟
then 𝑐 | (𝑞𝑏 + 𝑟)
thus, 𝑐 | 𝑎.
Therefore 𝑐 is the common divisor of 𝑎 and 𝑏,
hence, 𝑐 | gcd 𝑎, 𝑏 , i.e., 𝑐 | 𝑑 ⟹ 𝑐 ≤ 𝑑.
Therefore 𝑑 = gcd 𝑏, 𝑟 .

The Euclidean Algorithm:


The Euclidean algorithm is the simple procedure to determine the greatest common divisor
of two integers.
Let 𝑎 and 𝑏 be the two integers whose gcd is desired. Since gcd 𝑎, 𝑏 = gcd 𝑎 , 𝑏 ,
there is no harm in assuming that 𝑎 ≥ 𝑏 > 0.
The first step is to apply the Division Algorithm to get ,
𝑎 = 𝑞1 𝑏 + 𝑟1 , 0 ≤ 𝑟1 < 𝑏
If 𝑟1 = 0, then 𝑏 | 𝑎 and gcd 𝑎, 𝑏 = 𝑏.
If 𝑟1 ≠ 0, then divide 𝑏 by 𝑟1 and apply the division algorithm to get,
𝑏 = 𝑞2 𝑟1 + 𝑟2 , 0 ≤ 𝑟2 < 𝑟1
If 𝑟1 = 0, then gcd 𝑎, 𝑑 = gcd 𝑏, 𝑟1 = 𝑟2
(∵ from the above theorem).
Otherwise, proceed as before to obtain:
𝑟1 = 𝑞3 𝑟2 + 𝑟3 , 0 ≤ 𝑟3 < 𝑟2 .
𝑡ℎ
This continues until some zero remainder appears, say, at the 𝑛 + 1 step where 𝑟𝑛−1 is
divided by 𝑟𝑛 .
The result is the following system of equations:
𝑎 = 𝑞1 𝑏 + 𝑟1 , 0 ≤ 𝑟1 < 𝑏
𝑏 = 𝑞2 𝑟1 + 𝑟2 , 0 ≤ 𝑟2 < 𝑟1
𝑟1 = 𝑞3 𝑟2 + 𝑟3 , 0 ≤ 𝑟3 < 𝑟2

𝑟𝑛−2 = 𝑞𝑛 𝑟𝑛−1 + 𝑟𝑛 , 0 ≤ 𝑟𝑛 < 𝑟𝑛−1
𝑟𝑛−1 = 𝑞𝑛+1 𝑟𝑛 + 0,
It follows from the theorem above that
gcd(𝑎, 𝑏) = gcd(𝑏, 𝑟1 ) = gcd(𝑟1 , 𝑟2 ) = · · · = gcd(𝑟𝑛−2 , 𝑟𝑛−1 ) = gcd(𝑟𝑛−1 , 𝑟𝑛 ) = 𝑟𝑛 .
∴ gcd 𝑎, 𝑏 = 𝑟𝑛 .
Example: 1. Find gcd of 128 and 36 by using Euclidean algorithm.
Solutions: 𝑎 = 128 and 𝑏 = 36.
By Euclidean algorithm: 128 = 3 × 36 + 20
36 = 1 × 20 + 16
20 = 1 × 16 + 4
16 = (4 × 4) + 0
∴ 4 | 16
𝐻𝑒𝑛𝑐𝑒 gcd(16, 4) = 4
gcd(128, 36) = gcd(36, 20) = gcd(20, 16) = gcd(16, 4) = 4.
2. Find gcd of 12378 and 3054 by using Euclidean algorithm.
Solutions: 𝑎 = 12378 and 𝑏 = 3054.
By Euclidean algorithm: 12378 = 4 × 3054 + 162
3054 = 18 × 162 + 138
162 = 1 × 138 + 24
138 = (5 × 24) + 18
24 = 1 × 18 + 6
18 = 3 × 6 + 0
∴ gcd 12378, 3054 = gcd 18, 6 = 6

3. Find gcd’s of the following numbers by using Euclidean algorithm.


(i) 2378 and 1769
(ii) 3875 and 180
(iii) 4454 and 1417.
The Extended Euclidean Algorithm:
Let 𝑎 and 𝑏 be two integers such that 𝑎 ≥ 𝑏 > 0. The Euclidean algorithm is extended to
find gcd 𝑎, 𝑏 , 𝑥 and 𝑦 such that gcd(𝑎, 𝑏) = 𝑎𝑥 + 𝑏𝑦.
For this purpose, first consider the Euclidean algorithm equation which yield gcd(𝑎, 𝑏) = 𝑟𝑛 .
Rewrite all equations involved in Euclidean algorithm except last one, by solving for the
remainders:
𝑟1 = 𝑎 − 𝑏 𝑞1
𝑟2 = 𝑏 − 𝑟3 𝑞2
𝑟3 = 𝑟1 − 𝑟2 𝑞3

𝑟𝑛−1 = 𝑟𝑛−3 − 𝑟𝑛−2 𝑞𝑛−1
𝑟𝑛 = 𝑟𝑛−2 − 𝑟𝑛−1 𝑞𝑛
Then, in last equation, 𝑟𝑛 = 𝑟𝑛−2 − 𝑟𝑛−1 𝑞𝑛 , replace 𝑟𝑛−1 in last equation by its previous
equation. Continue this process successively, replacing 𝑟𝑛−2 , 𝑟𝑛−3 , … . Until you obtain
final equation 𝑟𝑛 = 𝑎 𝑥 + 𝑏 𝑦 with 𝑥 and 𝑦.
1. Apply extended Euclidean Algorithm to find the numbers 𝑥 and 𝑦 such that
gcd(2378, 1769) = 2378 𝑥 + 1769 𝑦.
Solution: By Euclidean algorithm, we get, Solving for the remainders:

2378 = 1 × 1769 + 609 609 = 2378 − 1 × 1769


1769 = 2 × 609 + 551 551 = 1769 − 2 × 609
609 = 1 × 551 + 58 58 = 609 − 1 × 551
551 = 9 × 58 + 29 29 = 551 − 9 × 58
58 = 2 × 29 + 0
∴ gcd(2378, 1769) = 29
Now, we do the substitution starting wth that last equation in right side column.
gcd 2378, 1769 = 29 = 551 − 9 × 58
= 551 − 9 × 609 − 1 × 551 = 551 − (9 × 609) + (9 × 551)
= 10 × 551 − (9 × 609)
= 10 × 1769 − 2 × 609 − (9 × 609)
= 10 × 1769 − 29 × 609
= 10 × 1769 − 29 × 2378 − 1 × 1769
= 39 × 1769 − 29 × 2378
= −29 × 2378 + 39 × 1769
∴ 𝑥 = −29 and 𝑦 = 39
2. Apply extended Euclidean Algorithm to find the numbers 𝑥 and 𝑦 such that
gcd(4495, 1417) = 4495 𝑥 + 1417 𝑦.
Solution: By Euclidean algorithm, we get, Solving for remainders:
4495 = 3 × 1417 + 244 244 = 4495 − 3 × 1417
1417 = 5 × 244 + 197 197 = 1417 − 5 × 244
244 = 1 × 197 + 47 47 = 244 − 1 × 197
197 = 4 × 47 + 9 9 = 197 − 4 × 47
47 = 5 × 9 + 2 2 = 47 − 5 × 9
9= 4×2 +1 1 = 9 − (4 × 2)
2= 2×1 +0
∴ gcd(4495, 1417) = 1
Now, we do the substitution starting with that last equation in right side column.
gcd(4495, 1417) = 1 = 9 − (4 × 2)
= 9 − 4 × 47 − 5 × 9 = 9 − (4 × 47) + (20 × 9)
= 21 × 9 − (4 × 47)
= 21 × 197 − 4 × 47 − 4 × 47 = 21 × 197 − 84 × 47 − (4 × 47)
= 21 × 197 − 88 × 47
= 21 × 197 − 88 × 244 − 1 × 197
= 109 × 197 − 88 × 244
= 109 × 1417 − 5 × 244 − 88 × 244 = 109 × 1417 − 633 × 244

= 109 × 1417 − 633 × 4495 − 3 × 1417


= 2008 × 1417 − 633 × 4495 = −633 × 4495 + (2008) × 1417
∴ 𝑥 = −633 and 𝑦 = 2008.
3. Apply extended Euclidean Algorithm to find the numbers 𝑥 and 𝑦 such that
gcd(3875, 180) = 3875 𝑥 + 180 𝑦.
4. Apply extended Euclidean Algorithm to find the numbers 𝑥 and 𝑦 such that
gcd(12378, 3054) = 12378 𝑥 + 3054 𝑦.

Residue classes or Remainder classes:


The division algorithm tells us that there are only b possible remainders when dividing by b.
If we fix this divisor, we can group integers by the remainder. Each group is called a remainder
class modulo b (or sometimes residue class).
Example: Let 𝑏 = 5, We want to classify numbers by what their remainder would be when
divided by 5. From the division algorithm, we know there will be exactly 5 remainder classes,
because there are only 5 choices for what r could be (0 ≤ 𝑟 < 5).
First consider 𝑟 = 0. Here we are looking for all the numbers divisible by 5 since 𝑎 = 5𝑞 + 0. In
other words, the multiples of 5. We get the infinite set
{. . . , −15, −10, −5, 0, 5, 10, 15, 20, . . . }.
Next consider 𝑟 = 1. Which integers, when divided by 5, have remainder 1? Well, certainly 1,
does, as does 6, and 11. Negatives? Here we must be careful: −6 does NOT have remainder 1. We can
write −6 = −2 · 5 + 4 or −6 = −1 · 5 − 1, but only one of these is a “correct” instance of the
division algorithm: 𝑟 = 4 since we need 𝑟 to be non-negative. So in fact, to get 𝑟 = 1, we would
have −4, or −9, etc. Thus we get the remainder class
{. . . , −14, −9, −4, 1, 6, 11, 16, 21, . . . }.
There are three more to go. The remainder classes for 2, 3, and 4 are, respectively
. . . , −13, −8, −3, 2, 7, 12, 17, 22, . . .
{. . . , −12, −7, −2, 3, 8, 13, 18, 23, . . . }
{. . . , −11, −6, −1, 4, 9, 14, 19, 24, . . . }
Note that in the example above, every integer is in exactly one remainder class. The technical way
to say this is that the remainder classes modulo b form a partition of the integers.

Modular Arithmetic:
If 𝑎 is an integer and 𝑛 is a positive integer, we define ‘𝑎 𝑚𝑜𝑑 𝑛’ to be the remainder when
𝑎 is divided by 𝑛. The integer 𝑛 is called modulus.
For any integer 𝑎, we can write 𝑎 = 𝑞 𝑛 + 𝑟, 0≤𝑟<𝑛 (by division algorithm)
𝑎
that is, 𝑎= ∙ 𝑛 + 𝑎 𝑚𝑜𝑑 𝑛
𝑛

Example: 11 𝑚𝑜𝑑 7 = 4; −11 𝑚𝑜𝑑 7 = 3.

Congruence Modulo n :
We say a is congruent to b modulo n, and write, 𝑎 ≡ 𝑏 𝑚𝑜𝑑 𝑛 provided a and b have the
same remainder when divided by n (or (𝑎 𝑚𝑜𝑑 𝑛) = (𝑏 𝑚𝑜𝑑 𝑛)).
In other words, provided a and b belong to the same remainder class modulo n.
Many books define 𝑐𝑜𝑛𝑔𝑟𝑢𝑒𝑛𝑐𝑒 𝑚𝑜𝑑𝑢𝑙𝑜 𝑛 slightly differently. They say that 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) if
and only if 𝑛 | 𝑎 − 𝑏. In other words, two numbers are congruent modulo n, if their difference is
a multiple of n ( that is, 𝑎 − 𝑏 = 𝑘 ∙ 𝑛, for some integer 𝑘).

Properties of congruences:
Given any integers a, b, and c, and any positive integer n, the following hold:
1. 𝑎 ≡ 𝑎 (𝑚𝑜𝑑 𝑛).
2. If 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) then 𝑏 ≡ 𝑎 (𝑚𝑜𝑑 𝑛).
3. If 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) and 𝑏 ≡ 𝑐 (𝑚𝑜𝑑 𝑛), then 𝑎 ≡ 𝑐 (𝑚𝑜𝑑 𝑛).
In other words, congruence modulo n is reflexive, symmetric, and transitive, so is an equivalence
relation.
Proof:
1. For any integer 𝑎, 𝑎−𝑎 =0=0∙𝑛 ⟹ 𝑎 ≡ 𝑎 (𝑚𝑜𝑑 𝑛).
2. Let 𝑎 ≡ 𝑏 𝑚𝑜𝑑 𝑛 ⟹ 𝑎−𝑏 =𝑘∙𝑛 for some integer 𝑘.
Hence 𝑏 − 𝑎 = −𝑘𝑛 = −𝑘 𝑛
Since −𝑘 is also an integer, we can say 𝑏 ≡ 𝑎 (𝑚𝑜𝑑 𝑛).
3. Let 𝑎 ≡ 𝑏 𝑚𝑜𝑑 𝑛 then 𝑎 − 𝑏 = 𝑘1 ∙ 𝑛 for some integer 𝑘1
and 𝑏 ≡ 𝑐 𝑚𝑜𝑑 𝑛 then 𝑏 − 𝑐 = 𝑘2 ∙ 𝑛 for some integer 𝑘2
⟹ 𝑎 − 𝑐 = 𝑎 − 𝑏 + 𝑏 − 𝑐 = (𝑘1 + 𝑘2 ) ∙ 𝑛
⟹ 𝑎 ≡ 𝑐 𝑚𝑜𝑑 𝑛 .

Example: (i) 23 ≡ 8 𝑚𝑜𝑑 5 (∵ 23 − 8 = 15 = 3 × 5).


(ii) −11 ≡ 5 𝑚𝑜𝑑 8 (∵ −11 − 5 = −16 = −2 × 8).
Congruence and Arithmetic.
1. Suppose 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) and 𝑐 ≡ 𝑑 (𝑚𝑜𝑑 𝑛). Then 𝑎 + 𝑐 ≡ 𝑏 + 𝑑 (𝑚𝑜𝑑 𝑛) and
𝑎𝑐 ≡ 𝑏𝑑 (𝑚𝑜𝑑 𝑛).
2. If 𝑎 ≡ 𝑏 𝑚𝑜𝑑 𝑛 , then 𝑎 + 𝑐 ≡ 𝑏 + 𝑐 (𝑚𝑜𝑑 𝑛) and 𝑎𝑐 ≡ 𝑏𝑐 (𝑚𝑜𝑑 𝑛).
3. If 𝑎 ≡ 𝑏 𝑚𝑜𝑑 𝑛 , then 𝑎𝑘 ≡ 𝑏 𝑘 (𝑚𝑜𝑑 𝑛) for some integer 𝑘.
Proof:1. Suppose 𝑎 ≡ 𝑏 (𝑚𝑜𝑑 𝑛) and 𝑐 ≡ 𝑑 (𝑚𝑜𝑑 𝑛).
That means 𝑎 = 𝑏 + 𝑘1 𝑛 and 𝑐 = 𝑑 + 𝑘2 𝑛 for integers 𝑘1 and 𝑘2 .
Add these equations: 𝑎 + 𝑐 = 𝑏 + 𝑑 + 𝑘1 𝑛 + 𝑘2 𝑛.
But 𝑘1 𝑛 + 𝑘2 𝑛 = (𝑘1 + 𝑘2 )𝑛, which is just a multiple of n.
So 𝑎 + 𝑐 = 𝑏 + 𝑑 + (𝑘1 + 𝑘2 )𝑛,
that is, 𝑎 + 𝑐 − 𝑏 + 𝑑 = (𝑘1 + 𝑘2 )𝑛
or in other words, 𝑎 + 𝑐 ≡ 𝑏 + 𝑑 𝑚𝑜𝑑 𝑛 .
Now, multiply 𝑎 and 𝑐, we get 𝑎𝑐 = 𝑏 + 𝑘1 𝑛 𝑑 + 𝑘2 𝑛
𝑎𝑐 = 𝑏𝑑 + 𝑑𝑘1 𝑛 + 𝑏𝑘2 𝑛 + 𝑘1 𝑘2 𝑛2
But 𝑘1 𝑛 + 𝑏𝑘2 𝑛 + 𝑘1 𝑘2 𝑛2 = 𝑘1 + 𝑏𝑘2 + 𝑘1 𝑘2 𝑛 𝑛, which is a multiple of 𝑛.
So, 𝑎𝑐 = 𝑏𝑑 + 𝑘1 + 𝑏𝑘2 + 𝑘1 𝑘2 𝑛 𝑛
𝑎𝑐 − 𝑏𝑑 = 𝑘1 + 𝑏𝑘2 + 𝑘1 𝑘2 𝑛 𝑛
Hence, 𝑎𝑐 ≡ 𝑏𝑑 𝑚𝑜𝑑 𝑛 .
(2) and (3) follows from the property(1).
Problems: 1. Find the value of 117 𝑚𝑜𝑑 13 .
Solution: 112 = 121 ≡ 4 (𝑚𝑜𝑑 13)
114 = 112 × 112 ≡ 4 × 4 𝑚𝑜𝑑 13 ≡ 3 𝑚𝑜𝑑 13 (𝑏𝑦 𝑝𝑟𝑜𝑝𝑒𝑟𝑡𝑦 3)
∴ 117 = 114 × 112 × 11 ≡ 3 × 4 × 11 𝑚𝑜𝑑 13 ≡ 132 𝑚𝑜𝑑 13 ≡ 2 𝑚𝑜𝑑 13 .
∴ 117 𝑚𝑜𝑑 13 = 2.
2. Find the value of 1110 𝑚𝑜𝑑 9 .
Solution: 1110 = 114 × 114 × 112
11 ≡ 2 (𝑚𝑜𝑑 9)
112 = 22 𝑚𝑜𝑑 9 ≡ 4 𝑚𝑜𝑑 9 (𝑏𝑦 𝑝𝑟𝑜𝑝𝑒𝑟𝑡𝑦 3)
114 = 42 𝑚𝑜𝑑 9 ≡ 16 𝑚𝑜𝑑 9 ≡ 7 (𝑚𝑜𝑑 9)
∴ 1110 ≡ 7 × 7 × 4 𝑚𝑜𝑑 9 ≡ 7 × 28 𝑚𝑜𝑑 9 ≡ 7 𝑚𝑜𝑑 9 .
∴ 1110 𝑚𝑜𝑑 9 = 7.
Theorem: If 𝑎𝑏 ≡ 𝑎𝑐(𝑚𝑜𝑑 𝑛) and gcd 𝑎, 𝑛 = 1, then 𝑏 ≡ 𝑐 (𝑚𝑜𝑑 𝑛).
Proof: Suppose 𝑎𝑏 ≡ 𝑎𝑐(𝑚𝑜𝑑 𝑛).
That means, 𝑛|𝑎𝑏 − 𝑎𝑐 or 𝑛| 𝑎 𝑏 − 𝑐 .
But 𝑎 and 𝑛 are relatively prime numbers ( gcd 𝑎, 𝑛 = 1).
So, 𝑛|(𝑏 − 𝑐). Hence 𝑏 ≡ 𝑐 𝑚𝑜𝑑 𝑛 .
Prime Numbers:
Fundamental theorem of arithmetic:
𝑎 𝑎 𝑎 𝑎
Any integer a > 1 can be factored in a unique way as, 𝑎 = 𝑝1 1 × 𝑝2 2 × 𝑝3 3 × ⋯ × 𝑝𝑡 𝑡
where 𝑝1 < 𝑝2 < 𝑝3 < ⋯ < 𝑝𝑡 are prime numbers and 𝑎1 , 𝑎2 , … , 𝑎𝑡 are positive integers.
Examples: 91 = 7 × 13
3600 = 24 × 32 × 52
11011 = 7 × 112 × 13.
If 𝑃 is the set of prime numbers, the any positive integer can be written uniquely as:
𝑎 = ς𝑝∈ 𝑃 𝑝𝑎𝑝 where each 𝑎𝑝 ≥ 0.
Example: 12 = 22 × 3, 𝑎2 = 2, 𝑎3 = 1
18 = 2 × 32 , 𝑎2 = 1, 𝑎3 = 2
3600 = 24 × 32 × 52 , 𝑎2 = 4, 𝑎3 = 2, 𝑎5 = 2.
Note: Any integer of the form 𝑝𝑘 can be divisible only by an integer 𝑝 𝑗 with 𝑗 ≤ 𝑘. Therefore, for

given 𝑎 and 𝑏 such that 𝑎 = ς𝑝∈ 𝑃 𝑝𝑎𝑝 and 𝑏 = ς𝑝∈ 𝑃 𝑝𝑏𝑝 .

If 𝑎|𝑏 , then 𝑎𝑝 ≤ 𝑏𝑝 for all 𝑝.


Example: 𝑎 = 12; 𝑏 = 36; 12|36
12 = 22 × 3 and 36 = 22 × 32 .
It is easy to determine the greatest common divisor of two positive integers if we express each
integer as the product of primes. If 𝑘 = gcd 𝑎, 𝑏 , then 𝑘𝑝 = min(𝑎𝑝 , 𝑏𝑝 ) for all 𝑝.
Example: 300 = 22 × 31 × 52
18 = 21 × 32
gcd 18, 300 = 21 × 31 × 50 = 6.
Result: If 𝑝 is a prime and 𝑝|𝑎𝑏, then 𝑝|𝑎 or 𝑝|𝑏.
Contrapositive of the above statement is, if 𝑝 ∤ 𝑎 𝑎𝑛𝑑 𝑝 ∤ 𝑏 ⟹ 𝑝 ∤ 𝑎𝑏.
Fermat’s and Eulre’s theorem:
Two theorems that play important roles in public-key cryptography are Fermat’s theorem and
Euler’s theorem.
Fermat’s Theorem
Fermat’s theorem states the following: If p is prime and a is a positive integer not divisible
by p, then
𝑎𝑝−1 ≡ 1 (𝑚𝑜𝑑 𝑝)
Proof: Consider the set of positive integers less than 𝑝: {1, 2, … , 𝑝 − 1} and multiply each
element by 𝑎, and take modulo 𝑝.
Then we get the set 𝑋 = {𝑎 𝑚𝑜𝑑 𝑝, 2𝑎 𝑚𝑜𝑑 𝑝, … , (𝑝 − 1)𝑎 𝑚𝑜𝑑 𝑝}.
None of the elements of X is equal to zero because 𝑝 ∤ 𝑎 .
Furthermore, no two elements in X are equal.
To check this, assume that 𝑗𝑎 ≡ 𝑘𝑎 (𝑚𝑜𝑑 𝑝), where 1 ≤ 𝑗 < 𝑘 ≤ 𝑝 − 1.
Since 𝑎 is relatively prime to 𝑝 , that gcd 𝑝, 𝑎 = 1,
⟹ 𝑗 ≡ 𝑘 (𝑚𝑜𝑑 𝑝)
This last equality is impossible, because 𝑗 and 𝑘 are both positive integers less than 𝑝. Hence
no two elements in X are equal.
Therefore, the elements in 𝑋 must be congruent modulo 𝑝 to 1, 2, 3, … , 𝑝 − 1, taken in
some order. Multiplying the numbers in both sets (p and X) and taking the result mod 𝑝 yields,
𝑎 × 2𝑎 × 3𝑎 × ⋯ × 𝑝 − 1 𝑎 ≡ (1 × 2 × 3 × ⋯ × 𝑝 − 1)(𝑚𝑜𝑑 𝑝)
𝑎𝑝−1 𝑝 − 1 ! ≡ 𝑝 − 1 ! (𝑚𝑜𝑑 𝑝)
Since 𝑝 and 𝑝 − 1 ! are relative primes, we get,
𝑎𝑝−1 ≡ 1 (𝑚𝑜𝑑 𝑝).
Example:
𝑎 = 7, 𝑝 = 19
72 = 49 ≡ 11(𝑚𝑜𝑑 19)
74 ≡ 121(𝑚𝑜𝑑 11) ≡ 7(𝑚𝑜𝑑 19)
78 ≡ 49(𝑚𝑜𝑑 19) ≡ 11(𝑚𝑜𝑑 19)
716 ≡ 11 × 11 𝑚𝑜𝑑 19 = 7 (𝑚𝑜𝑑 19)
718 ≡ 11 × 7 𝑚𝑜𝑑 19 ≡ 77 𝑚𝑜𝑑 19 ≡ 1 𝑚𝑜𝑑 19 .

Note: An alternative form of Fermat’s theorem is also useful: If 𝑝 is a prime 𝑎 is a positive


integer, then 𝑎𝑝 ≡ 𝑎 𝑚𝑜𝑑 𝑝 .
Example: 𝑝 = 5, 𝑎 = 3, 𝑎𝑝 = 35 = 243 ≡ 3 (𝑚𝑜𝑑 5)
𝑝 = 5, 𝑎 = 10, 𝑎𝑝 = 105 ≡ 10 𝑚𝑜𝑑 5 ≡ 0 𝑚𝑜𝑑 5 ≡ 𝑎 𝑚𝑜𝑑 𝑝 .
Euler Totient function:
For 𝑛 ≥ 1, the Euler totient function, written 𝜙(𝑛), is defined as the number of positive
integers less than 𝑛 and relatively prime to 𝑛.
Example: Determine 𝜙(37) and 𝜙(35).
Because 37 is prime, all of the positive integers from 1 through 36 are relatively prime to 37.
Thus 𝜙(37) = 36.
To determine 𝜙(35), we list all of the positive integers less than 35 that are relatively prime to it:
1, 2, 3, 4, 6, 8, 9, 11, 12, 13, 16, 17, 18, 19, 22, 23, 24, 26, 27, 29, 31, 32, 33, 34
There are 24 numbers on the list, so 𝜙(35) = 24.
Note:
1. If 𝑛 is a prime number, then every integer less than 𝑛 is relatively prime to it, so 𝜙 𝑛 = 𝑛 − 1.
2. If 𝑛 = 𝑝𝑞, 𝑝 𝑎𝑛𝑑 𝑞 are primes with 𝑝 ≠ 𝑞, then 𝜙 𝑝𝑞 = 𝜙 𝑝 𝜙 𝑞 = 𝑝 − 1 × 𝑞 − 1 .
Example: 𝜙 21 = 𝜙 3 × 7 = 𝜙(3) 𝜙 7 = 2 × 6 = 12.
Euler’s Theorem:
Statement: If 𝑛 ≥ 1 and gcd 𝑎, 𝑛 = 1, then 𝑎𝜙(𝑛) ≡ 1 𝑚𝑜𝑑 𝑛 .
Proof: Let 𝑥1 , 𝑥2 , … , 𝑥𝜙 𝑛 be the positive integers less than 𝑛 that are relatively prime to 𝑛.
i.e., gcd 𝑛, 𝑥𝑖 = 1 for 𝑖 = 1, 2, 3, … , 𝜙(𝑛)
Let 𝑅 = { 𝑥1 , 𝑥2 , … , 𝑥𝜙 𝑛 }.
Now multiply each element of R by a and take modulo n:
𝑆 = {𝑎𝑥1 (𝑚𝑜𝑑 𝑛), 𝑎𝑥2 (𝑚𝑜𝑑 𝑛), … , 𝑎𝑥𝜙 𝑛 (𝑚𝑜𝑑 𝑛)}
Since gcd 𝑎, 𝑛 = 1 and gcd 𝑥𝑖 , 𝑛 = 1 ⟹ gcd 𝑎 𝑥𝑖 , 𝑛
Thus, all the elements of S are integers that are less than 𝑛 and relatively prime to 𝑛. Also there
are no duplicate elements in 𝑆. Hence,

𝑆 = 𝑎𝑥1 𝑚𝑜𝑑 𝑛 , 𝑎𝑥2 𝑚𝑜𝑑 𝑛 , … , 𝑎𝑥𝜙 𝑛 𝑚𝑜𝑑 𝑛 = { 𝑥1 , 𝑥2 , … , 𝑥𝜙 𝑛 } in some order


There fore, 𝑎𝑥1 × 𝑎𝑥2 × ⋯ × 𝑎𝑥𝜙 𝑛 ≡ (𝑥1 × 𝑥2 × ⋯ × 𝑥𝜙 𝑛 )(𝑚𝑜𝑑 𝑛)

𝑎𝜙 𝑛 𝑥1 × 𝑥2 × ⋯ × 𝑥𝜙 𝑛 ≡ (𝑥1 × 𝑥2 × ⋯ × 𝑥𝜙 𝑛 )(𝑚𝑜𝑑 𝑛)

Since, gcd 𝑥𝑖 , 𝑛 = 1 ⟹ gcd 𝑥1 × 𝑥2 × ⋯ × 𝑥𝜙 𝑛 , 𝑛 =1


∴ 𝑎𝜙 𝑛
≡ 1(𝑚𝑜𝑑 𝑛)
Problems:
1. Let 𝑛 = 10, 𝑎 = 3 ; 𝜙 10 = 4, 𝑎𝜙 10
= 34 = 81 ≡ 1 (𝑚𝑜𝑑 10)
2. 𝑎 = 2, 𝑛 = 11 ⟹ 210 ≡ 1 𝑚𝑜𝑑 11 .
3. Evaluate 325 𝑚𝑜𝑑 10 .
Solution: Since gcd 3, 10 = 1, by Euler’s theorem 3𝜙 10 ≡ 1 𝑚𝑜𝑑 10 ,
But 𝜙 10 = 4, so, 34 ≡ 1 𝑚𝑜𝑑 10
∴ 34 6 = 324 ≡ 1 𝑚𝑜𝑑 10 ⇒ 325 ≡ 3 × 1 ≡ 3 𝑚𝑜𝑑 10 .
3. Evaluate 𝑖 2100000 𝑚𝑜𝑑 77 and 𝑖𝑖 28 𝑚𝑜𝑑 15 .
Testing for the Primality:
Miller-Rabin Algorithm:
This algorithm is typically used to test a large number for primality.
We need the following properties of numbers to develop Miller-Rabin algorithm.
I. Any positive odd integer 𝑛 ≥ 3 can be expressed as 𝑛 − 1 = 2𝑘 𝑞 with 𝑘 > 0,
𝑞 is an odd number.
II. Two properties of prime numbers:
Let 𝑝 be a prime number greater than 2. We can then write 𝑝 − 1 = 2𝑘 𝑞 with, 𝑘 > 0,
𝑞 odd. Let a be any integer in the range 1 < 𝑎 < 𝑝 − 1. Then one of the two following
conditions is true.
(i) 𝑎𝑞 𝑚𝑜𝑑 𝑝 = 1, that is, 𝑎𝑞 ≡ 1(𝑚𝑜𝑑 𝑝).
𝑘−1 𝑞
(ii) One of the numbers 𝑎𝑞 , 𝑎2𝑞 , 𝑎4𝑞 , … , 𝑎2 is congruent to 𝑝 − 1 𝑚𝑜𝑑𝑢𝑙𝑜 𝑝.
2𝑗𝑞 2𝑗𝑞
that is, for 𝑎 ≤ 𝑗 ≤ 𝑘 − 1 , 𝑎 ≡ 𝑝 − 1(𝑚𝑜𝑑 𝑝) or 𝑎 ≡ − 1 𝑚𝑜𝑑 𝑝 .
Miller-Rabin Algorithm:
We can use the preceding property to devise a test for primality. The procedure TEST takes a
candidate integer 𝑛 as input and returns the result “composite” if n is definitely not a prime, and
the result “inconclusive” if 𝑛 may or may not be a prime.
TEST (n)
1. Find integers 𝑘, 𝑞, with 𝑘 > 0, 𝑞 odd, so that (𝑛 − 1 = 2𝑘 𝑞);
2. Select a random integer 𝑎, 1 < 𝑎 < 𝑛 − 1 ;
3. if 𝑎𝑞 𝑚𝑜𝑑 𝑛 = 1 then return (“inconclusive”);
4. for 𝑗 = 0 to 𝑘 – 1 do
𝑗
5. if 𝑎2 𝑞 𝑚𝑜𝑑 𝑛 = 𝑛 − 1 then return (“inconclusive”);
6. return (“composite”);
Example: 1. Check whether 29 is prime.
Solution: Given 𝑛 = 29.
Let us apply the test to the prime number 𝑛 = 29.
We have 𝑛 − 1 = 28 = 22 (7) = 2𝑘 𝑞 , 𝑘 = 2 > 0 and 𝑞 = 7, odd.
First, let us try a = 10. Then, 107 ≡ 100 (𝑚𝑜𝑑 29) ≡ 17(𝑚𝑜𝑑 29)
or 107 𝑚𝑜𝑑 29 = 17, which is neither 1 nor 28, so we continue the test.
The next calculation finds that 107 2 (𝑚𝑜𝑑 29) = 28, and the test returns “inconclusive”
(i.e., 29 may be prime).
Let’s try again with 𝑎 = 2. We will get the following calculations:
27 𝑚𝑜𝑑 29 = 12; 214 𝑚𝑜𝑑 29 = 28 ;
and test again returns “ inconclusive”. If we perform the test for all integers 𝑎 in the range 1
through 28, we get the same “inconclusive” result, which concludes that 𝑛 is a prime number.
2. Check whether the number 221 is prime or not.
Solution: Here 𝑛 = 221, then 𝑛 − 1 = 220 = 22 × 55, 𝑘 = 2, 𝑞 = 55.
Take 𝑎 = 5, then 555 𝑚𝑜𝑑 221 = 112 ≠ 1 𝑜𝑟 220
555 2 𝑚𝑜𝑑 221 = 168 ≠ 1 𝑜𝑟 220
Since the conditions in step 3 and step 5 are not satisfying, the Test returns to “composite”. It
conclude that 221 is definitely a composite number.

Problem: Check whether 63 is prime by using Miller-Rabin Algorithm.


Linear congruence:
A congruence of the form 𝑎𝑥 ≡ 𝑏 𝑚𝑜𝑑 𝑛 , where 𝑎 and 𝑏 are integers, 𝑛 is a positive
integer and 𝑥 is an unknown, is called linear congruence in variable 𝑥. An integer 𝑥0 is said to be
a solution of the congruence equation 𝑎𝑥 ≡ 𝑏 𝑚𝑜𝑑 𝑛 if 𝑎𝑥0 ≡ 𝑏 𝑚𝑜𝑑 𝑛 .

Result: Let 𝑎, 𝑏 𝑎𝑛𝑑 𝑛 be integers with 𝑛 > 0 and gcd 𝑛, 𝑎 = 1 . Then the congruence
𝑎𝑥 ≡ 𝑏(𝑚𝑜𝑑 𝑛) has a solution that is unique modulo n.

Chinese remainder theorem: This theorem deals with the solutions of simultaneous linear
congruences.
Statement of Chinese remainder theorem:

Let 𝑛1 , 𝑛2 , … , 𝑛𝑘 be positive integers such that gcd 𝑛𝑖 , 𝑛𝑗 = 1 for 𝑖 ≠ 𝑗. Then for any
integers 𝑎1 , 𝑎2 , … , 𝑎𝑘 , the system of linear congruences
𝑥 ≡ 𝑎1 𝑚𝑜𝑑 𝑛1
𝑥 ≡ 𝑎2 𝑚𝑜𝑑 𝑛2

𝑥 ≡ 𝑎𝑘 𝑚𝑜𝑑 𝑛𝑘 has a solution.
Further more, any two solutions of the system are congruent modulo 𝑛1 𝑛2 ∙ ⋯ 𝑛𝑘 .
𝑁
Proof : Let 𝑁 = 𝑛1 × 𝑛2 ×∙ ⋯ × 𝑛𝑘 and 𝑀𝑖 = for 𝑖 = 1, 2, 3, … . , 𝑘.
𝑛𝑖

Since gcd 𝑛𝑖 , 𝑛𝑗 = 1 for 𝑖 ≠ 𝑗


⟹ gcd 𝑀𝑖 , 𝑛𝑖 = 1 for 𝑖 = 1, 2, 3, … , 𝑘.
We know that, For every 𝑖 = 1, 2, … , 𝑘, the linear congruence 𝑀𝑖 𝑥 ≡ 1 𝑚𝑜𝑑 𝑛𝑖 has a
unique solution, say 𝑏𝑖 .
That is, 𝑀𝑖 𝑏𝑖 ≡ 1 𝑚𝑜𝑑 𝑛𝑖 for 𝑖 = 1, 2, … , 𝑘.
Now, we shall show that the integer 𝑥0 = 𝑎1 𝑏1 𝑀1 + 𝑎2 𝑏2 𝑀2 + ⋯ + 𝑎𝑘 𝑏𝑘 𝑀𝑘 is a solution
of given system of congruences.
𝑁
Observe that, 𝑀𝑖 = = 𝑛1 𝑛2 … 𝑛𝑖−1 𝑛𝑖+1 … 𝑛𝑘 ≡ 0 (𝑚𝑜𝑑 𝑛𝑗 ),
𝑛𝑖

for 𝑗 = 1, 2, … , 𝑖 − 1, 𝑖 + 1, … , 𝑘.
Hence 𝑥0 = 𝑎1 𝑏1 𝑀1 + 𝑎2 𝑏2 𝑀2 + ⋯ + 𝑎𝑘 𝑏𝑘 𝑀𝑘 ≡ 𝑎𝑖 𝑏𝑖 𝑀𝑖 (𝑚𝑜𝑑 𝑛𝑖 ), for 𝑖 = 1, 2, … , 𝑘.
But, 𝑀𝑖 𝑏𝑖 ≡ 1 𝑚𝑜𝑑 𝑛𝑖
and hence, 𝑀𝑖 𝑏𝑖 𝑎𝑖 ≡ 𝑎𝑖 𝑚𝑜𝑑 𝑛𝑖
∴ 𝑥0 = 𝑎𝑖 𝑏𝑖 𝑀𝑖 𝑚𝑜𝑑 𝑛𝑖 ≡𝑎𝑖 (𝑚𝑜𝑑 𝑛𝑖 ) for 𝑖 = 1, 2, … , 𝑘
that is, 𝑥0 ≡ 𝑎1 𝑚𝑜𝑑 𝑛1
𝑥0 ≡ 𝑎2 𝑚𝑜𝑑 𝑛2

𝑥0 ≡ 𝑎𝑘 𝑚𝑜𝑑 𝑛𝑘 .
Thus 𝑥0 is a solution of the given system of congruence equations.
Further more, if 𝑥′ ≡ 𝑎𝑖 𝑚𝑜𝑑 𝑛𝑖 for 𝑖 = 1, 2, … , 𝑘
that is, 𝑥′ is also the solution of given system of congruence equations and hence
𝑥′ ≡ 𝑥0 𝑚𝑜𝑑 𝑛𝑖 for 𝑖 = 1, 2, … , 𝑘
Hence, for each 𝑖, 𝑛𝑖 | 𝑥 ′ − 𝑥0 .

Since gcd 𝑛𝑖 , 𝑛𝑗 = 1 for 𝑖 ≠ 𝑗, so 𝑛1 𝑛2 ∙ ⋯ 𝑛𝑘 (𝑥 ′ −𝑥0 .


Thus, 𝑥 ′ ≡ 𝑥0 (𝑚𝑜𝑑 𝑛1 𝑛2 ∙ ⋯ 𝑛𝑘 ).
Use Chinese remainder theorem to solve the following system of congruence.
1) 𝑥 ≡ 2 𝑚𝑜𝑑 3
𝑥 ≡ 3 𝑚𝑜𝑑 5
𝑥 ≡ 2 𝑚𝑜𝑑 7
Solution : Let 𝑁 = 3 × 5 × 7 = 105
𝑁 105 105 105
𝑀1 = = = 35, 𝑀2 = = 21 and 𝑀3 = = 15
𝑛1 3 5 7

Consider the linear congruences, M1 𝑥 = 35𝑥 ≡ 1 𝑚𝑜𝑑 3


M2 𝑥 = 21𝑥 ≡ 1 𝑚𝑜𝑑 5
M3 𝑥 = 15𝑥 ≡ 1 𝑚𝑜𝑑 7
that is, 33 + 2 𝑥 ≡ 1 𝑚𝑜𝑑 3 ⟹ 2𝑥 ≡ 1(𝑚𝑜𝑑 3)
(20 + 1)𝑥 ≡ 1 𝑚𝑜𝑑 5 ⟹ 𝑥 ≡ 1(𝑚𝑜𝑑 5)
14 + 1 𝑥 ≡ 1 𝑚𝑜𝑑 7 ⟹ 𝑥 ≡ 1(𝑚𝑜𝑑 7)
Here, 𝑥 = 2 is the solution of the equation 2𝑥 ≡ 1(𝑚𝑜𝑑 3),
𝑥 = 1 is solution of the equation 𝑥 ≡ 1(𝑚𝑜𝑑 5)
and 𝑥 = 1 is solution of the equation 𝑥 ≡ 1(𝑚𝑜𝑑 7)
Hence, the solution of the system is given by, 𝑥0 = 𝑎1 𝑏1 𝑀1 + 𝑎2 𝑏2 𝑀2 + 𝑎3 𝑏3 𝑀3
(Here 𝑎1 = 2, 𝑎2 = 3, 𝑎3 = 2, 𝑏1 = 2, 𝑏2 = 1 𝑎𝑛𝑑 𝑏3 = 1).
There fore 𝑥0 = 2 × 2 × 35 + 3 × 1 × 21 + 2 × 1 × 15 = 233.
The solution of the given congruences is 233.
That is, 𝑥0 = 233 ≡ 23 𝑚𝑜𝑑 105 .
2) 𝑥 ≡ 3 𝑚𝑜𝑑 7
𝑥 ≡ 5 𝑚𝑜𝑑 9
𝑥 ≡ 4 𝑚𝑜𝑑 5
Solution : Let 𝑁 = 7 × 9 × 5 = 315
𝑁 315 315 315
𝑀1 = = = 45, 𝑀2 = = 35 and 𝑀3 = = 63
𝑛1 7 9 5

Consider the linear congruences, M1 𝑥 = 45𝑥 ≡ 1 𝑚𝑜𝑑 7


M2 𝑥 = 35𝑥 ≡ 1 𝑚𝑜𝑑 9
M3 𝑥 = 63𝑥 ≡ 1 𝑚𝑜𝑑 5
that is, 42 + 3 𝑥 ≡ 1 𝑚𝑜𝑑 7 ⟹ 3𝑥 ≡ 1(𝑚𝑜𝑑 7)
(27 + 8)𝑥 ≡ 1 𝑚𝑜𝑑 9 ⟹ 8𝑥 ≡ 1(𝑚𝑜𝑑 9)
60 + 3 𝑥 ≡ 1 𝑚𝑜𝑑 5 ⟹ 3𝑥 ≡ 1(𝑚𝑜𝑑 5)
Here, 𝑥 = 5 is the solution of the equation 3𝑥 ≡ 1(𝑚𝑜𝑑 7),
𝑥 = 8 is solution of the equation 8𝑥 ≡ 1(𝑚𝑜𝑑 9)
and 𝑥 = 2 is solution of the equation 3𝑥 ≡ 1(𝑚𝑜𝑑 5)
Hence, the solution of the system is given by, 𝑥0 = 𝑎1 𝑏1 𝑀1 + 𝑎2 𝑏2 𝑀2 + 𝑎3 𝑏3 𝑀3
(Here 𝑎1 = 3, 𝑎2 = 5, 𝑎3 = 4, 𝑏1 = 5, 𝑏2 = 8 𝑎𝑛𝑑 𝑏3 = 2).
There fore 𝑥0 = 3 × 5 × 45 + 5 × 8 × 35 + 4 × 2 × 63 = 2579.
The solution of the given congruences is 2579.
That is, 𝑥0 = 2579 ≡ 59 𝑚𝑜𝑑 315 .
3)Solve: 𝒙 ≡ 𝟐 𝒎𝒐𝒅 𝟑
𝒙 ≡ 𝟏 𝒎𝒐𝒅 𝟓
𝒙 ≡ 𝟓 𝒎𝒐𝒅 𝟕
Ans: 𝟐𝟑𝟔 ≡ 𝟐𝟔(𝒎𝒐𝒅 𝟏𝟎𝟓)

You might also like