Chapter 3 Lecture Notes - Theory of Congruence
Chapter 3 Lecture Notes - Theory of Congruence
SEMESTER 1 2022/2023
Definition 1
@ a b(mod n) a = kn + b
Let n be a fixed positive integer, and let a, b Z. We say n | (a – b)
“a is congruent to b modulo n “, and can be denoted by
Example.
(ii)
4 = 6(1) + (-2) or 4 – (-2) = 6(1)
2
CONGRUENCE MODULO n
Notes:
• Congruences are only defined for integers, and the modulo m must be a natural number.
For example,
a ≡ 1/2 mod 2 is not defined since 1/2 is not an integer;
similarly, a ≡ b mod 0 is not defined since 0 is not a natural number
3
CONGRUENCE MODULO n
Facts:
• Any two integers are congruent modulo 1.
• Two integers are congruent modulo 2 when they are both even or
both odd.
4
CONGRUENCE MODULO n
The Division Algorithm and Congruence Modulo n
(a)
(b)
(c)
5
Congruence Modulo n
The Division Algorithm and Congruence Modulo n
(d)
(e)
13 51
6
The Division Algorithm and Congruence Modulo n
Example.
7
Congruence Modulo n
Remainder
Theorem 1
Example.
Hence, 12 82 (mod 7)
8
Congruence Modulo n
Remainder
Exercise.
1. Show that 60 28 (mod 8). Justify your answer.
9
Congruence Modulo n
Properties of Congruence
Theorem 2
(a) a a (mod n)
10
Congruence Modulo n
Properties of Congruence
Theorem 2 (cont.)
11
Properties of Congruence
Proof.
(d)
12
Properties of Congruence
Note:
13
Some Applications of Congruence
Finding Remainders
Example.
Solution.
14
Some Applications of Congruence
Finding Remainders
Example.
Solution.
15
Some Applications of Congruence
Exercise.
Show that (
41| 2 − 1
20
)
16
Some Applications of Congruence
Converse of Theorem 2 (e) - Part Two (Multiplication)
Theorem 3
n
If ac bc ( modn ) then a b mod where d = gcd (c , n )
d
Example.
17
Some Applications of Congruence
Converse of Theorem 2 (e) - Part Two (Multiplication)
Proof.
18
Some Applications of Congruence
Converse of Theorem 2 (e) - Part Two (Multiplication)
Corollary 1
If ac bc ( mod n ) and gcd (c , n ) = 1 then a b ( modn )
Example.
Let 14 84 (mod 7)
Where,
2(7) 2(42) mod 7 gcd (2,7) = 1
Then, 7 42 mod 7
19
Some Applications of Congruence
Converse of Theorem 2 - Part Two
Corollary 2
If ac bc ( mod p ) where p | c , p is prime number
then a b ( mod p )
Example.
Let 14 84 (mod 7)
Where,
2(7) 2(42) mod 7 7 | 2, 7 is a prime
Then, 7 42 mod 7
20
Some Applications of Congruence
Congruence and Least Common Multiple (LCM)
Theorem 4
( )
If a b modn1 , a b ( modn 2 ) , ... , a b ( modnk ) , where
a , b, n1 , n 2 , ... , nk are integers where n1 , n 2 , ... , nk are
positive, then
a b ( lcm ( n1 , n 2 , ... , nk ) ) .
Example.
Let 24 16 mod 2
24 16 mod 4
24 16 mod 8
21
Some Applications of Congruence
Congruence and Least Common Multiple (LCM)
Corollary 3
( )
If a b modn1 , a b ( modn 2 ) , ... , a b ( modnk ) , where
a , b are integers and n1 , n 2 , ... , nk are pairwise relatively prime
positive integers, then
a b ( mod ( n1 , n 2 , ... , nk ) ) .
Example
Let 60 30 mod 2
60 30 mod 3
60 30 mod 5
Where gcd(2,3,5) = 1
Then, 60 30 mod (2 . 3. 5)
30 mod 30.
22
Some Applications of Congruence
Arithmetic Inverse
Example.
i.
ii.
23
Representation of Positive Integers
Definition 3
24
Representation of Positive Integers
Decimal and Binary Representations of Positive Integers
• Up to now in your life, you’ve represented numbers using a decimal representation (the ten digits from 0,1, ... 9).
The reason 10 is special is that we have ten fingers. There is no other reason for using decimal. There is nothing
special otherwise about the number ten.
• Computers don’t represent numbers using decimal. Instead, they represent numbers using binary.
• In decimal, we write numbers using digits {0,1, . . . ,9}, in particular, as sums of powers of 10 (Example i).
• In binary, we represent numbers using bits {0,1}, in particular, as a sum of powers of two (Example ii.).
Example.
i.
ii.
25
Representation of Positive Integers
• To convert from a binary number to a decimal number we need to write the powers of 2 as
decimal numbers and then add up these decimal numbers.
26
Representation of Positive Integers
Decimal and Binary Representations of Positive Integers
• When m is already represented as binary number (i.e. “base 2”), the quotient and remainder
are trivial to obtain.
• The remainder is the right most bit – called the least significant bit (LSB).
• The quotient is the number with the LSB chopped off.
• Note that writing a positive integer as an n bit binary number means that we write it as a sum
of powers of 2,
Example
27
Representation of Positive Integers
Decimal and Binary Representations of Positive Integers
Solution.
Thus,
28
Representation of Positive Integers
Decimal and Binary Representations of Positive Integers
Exercise.
Convert the following number (base 10) into binary (base 2). Show your steps.
i. (172)10
ii. (59)10
iii. (130)10
iv. (85)10
Answer:
i. (10101100)2
ii. (111011)2
iii. (10000010)2
iv. (1010101)2
29
Representation of Positive Integers
Decimal and Binary Representations of Positive Integers
Example.
Compute 311 .
Solution.
Given the computations above,
only 3 more modular multiplications
produce 311 (mod m)
30
Representation of Positive Integers
Polynomial Functions
Theorem 5
m
Let P ( x ) = c k x k
be a polynomial function of x with
k =0
Proof.
31
Representation of Positive Integers
Polynomial Functions
Note:
Corollary 4
If a is a solution of the congruence P ( x ) 0 ( mod n ) and
a b ( modn ) , then b is also a solution of the congruence
P ( x ) 0 ( mod n ) .
32
Representation of Positive Integers
Integers Divisible by 9
Theorem 6
Proof. Example.
Note that,
117 = 1 + 1 + 7 =9
Since 9 0 mod 9,
Then
9 | 117.
33
Representation of Positive Integers
Integers Divisible by 3
Corollary 5
34
Representation of Positive Integers
Integers Divisible by 11
Theorem 7
35
Representation of Positive Integers
Integers Divisible by 9,3, and 11
Example.
36
Representation of Positive Integers
Integers Divisible by 9,3, and 11
Example.
Example.
37
Representation of Positive Integers
Decimal Digits
Example.
Solution.
38
Linear Congruences
Example.
39
Linear Congruences
Notes:
Example.
40
Linear Congruences
Incongruent Solutions
Theorem 8
Let ax b ( mod n ) be a linear congruence and let d = gcd ( a , n ) .
Then ax b ( mod n ) has a solution if and only if d | b .
If d | b , then it has d mutually incongruent solutions modulo n.
Example.
41
Linear Congruences
Incongruent Solutions
Notes:
42
Linear Congruences
Incongruent Solutions
Notes:
43
Linear Congruences
Unique Solutions
Corollary 6.
The linear congruence ax b ( mod n ) has a unique solution
modulo n if gcd ( a , n ) = 1 .
Proof.
44
Linear Congruences
Unique Solutions
Example.
45
Linear Congruences
Incongruent Solutions
Example.
The six incongruent solutions are : 4, 11, 18, 25, 32, 39 mod 42
46
Systems of Linear Congruences
47
Systems of Linear Congruences
48
Systems of Linear Congruences
49
Solving Systems of Linear Congruences
Example.
Solution.
50
Solving Systems of Linear Congruences
Solution. (cont.)
51
Solving Systems of Linear Congruences
Solution. (cont.)
52
Chinese Remainder Theorem
( )
Let n1 , n 2 , ... , nr be positive integers such that gcd ni , n j = 1 ,
i j . Then the system of linear congruences
x a 1 ( mod n1 )
x a 2 ( mod n 2 )
:
:
x a r ( mod nr )
has a simultaneous solution, which is unique modulo n = n1 n 2 ... nr .
53
Chinese Remainder Theorem
Notes.
54
Chinese Remainder Theorem
Example.
Solve
Solution.
Then,
55
Chinese Remainder Theorem
Example.
Solution.
56