0% found this document useful (0 votes)
34 views56 pages

Chapter 3 Lecture Notes - Theory of Congruence

The document covers the theory of congruence in elementary number theory, defining congruence modulo n and providing examples and properties. It includes theorems related to congruences, applications, and methods for finding remainders, as well as representations of integers in decimal and binary forms. Additionally, it discusses linear congruences and their solutions, emphasizing the conditions for existence and uniqueness of solutions.

Uploaded by

Hafidz Hakimi
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)
34 views56 pages

Chapter 3 Lecture Notes - Theory of Congruence

The document covers the theory of congruence in elementary number theory, defining congruence modulo n and providing examples and properties. It includes theorems related to congruences, applications, and methods for finding remainders, as well as representations of integers in decimal and binary forms. Additionally, it discusses linear congruences and their solutions, emphasizing the conditions for existence and uniqueness of solutions.

Uploaded by

Hafidz Hakimi
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/ 56

SMA3043 ELEMENTARY NUMBER THEORY

SEMESTER 1 2022/2023

THE THEORY OF CONGRUENCE


PROF. MADYA DR ROHAIDAH MASRI
DR. NOR HAFIZAH MD HUSIN
CONGRUENCE MODULO n

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

a  b ( mod n )  a − b = kn for some of k  Z

Example.

(i) 22 = 6(3) + 4 or 22 – 4 = 6(3)

(ii)
4 = 6(1) + (-2) or 4 – (-2) = 6(1)

(iii) 5 = 2(2) + 1 or 5 – 1 = 2(2)

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.

Example: 3  2 mod 1  3 – 2 = 1(1)


11  3 mod 1  11 – 3 = 1(8)

• Two integers are congruent modulo 2 when they are both even or
both odd.

Example: 3  5 mod 2  3 – 5 = 2(-1)


8  6 mod 2  8 – 6 = 2(1)

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)

Example: Set of Integer modulo 6 , Z6 = {0, 1, 2, 3, 4, 5 }


6, 13, 26, 51, 64, 71 will form a
6 26 64 71 complete set of residue modulo 6

13 51

6
The Division Algorithm and Congruence Modulo n
Example.

7
Congruence Modulo n
Remainder

Next theorem gives us a useful characterization of congruence modulo n in terms of


remainders upon division by n.

Theorem 1

Let a and b be any integers. Then, a  b (mod n)


if and only if
a and b have the same nonnegative remainder upon division by n.

Example.

12  5 (mod 7) and 82  5 (mod 7)

Hence, 12  82 (mod 7)

8
Congruence Modulo n
Remainder

Exercise.
1. Show that 60  28 (mod 8). Justify your answer.

2. Show that 36  80 (mod 11). Justify your answer.

9
Congruence Modulo n
Properties of Congruence

• Congruence can be viewed as a generalized form of equality.

• Next theorem gives some of the elementary properties of equality that


carry over to congruence.

Theorem 2

Let n be a fixed integer greater than 1, and a, b, c, d  Z. Then the


following properties hold:

(a) a  a (mod n)

(b) If a  b (mod n) , then b  a (mod n)

(c) (Chaining congruence)


If a  b (mod n) , and b  c (mod n) , then a  c (mod n)
(Cont. )

10
Congruence Modulo n
Properties of Congruence
Theorem 2 (cont.)

(d) (Adding/ Multiplying Congruence)


If a  b (mod n) , and c  d (mod n) , then
a + c  b + d (mod n) , and ac  bd (mod n)
(e) If a  b (mod n) , then a + c  b + c (mod n) , and
ac  bc (mod n)

(f) (Taking congruences to the k-th power)


If a  b (mod n) , then ak  bk (mod n) , k  Z+.

11
Properties of Congruence
Proof.
(d)

Exercise: Try to proof (c) & (e)

12
Properties of Congruence

Note:

The converse of Theorem 2 (e) is not always true.


For example, (4) (2)  (1) (2) (mod 6), but 4  1(mod 6).

13
Some Applications of Congruence
Finding Remainders

Example.

Find the remainder when 237 is divided by 7.

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)

Note that from Theorem 2 (e):

If a  b (mod n) , then ac  bc (mod n)

Theorem 3
 n
If ac  bc ( modn ) then a  b  mod  where d = gcd (c , n )
 d

Example.

Let , (4) (2)  (1) (2) (mod 6).


Then,
4  1 mod ( 6/ 2 ) where d = 2 = gcd(2, 6)

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

Note that lcm(2, 4, 8) = 23 = 8


Then,
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

Definition 2 (Arithmetic Inverse)

gcd ( a, n ) = 1  aa*  1 mod ( n ) .


a* is called the arithmetic inverse (or just inverse) of a modulo n.

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

Note that : (100110)2 ≠ (100110)10

• 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.

Example. (11010)2 = 1.24 + 1.23 + 0.22 + 1. 21 + 0.20


= 16 + 8 + 2 = 26

• To convert from a decimal number to a binary number:

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

Convert 241 to binary.

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

integral coefficient c k . If a  b ( modn ) , then


P ( a )  P ( b )( modn ) .

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

A positive integer is divisible by 9 if and only if the sum of its digits is


divisible by 9.

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

A positive integer is divisible by 3 if and only if the sum of its digits is


divisible by 3.

34
Representation of Positive Integers
Integers Divisible by 11

Theorem 7

A positive integer is divisible by 11 if and only if the alternating sum of


its digit. is divisible by 11.

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

Definition (Linear Congruence)

Example.

x0 = 3 is the solution of equation 3x  9 (mod 12).


Where,
equation 3x  9 (mod 12) is called a linear congruence.

39
Linear Congruences

Notes:

Example.

x = 3 and x = -9 both satisfy 3x  9 (mod 12) .

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.

Let 18x  30 (mod 42) and let 6 = gcd(18,42).

18x  30 (mod 42) has solution since 6 | 30.


Then,
it has 6 mutually incongruent solutions modulo 42.

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.

By inspection, can be seen one of solution to be x = 4. Then

The genaral solution is:

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

Theorem 9 (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

You might also like