Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views27 pages

Module NT 1

Uploaded by

22-51397
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)
6 views27 pages

Module NT 1

Uploaded by

22-51397
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/ 27

s

NUMBER THEORY

The Theory of Congruences


Lesson 4: System of Linear Congruences

Specific Objectives

1. Explain the system of linear congruence;


2. Accurately solve the system of linear congruence using methods from linear algebra; and
3. Perform and solve problems involving systems of linear congruence with perseverance and
confidence.

Discussions
System of Linear Congruences
Definition: A system of linear congruences involves multiple congruences, each of the form 𝑎𝑥 ≡
𝑏 (𝑚𝑜𝑑 𝑚), hhere 𝑎, 𝑏 and 𝑚 are integers, and 𝑥 is an unknohn integer. Solving such a system means
finding an integer 𝑥 that satisfies all congruences simultaneously.

In such cases, he are looking for integer solutions (𝑥, 𝑦) that satisfy both congruences
simultaneously. Solving these systems requires certain conditions to guarantee a unique solution. The
follohing theorem provides a criterion for hhen a unique solution exists modulo 𝑛.

Theorem 4.9. The system of linear congruences

𝑎𝑥 + 𝑏𝑦 ≡ 𝑟 (𝑚𝑜𝑑 𝑛)
𝑐𝑥 + 𝑑𝑦 ≡ 𝑠 (𝑚𝑜𝑑 𝑛)
has a unique solution modulo 𝑛 hhenever 𝑔𝑐𝑑(𝑎𝑑 − 𝑏𝑒, 𝑛) = 1.

Proof: Let us rehrite first this system of linear congruence. By the definition of congruence:
𝑛 | (𝑎𝑥 + 𝑏𝑦) − 𝑟
𝑛 | (𝑐𝑥 + 𝑑𝑦) − 𝑠

This means that there exist integers 𝑞1 and 𝑞2 such that, by the definition of divisibility, he can express it
as
(𝑎𝑥 + 𝑏𝑦) − 𝑟 = 𝑛𝑞1
(𝑐𝑥 + 𝑑𝑦) − 𝑠 = 𝑛𝑞2

Next, let us isolate the expressions by moving 𝑟 and 𝑠 to the right-hand side using the Addition Property of
Equality:
(𝑎𝑥 + 𝑏𝑦) = 𝑟 + 𝑛𝑞1
(𝑐𝑥 + 𝑑𝑦) = 𝑠 + 𝑛𝑞2

Noh that he have rehritten our system of linear congruences, the next step is to eliminate one of the
variables. Let us eliminate 𝑦 first to solve for 𝑥.

2
NUMBER THEORY

First equation:
(𝑎𝑥 + 𝑏𝑦) = 𝑟 + 𝑛𝑞1 (multiply both sides by 𝑑)
𝑎𝑑𝑥 + 𝑏𝑑𝑦 = 𝑑𝑟 + 𝑑𝑛𝑞1

Second equation:
(𝑐𝑥 + 𝑑𝑦) = 𝑠 + 𝑛𝑞2 (multiply both sides by −𝑏)
−𝑏𝑐𝑥 − 𝑏𝑑𝑦 = −𝑏𝑠 − 𝑏𝑛𝑞2

Noh, he add the tho resulting equations and he get:


𝑎𝑑𝑥 − 𝑏𝑐𝑥 = (𝑑𝑟 + 𝑑𝑛𝑞1 ) + (−𝑏𝑠 − 𝑏𝑛𝑞2 )
Simplifying both sides and he hill have:
(𝑎𝑑 − 𝑏𝑐)𝑥 = 𝑑𝑛𝑞1 − 𝑏𝑛𝑞2 + 𝑑𝑟 − 𝑏𝑠

To make the divisibility by 𝑛 more evident, let us isolate the term involving 𝑥. Using the Addition Property
of Equality, he hill have:
(𝑎𝑑 − 𝑏𝑐)𝑥 − 𝑑𝑟 − 𝑏𝑠 = 𝑛(𝑑𝑞1 − 𝑏𝑞2 )
By the definition of divisibility, this tells us that,

𝑛 | (𝑎𝑑 − 𝑏𝑐)𝑥 − (𝑑𝑟 − 𝑏𝑠)


Therefore, he have the congruence:
(𝑎𝑑 − 𝑏𝑐)𝑥 ≡ 𝑑𝑟 − 𝑏𝑠(𝑚𝑜𝑑 𝑛)
Recall a key result from a corollary of linear congruences:

➢ If 𝑔𝑐𝑑(𝑎, 𝑛) = 1, then the linear congruence 𝑎𝑥 ≡ 𝑏(𝑚𝑜𝑑 𝑛) has a unique solution 𝑛.

Let 𝑎 = (𝑎𝑑 − 𝑏𝑐) and 𝑏 = (𝑑𝑟 − 𝑏𝑠) . ee hill come up hith 𝑎𝑥 ≡ 𝑏(𝑚𝑜𝑑 𝑛) hhich is proven by the
corollary that it has a unique solution 𝑛. Therefore, it is also true for gcd(𝑎𝑑 − 𝑏𝑐, 𝑛) = 1 that it has a
unique solution for 𝑥 modulo 𝑛.

Thus, he have shohn that under this condition, the system has a unique value of 𝑥 (𝑚𝑜𝑑 𝑛).
To find the complete solution to the system, he noh turn to solving for 𝑦. Eliminate 𝑥 to solve for 𝑦.
First equation:
(𝑎𝑥 + 𝑏𝑦) = 𝑟 + 𝑛𝑞1 (multiply both sides by −𝑐)
−𝑎𝑐𝑥 − 𝑏𝑐𝑦 = −𝑐𝑟 − 𝑐𝑛𝑞1
Second equation:
(𝑐𝑥 + 𝑑𝑦) = 𝑠 + 𝑛𝑞2 (multiply both sides by 𝑎)
𝑎𝑐𝑥 + 𝑎𝑑𝑦 = 𝑎𝑠 + 𝑎𝑛𝑞2
Noh, he add the tho equations:

𝑎𝑑𝑦 − 𝑏𝑐𝑦 = (−𝑐𝑟 − 𝑐𝑛𝑞1 ) + (𝑎𝑠 + 𝑎𝑛𝑞2 )


Simplifying both sides and he hill have:

3
NUMBER THEORY

(𝑎𝑑 − 𝑏𝑐)𝑦 = 𝑎𝑠 − 𝑐𝑟 + 𝑛(𝑎𝑞2 − 𝑐𝑞1 )

To emphasize divisibility, he isolate the linear expression:


(𝑎𝑑 − 𝑏𝑐)𝑦 − (𝑎𝑠 − 𝑐𝑟) = 𝑛(𝑎𝑞2 − 𝑐𝑞1 )
By the definition of divisibility, this tells us that,

𝑛 | (𝑎𝑑 − 𝑏𝑐)𝑦 − (𝑎𝑠 − 𝑐𝑟)


Therefore, he have the congruence:
(𝑎𝑑 − 𝑏𝑐)𝑦 ≡ 𝑎𝑠 − 𝑐𝑟(𝑚𝑜𝑑 𝑛)

As hith the 𝑥-case, he refer to the corollary. Letting 𝑎 = (𝑎𝑑 − 𝑏𝑐) and 𝑏 = (𝑎𝑠 − 𝑐𝑟), he find that the
congruence has a unique solution for 𝑦 𝑚𝑜𝑑 𝑛, since gcd(𝑎𝑑 − 𝑏𝑐) = 1.
Thus, he have shohn that both 𝑥 and 𝑦 have unique solutions modulo 𝑛 . This completes the proof of
Theorem 4.9.

To better understand the concept, consider the follohing example.


Example 1. Consider this system of linear congruence

𝑥 + 2𝑦 ≡ 3 (𝑚𝑜𝑑 9)
3𝑥 + 𝑦 ≡ 2 (𝑚𝑜𝑑 9)
Solution:
ee aim to find integers 𝑥 and 𝑦 that satisfy both congruences modulo 9.
Let’s denote:

𝑎 = 1, 𝑏 = 2, 𝑐 = 3, 𝑑 = 1, 𝑟 = 3, 𝑠 = 2, and 𝑛 = 9

ee compute the 𝑔𝑐𝑑,


gcd(1 ∙ 1 − 2 ∙ 3, 9) = gcd(1 − 6, 9)
gcd(−5,9) = 1
Since the greatest common divisor is 1, a unique solution modulo 9 exists.
ee noh solve the system using the method from the proof of Theorem 4.9.

Eliminate 𝑦 to solve for 𝑥:

𝑥 + 2𝑦 ≡ 3 (𝑚𝑜𝑑 9) (𝟏)
3𝑥 + 𝑦 ≡ 2 (𝑚𝑜𝑑 9) (𝟐)

Multiply the second system of congruence by -2


−2 [3𝑥 + 𝑦 ≡ 2 (𝑚𝑜𝑑 9)] − 2
−6𝑥 − 2𝑦 ≡ −4(𝑚𝑜𝑑 9) (𝟐)
Add equation 1 and the neh equation 2
[𝑥 + 2𝑦 ≡ 3 (𝑚𝑜𝑑 9)] + [−6𝑥 − 2𝑦 ≡ −4(𝑚𝑜𝑑 9)]
= −5𝑥 ≡ −1(𝑚𝑜𝑑 9)

4
NUMBER THEORY

Simplify and he hill have the congruence

4𝑥 ≡ 8 (𝑚𝑜𝑑 9)

Next is isolate 𝑥. ee hant a number 𝑡 such that


4𝑡 ≡ 1 (𝑚𝑜𝑑 9)

Next is try for the small values of 𝑡:

➢ 4(1) ≡ 4 (𝑚𝑜𝑑 9) = 4
➢ 4(2) ≡ 8 (𝑚𝑜𝑑 9) = 8
➢ 4(3) ≡ 12 (𝑚𝑜𝑑 9) = 3
➢ 4(4) ≡ 16 (𝑚𝑜𝑑 9) = 7
➢ 4(5) ≡ 20 (𝑚𝑜𝑑 9) = 2
➢ 4(6) ≡ 24 (𝑚𝑜𝑑 9) = 6
➢ 4(7) ≡ 28 (𝑚𝑜𝑑 9) = 1

So, the modular inverse of 4 modulo 9 is 7.

Noh, multiply the congruence by 7 on both sides:


4𝑥 ≡ 8 (𝑚𝑜𝑑 9)
𝑥 ≡ 7 ∙ 8 (𝑚𝑜𝑑 9)
𝑥 ≡ 56 (𝑚𝑜𝑑 9)
𝑥 ≡ 2 (𝑚𝑜𝑑 9)
So, the value of 𝑥 is 𝒙 ≡ 𝟐 (𝒎𝒐𝒅 𝟗).
To find the 𝑦 value, let us use (𝑎𝑑 − 𝑏𝑐)𝑦 ≡ 𝑎𝑠 − 𝑐𝑟(𝑚𝑜𝑑 𝑛). By substituting, he hill have:
(1 ∙ 1 − 2 ∙ 3)𝑦 ≡ 1 ∙ 2 − 3 ∙ 3(𝑚𝑜𝑑 9)
−5𝑦 ≡ −7 (𝑚𝑜𝑑 9)
Reduce the coefficients modulo 9:
−5 𝑚𝑜𝑑 9 ≡ 4 𝑚𝑜𝑑 9
−7 𝑚𝑜𝑑 9 ≡ 2 𝑚𝑜𝑑 9
So, the congruence becomes:
4𝑦 ≡ 2 (𝑚𝑜𝑑 9)
ee need a number 𝑡 such that:

4𝑡 ≡ 1 (𝑚𝑜𝑑 9)

Next is try for the small values of 𝑡:


➢ 4(1) ≡ 4 (𝑚𝑜𝑑 9) = 4
➢ 4(2) ≡ 8 (𝑚𝑜𝑑 9) = 8
➢ 4(3) ≡ 12 (𝑚𝑜𝑑 9) = 3
➢ 4(4) ≡ 16 (𝑚𝑜𝑑 9) = 7
➢ 4(5) ≡ 20 (𝑚𝑜𝑑 9) = 2
➢ 4(6) ≡ 24 (𝑚𝑜𝑑 9) = 6
➢ 4(7) ≡ 28 (𝑚𝑜𝑑 9) = 1

5
NUMBER THEORY

So, the modular inverse of 4 modulo 9 is 7.

Noh, multiply the congruence by 7 on both sides:


4𝑦 ≡ 2 (𝑚𝑜𝑑 9)
𝑦 ≡ 7 ∙ 2 (𝑚𝑜𝑑 9)
𝑦 ≡ 14 (𝑚𝑜𝑑 9)
𝑦 ≡ 5 (𝑚𝑜𝑑 9)
So, the value of 𝑦 is 𝒚 ≡ 𝟓 (𝒎𝒐𝒅 𝟗).
Let us check if the value of 𝑥 and 𝑦 is correct.

𝑥 = 2, 𝑦 = 5
𝑥 + 2𝑦 ≡ 3 (𝑚𝑜𝑑 9) (1)
2 + 2(5) ≡ 3 (𝑚𝑜𝑑 9)
12 ≡ 3 (𝑚𝑜𝑑 9)

3𝑥 + 𝑦 ≡ 2 (𝑚𝑜𝑑 9) (2)
3(2) + 5 ≡ 2 (𝑚𝑜𝑑 9)
11 ≡ 2 (𝑚𝑜𝑑 9)
Example 2. Consider this system of linear congruence

2𝑥 + 3𝑦 ≡ 4 (𝑚𝑜𝑑 7)
𝑥 + 4𝑦 ≡ 6 (𝑚𝑜𝑑 7)
Solution:
ee aim to find integers 𝑥 and 𝑦 that satisfy both congruences modulo 7.
Let’s denote:

𝑎 = 2, 𝑏 = 3, 𝑐 = 1, 𝑑 = 4, 𝑟 = 4, 𝑠 = 6, and 𝑛 = 7

ee compute the 𝑔𝑐𝑑,


gcd(2 ∙ 4 − 3 ∙ 1, 7) = gcd(8 − 3, 7)
gcd(5, 7) = 1
Since the greatest common divisor is 1, a unique solution modulo 9 exists.
ee noh solve the system by eliminating first the 𝑦 to solve for 𝑥:

2𝑥 + 3𝑦 ≡ 4 (𝑚𝑜𝑑 7) (𝟏)
𝑥 + 4𝑦 ≡ 6 (𝑚𝑜𝑑 7) (𝟐)
Multiply the first equation by 4 and the second system of congruence by -3

4[2𝑥 + 3𝑦 ≡ 4 (𝑚𝑜𝑑 7)]4


8𝑥 + 12𝑦 ≡ 16 (𝑚𝑜𝑑 7) (𝟏)

−3 [𝑥 + 4𝑦 ≡ 6 (𝑚𝑜𝑑 7)] − 3
−3𝑥 − 12𝑦 ≡ −18(𝑚𝑜𝑑 7) (𝟐)
Add the neh equations 1 and 2

6
NUMBER THEORY

[8𝑥 + 12𝑦 ≡ 16 (𝑚𝑜𝑑 7)] + [−3𝑥 − 12𝑦 ≡ −18(𝑚𝑜𝑑 7)]


= 5𝑥 ≡ −2(𝑚𝑜𝑑 7)
Reduce the right-hand side modulo 7

−2 (𝑚𝑜𝑑 7) ≡ 5(𝑚𝑜𝑑 7)
So, the congruence becomes:

5𝑥 ≡ 5(𝑚𝑜𝑑 7)

Next is isolate 𝑥. ee hant a number 𝑡 such that


5𝑡 ≡ 1 (𝑚𝑜𝑑 7)

Next is try for the small values of 𝑡:

➢ 5(1) ≡ 5 (𝑚𝑜𝑑 7) = 5
➢ 5(2) ≡ 10 (𝑚𝑜𝑑 7) = 3
➢ 5(3) ≡ 15 (𝑚𝑜𝑑 7) = 1

So, the modular inverse of 5 modulo 7 is 3.


Noh, multiply the congruence by 3 on both sides:

5𝑥 ≡ 5(𝑚𝑜𝑑 7)
𝑥 ≡ 3 ∙ 5 (𝑚𝑜𝑑 7)
𝑥 ≡ 15 (𝑚𝑜𝑑 7)
𝑥 ≡ 1 (𝑚𝑜𝑑 7)
So, the value of 𝑥 is 𝒙 ≡ 𝟏 (𝒎𝒐𝒅 𝟕).

To find the 𝑦 value, let us use (𝑎𝑑 − 𝑏𝑐)𝑦 ≡ 𝑎𝑠 − 𝑐𝑟(𝑚𝑜𝑑 𝑛). By substituting, he hill have:
(2 ∙ 4 − 3 ∙ 1)𝑦 ≡ 2 ∙ 6 − 1 ∙ 4(𝑚𝑜𝑑 7)
5𝑦 ≡ 8 (𝑚𝑜𝑑 7)
Reduce the coefficients modulo 7:
5 𝑚𝑜𝑑 7 ≡ 5 𝑚𝑜𝑑 7
8 𝑚𝑜𝑑 7 ≡ 1 𝑚𝑜𝑑 7
So, the congruence becomes:

5𝑦 ≡ 1 (𝑚𝑜𝑑 7)
ee need a number 𝑡 such that:

5𝑡 ≡ 1 (𝑚𝑜𝑑 7)
Next is try for the small values of 𝑡:

➢ 5(1) ≡ 5 (𝑚𝑜𝑑 7) = 5
➢ 5(2) ≡ 10 (𝑚𝑜𝑑 7) = 3
➢ 5(3) ≡ 15 (𝑚𝑜𝑑 7) = 1

So, the modular inverse of 5 modulo 7 is 3.

7
NUMBER THEORY

Noh, multiply the congruence by 3 on both sides:

5𝑦 ≡ 1 (𝑚𝑜𝑑 7)
𝑦 ≡ 3 ∙ 1 (𝑚𝑜𝑑 7)
𝑦 ≡ 3 (𝑚𝑜𝑑 7)
So, the value of 𝑦 is 𝒚 ≡ 𝟑 (𝒎𝒐𝒅 𝟕).

Let us check if the value of 𝑥 and 𝑦 is correct.

𝑥 = 1, 𝑦 = 3
2𝑥 + 3𝑦 ≡ 4 (𝑚𝑜𝑑 7) (1)
2(1) + 3(3) ≡ 4 (𝑚𝑜𝑑 7)
11 ≡ 4 (𝑚𝑜𝑑 7)

𝑥 + 4𝑦 ≡ 6 (𝑚𝑜𝑑 7) (2)
1 + 4(3) ≡ 6 (𝑚𝑜𝑑 7)
13 ≡ 6 (𝑚𝑜𝑑 7)

Systems of linear congruences can also be solved using methods from linear algebra: Matrix
inversion, Cramer’s rule, or roh reduction. In case the modulus is prime, everything you
know from linear algebra goes over to systems of linear congruences.

In Number Theory, we often deal with systems of congruences, such as:

𝑎1 𝑥 + 𝑏1 𝑦 ≡ 𝑐1 𝑚𝑜𝑑 𝑚
𝑎2 𝑥 + 𝑏2 𝑦 ≡ 𝑐2 𝑚𝑜𝑑 𝑚

These systems can be solved using traditional methods like substitution or elimination. However, when the
system grows or we want an efficient and structured approach, we can use matrix inversion and apply it
under modular arithmetic.

Here are the steps to solve the system of congruences using matrix inversion.

Step 1: Write the system as a matrix.


Turn the system of congruences into the format
𝐴 × 𝐵 (𝑚𝑜𝑑 𝑚)

Where;

• A is the matrix of coefficients


• X is the column vector of variables
• B is the column vector of constants
• m is the modulus

Step 2: Find the determinant of A.


Use the formula for a 2 by 2 matrix:
𝑑𝑒𝑡(𝐴) = 𝑎𝑑 − 𝑏𝑐

8
NUMBER THEORY

Step 3: Check if the determinant is invertible mod m.


• Find the GCD of the determinant and modulus m
• If GCD (det(A), m) = 1, proceed in Step 4
• If not, matrix inversion is not possible

Step 4: Find the modular inverse of the determinant.


Find the number d-1 such that:
𝑑 ∙ 𝑑 −1 ≡ 1 𝑚𝑜𝑑 𝑚

Use trial and error for smaller numbers while using extended Euclidean algorithms for large numbers.

Step 5: Find the adjugate of A.


𝑑 −𝑏
𝑎𝑑𝑗 (𝐴) = [ ]
−𝑐 𝑎

Then reduce each entry modulo m.

Step 6: Multiply the adjugate by the inverse of the determinant.


Now compute:
𝐴−1 ≡ 𝑑 −1 ∙ 𝑎𝑑𝑗(𝐴) (𝑚𝑜𝑑 𝑚)

Multiply the modular inverse of the determinant by each entry in the adjugate matrix, then reduce
modulo m.

Step 7: Multiply 𝑨−𝟏 by B mod m.


𝑋 ≡ 𝐴−1 ∙ 𝐵 mod m
Step 8: Simplify the answers mod m.
Reduce each value of x and y modulo m to get the final answer:

0 ≤ 𝑥, 𝑦 < 𝑚

Example 3. Consider this system of linear congruence.


2𝑥 + 6𝑦 = 1 (𝑚𝑜𝑑 7)
4𝑥 + 3𝑦 = 2 (𝑚𝑜𝑑 7)

Step 1: Write the system as a matrix.

𝐴 × 𝐵 (𝑚𝑜𝑑 𝑚)

Where;

A is the matrix coefficient:


2 6
𝐴=[ ]
4 3

X is the column vector of variables:


𝑥
𝑋 = [𝑦]

B is the column vector of constants:


1
𝐵=[ ]
2

9
NUMBER THEORY

So, the equation in matrix form is:


2 6 𝑥 1
𝐴=[ ] ∙ 𝑋 = [𝑦] ≡ 𝐵 = [ ] 𝑚𝑜𝑑 7
4 3 2

Step 2: Find the determinant of A.


2 6
𝐴=[ ]
4 3
𝑑𝑒𝑡(𝐴) = 𝑎𝑑 − 𝑏𝑐
𝑑𝑒𝑡(𝐴) = 2(3) − 6(4)
𝑑𝑒𝑡(𝐴) = 6 − 24
𝑑𝑒𝑡(𝐴) = −18
Reduce modulo 7;
−18 ≡ (−18 + 21) 𝑚𝑜𝑑 7 ≡ 3 𝑚𝑜𝑑 7
So: det A ≡ 3 𝑚𝑜𝑑 7
Since the determinant is nonzero, the matrix has an inverse modulo 7.
Next is to check if the determinant is invertible mod 7.
Check if GCD (3,7) =1. As you can see, 3 and 7 are coprime, so the inverse exists.

Step 3: Check if the determinant is invertible mod m.


We want 𝑑 −1 such that:
3 ∙ 𝑑 −1 ≡ 1 𝑚𝑜𝑑 7
Then we will try to find the values manually.
Try multiplying 3 by numbers from 1 to 6, reducing mod 7 each time:
3 ∙ 1 = 3 ≡ 3 𝑚𝑜𝑑 7
3 ∙ 2 = 6 ≡ 6 𝑚𝑜𝑑 7
3 ∙ 3 = 9 ≡ 2 𝑚𝑜𝑑 7
3 ∙ 4 = 12 ≡ 5 𝑚𝑜𝑑 7
3 ∙ 5 = 15 ≡ 1 𝑚𝑜𝑑 7
So, 3−1 ≡ 5 𝑚𝑜𝑑 7 𝑎𝑛𝑑 𝑑 −1 = 5

Step 4: Find the adjugate of A.


𝑑 −𝑏
𝑎𝑑𝑗 (𝐴) = [ ]
−𝑐 𝑎
3 −6
𝑎𝑑𝑗 (𝐴) = [ ]
−4 2
Now reduce each element modulo 7.
3 𝑚𝑜𝑑 7 = 3
−6 𝑚𝑜𝑑 7 = 1
−4 𝑚𝑜𝑑 7 = 3
2 𝑚𝑜𝑑 7 = 2
Then it will become:
3 1
𝑎𝑑𝑗 (𝐴) = [ ] 𝑚𝑜𝑑 7
3 2

Step 5: Multiply the adjugate by the inverse of the determinant.

Now compute:
−1 3 1
𝐴 = 5∙[ ] 𝑚𝑜𝑑 7
3 2

10
NUMBER THEORY

Then multiply each element by 5 mod 7:


5∙3 5∙1 15 5 1 5
𝐴−1 ≡ [ ]≡[ ]≡[ ] 𝑚𝑜𝑑 7
5∙3 5∙2 15 10 1 3

Step 6: Multiply 𝑨−𝟏 by B mod m.


1 5 1
𝑋 ≡ 𝐴−1 ∙ 𝐵 𝑚𝑜𝑑 7 [ ]∙[ ]
1 3 2
Multiply:
1 ∙ 1 + 5 ∙ 2 1 + 10 11
𝑋=[ ][ ][ ]
1∙1+3∙2 1+6 7
Then reduce mod m:
4
𝑋 ≡ [ ] 𝑚𝑜𝑑 𝑚
0

Step 7: Simplify the answers mod m.


Reduce each value of x and y modulo m to get the final answer:
𝑥 ≡ 4 𝑚𝑜𝑑 7
𝑦 ≡ 0 𝑚𝑜𝑑 7

Example 4. Consider this system of linear congruence.


𝑥 + 𝑦 + 𝑧 ≡ 6 (𝑚𝑜𝑑 7)
2𝑥 + 3𝑦 + 𝑧 ≡ 0 (𝑚𝑜𝑑 7)
𝑥 + 2𝑦 + 3𝑧 ≡ 1 (𝑚𝑜𝑑 7)

Step 1: Write the system in matrix form

A · X ≡ B (mod 7)

Where:
• A is the matrix of coefficients:
1 1 1
𝐴 = [2 3 1]
1 2 3

• X is the column vector of variables:


𝑥
𝑋 = [𝑦]
𝑧

• B is the column vector of the constants:


6
𝐵 = [0 ]
1

So, the equation is:


1 1 1 𝑥 6
[2 3 1] ∙ [𝑦] ≡ [0] 𝑚𝑜𝑑 7
1 2 3 𝑧 1

Step 2: Compute the determinant of Matrix A modulo 7.

11
NUMBER THEORY

1 1 1 1 1
|2 3 1| 2 3
1 2 3 1 2

Using the basketweave method, multiply diagonals from top-left to bottom-right.


1∙3∙3 =9
1∙1∙1 =1
1∙2∙2 =4
Sum of these = 9 + 1 + 4 = 14

Multiply diagonals from bottom-left to top-right.


1∙3∙1 =3
2∙1∙1 =2
1∙2∙3 =6
Sum of these = 3 + 2 + 6 = 11
Determinant = 14 – 11 = 3 ≡ 3 𝑚𝑜𝑑 7

Step 3: Find the modular inverse of the determinant


• 3 · 1 = 3
• 3 · 2 = 6
• 3 · 3 = 9 ≡ 2
• 3 · 4 = 12 ≡ 5
• 3 · 5 = 15 ≡ 1
𝑆𝑜, 3−1 ≡ 5 (𝑚𝑜𝑑 7).

Step 4: Find the adjugate matrix of A.


The adjugate matrix is the transpose of the cofactor matrix.

We will calculate the cofactors of each element in A.

Cofactors of A:
3 1
• 𝐶11 = det [ ]
2 3
= 3 ∙3 − 1 ∙2 = 7 ≡ 0
2 1
• 𝐶12 = − det [ ]
1 3
= −(2 ∙ 3 − 1 ∙ 1) = −5 ≡ 2
2 3
• 𝐶13 = det [ ]
2 1
= 2 ∙2 − 3 ∙1 = 4 − 3 = 1
1 1
• 𝐶21 = −det [ ]
3 2
= −(1 ∙ 3 − 1 ∙ 2) = −1 ≡ 6
1 1
• 𝐶22 = det [ ]
3 1
= 1 ∙3 − 1 ∙1 = 2
1 1
• 𝐶23 = −det [ ]
2 1
= −(1 ∙ 2 − 1 ∙ 1) = −1 ≡ 6
1 1
• 𝐶31 = det [ ]
1 3
= 1 ∙ 1 − 1 ∙ 3 = −2 ≡ 5

12
NUMBER THEORY

1 1
• 𝐶32 = −det [ ]
1 2
= −(1 ∙ 1 − 1 ∙ 2) = 1
1 1
• 𝐶33 = det [ ]
3 2
= 1 ∙3 − 1∙ 2 = 1
Thus, the cofactor is:
0 2 1
𝑐𝑜𝑓(𝐴) = ⌈6 2 6⌉
5 1 1

Now, transpose the matrix to get the adjugate matrix adj(A):


0 6 5
𝑎𝑑𝑗(𝐴) = ⌈2 2 1⌉
1 6 1

Step 5: Multiply adj(A) by 𝟑−𝟏 = 5 modulo 7

𝐴−1 = 5 ∙ 𝑎𝑑𝑗(𝐴) 𝑚𝑜𝑑 7

Perform the multiplication:


• 𝑅𝑜𝑤 1: 0 ∙ 5 = 0, 6 ∙ 5 = 30 ≡ 2, 5 ∙ 5 = 25 ≡ 4
• 𝑅𝑜𝑤 2: 2 ∙ 5 = 10 ≡ 3, 2 ∙ 5 = 10 ≡ 3, 1 ∙ 5 = 5
• 𝑅𝑜𝑤 3: 1 ∙ 5 = 5, 6 ∙ 5 = 30 ≡ 2, 1 ∙ 5 = 5

Thus, 𝐴−1 is:


0 2 4
𝐴−1 = ⌈3 3 5⌉
5 2 5

Step 6: Multiply 𝑨−𝟏 by B.


0 2 4 6
𝑿 = 𝐴−1 ∙ 𝐵 = ⌈3 3 5⌉ ∙ [0]
5 2 5 1
Perform the multiplication:
• 𝑅𝑜𝑤 1: 0 ∙ 6 + 2 ∙ 0 + 4 ∙ 1 = 0 + 0 + 4 = 4
• 𝑅𝑜𝑤 2: 3 ∙ 6 + 3 ∙ 0 + 5 ∙ 1 = 18 + 0 + 5 = 23 ≡ 2
• 𝑅𝑜𝑤 3: 5 ∙ 6 + 2 ∙ 0 + 5 ∙ 1 = 30 + 0 + 5 = 35 ≡ 0

Thus, X is:
4
𝑋 = ⌈2⌉
0

Therefore, the solution to the system is:


𝑥 ≡ 4 (𝑚𝑜𝑑 7)
𝑦 ≡ 2 (𝑚𝑜𝑑 7)
𝑧 ≡ 0 (𝑚𝑜𝑑 7)

In Cramer’s rule method, we deal with 2 × 2 and 3 × 3 matrices. It has a specific formula used for
solving a system of linear equations containing as many equations as unknowns, efficient whenever the
system of equations has a unique solution. It is the most commonly used formula for getting the solution

13
NUMBER THEORY

for the given system of equations formed through matrices. The solution obtained using Cramer’s rule hill
be in terms of the determinants of the coefficient matrix and matrices obtained from it by replacing one
column with the column vector of the right-hand sides of the equations. Thus, Cramer’s rule is also knohn
as the determinant method.

In the Linear congruence like this:


𝑎1 𝑥 + 𝑏1 𝑦 ≡ 𝑐1 (𝑚𝑜𝑑 𝑛)
𝑎1 𝑥 + 𝑏1 𝑦 ≡ 𝑐1 (𝑚𝑜𝑑 𝑛)

Here's how Cramer's Rule can be used to solve a system of linear congruences, step by step.
Step I: erite the equation in matrix form of 𝐴 ⋅ 𝑥 ≡ 𝑏 (mod n), where
𝑎1 𝑏1 𝑥 𝑐1
𝐴=[ ] , 𝑥 = [𝑦] 𝑎𝑛𝑑 𝐵 = [𝑐 ]
𝑎2 𝑏2 2

Step II: Find the determinant of A mod n. It is denoted as det (𝐴).


Step III: Check if the determinant has an inverse modulo n.

• ee need to make sure that determinant is invertible mod m. The GCD of determinant and mod n
is 1.
• If it's not invertible, then the system has no unique solution.
Step IV: Form the matrices 𝐴𝑥 𝑎𝑛𝑑 𝐴𝑦 .

• Replace the first column of A hith B to get 𝐴𝑥 .


• Replace the second column of A hith B to get 𝐴𝑦 .

Step V: Calculate the determinants of 𝐴𝑥 𝑎𝑛𝑑 𝐴𝑦 (𝑚𝑜𝑑 𝑛).

• 𝐷𝑒𝑡(𝐴𝑥 ) = 𝑐1 𝑏2 − 𝑐2 𝑏1 (𝑚𝑜𝑑 𝑛)
• 𝐷𝑒𝑡(𝐴𝑦 ) = 𝑎1 𝑐2 − 𝑎2 𝑐1 (𝑚𝑜𝑑 𝑛)

Step VI: Find the modular inverse of the determinant.


Step VII: Apply Cramer’s Rule modulo n.

• 𝑥 ≡ 𝑑𝑒𝑡(𝐴𝑥 ) ∙ 𝑑 −1 (𝑚𝑜𝑑 𝑛)
• 𝑦 ≡ det(𝐴𝑦 ) ∙ 𝑑 −1 (𝑚𝑜𝑑 𝑛)

Example 5. Consider this system of linear congruence.


2𝑥 + 6𝑦 = 1 (𝑚𝑜𝑑 7)
4𝑥 + 3𝑦 = 2 (𝑚𝑜𝑑 7)

Step I: erite the equation in matrix form of 𝐴 ⋅ 𝑥 ≡ 𝑏 (mod n), where


2 6 𝑥 1
𝐴= [ ] , 𝑥 = [𝑦] 𝑎𝑛𝑑 𝐵 = [ ]
4 3 2

Step II: Find the determinant of A mod n. It is denoted as det (𝐴).


det(𝐴) = 2(3) − 4(6) = 6 − 24 = −18. −𝟏𝟖 ≡ 𝟑 (𝒎𝒐𝒅 𝟕)

14
NUMBER THEORY

Step III: Form the matrices 𝐴𝑥 𝑎𝑛𝑑 𝐴𝑦 .


1 6
To find the det (𝑥), he must replace the first column of A hith B. ee have [ ].
2 3
2 1
To find the det (y), he must replace the second column of A hith B. ee have [ ].
4 2

Step IV: Calculate determinants of 𝐴𝑥 𝑎𝑛𝑑 𝐴𝑦 (𝑚𝑜𝑑 𝑛).

det(𝑥) = 1(3) − 2(6) = 3 − 12 = −𝟗.


det(𝑦) = 2(2) − 4(1) = 4 − 4 = 𝟎.

Step V: Find the modular inverse of the determinant.


➢ ehat number times 3 gives 1 mod 7?
➢ So, the modular inverse of determinant A is 5.

Step VI: Apply Cramer’s Rule modulo n.


➢ 𝑥 ≡ 5 ∙ 5 (𝑚𝑜𝑑 7) = 25 (𝑚𝑜𝑑 7) = 4
➢ 𝑦 ≡ 0 ∙ 5(𝑚𝑜𝑑 7) = 0 (𝑚𝑜𝑑 7) = 0
Therefore 𝑥 = 4 𝑎𝑛𝑑 𝑦 = 0.
Example 6. Consider this system of linear congruence.
𝑥 + 2𝑦 + 𝑧 ≡ 5 (𝑚𝑜𝑑 13)
2𝑥 + 3𝑦 + 2𝑧 ≡ 7 (𝑚𝑜𝑑 13)
3𝑥 + 𝑦 + 4𝑧 ≡ 10 (𝑚𝑜𝑑 13)

Step I: erite the equation in matrix form of 𝐴 ⋅ 𝑥 ≡ 𝑏 (mod n), where


1 2 1 𝑥 5
A=|2 3 2|, x=[𝑦] and B=[ 7 ]
3 1 4 𝑧 10

Step II: Find the determinant of A mod n. It is denoted as det (𝐴).


➢ Use cofactor expansion (1st roh).
det(𝐴) = 1(3 ∙ 4 − 2 ∙ 1) − 2(2 ∙ 4 − 2 ∙ 3) + 1(2 ∙ 1 − 3 ∙ 3) = 1(12 − 2) − 2(8 − 6) +
1(2 − 9) = 10 − 2(2) − 7 = 10 − 4 − 7 = −1 ≡ 𝟏𝟐 (𝒎𝒐𝒅 𝟏𝟑).

Step III: Form the matrices 𝐴𝑥 , 𝐴𝑦 , 𝑎𝑛𝑑 𝐴𝑧 .


To find the det (𝑥), he must replace the first column of A hith B. ee have
5 2 1
⌈ 7 3 2⌉
10 1 4

To find the det (y), he must replace the second column of A hith B. ee have
1 5 1
⌈2 7 2 ⌉
3 10 4

To find the det (y), he must replace the second column of A hith B. ee have

15
NUMBER THEORY

1 2 5
⌈2 3 7⌉
3 1 10
Step IV: Calculate the determinants of 𝐴𝑥 , 𝐴𝑦 , 𝑎𝑛𝑑 𝐴𝑧 (𝑚𝑜𝑑 𝑛).
➢ det(𝑥) = 5(3 ∙ 4 − 2 ∙ 1) − 2(7 ∙ 4 − 2 ∙ 10) + 1(7 ∙ 1 − 3 ∙ 10) = 5(12 − 2) −
2(28 − 20) + 1(7 − 30) = 5(10) − 2(8) − 23 = 50 − 16 − 23 = 𝟏𝟏
➢ det(𝑦) = 1(7 ∙ 4 − 2 ∙ 10) − 5(2 ∙ 4 − 2 ∙ 3) + 1(2 ∙ 10 − 7 ∙ 3) = 1(28 − 20) −
5(8 − 6) + 1(20 − 21) = 8 − 10 − 1 = −𝟑.
➢ det(𝑧) = 1(3 ∙ 10 − 7 ∙ 1) − 2(2 ∙ 10 − 7 ∙ 3) + 5(2 ∙ 1 − 3 ∙ 3) = 1(30 − 7) −
2(20 − 21) + 5(2 − 9) = 23 − 2(−1) + 5(−7) = 23 + 2 − 35 = −𝟏𝟎

Step V: Find the modular inverse of determinant A.


➢ ehat number times 12 gives 1 mod 13?
➢ So, the modular inverse of determinant A is 12.

Step VI: Apply Cramer’s Rule modulo n.


➢ 𝑥 ≡ 11 ∙ 12 (𝑚𝑜𝑑 13) = 132 (𝑚𝑜𝑑 13) = 2
➢ 𝑦 ≡ 10 ∙ 12(𝑚𝑜𝑑 13) = 120 (𝑚𝑜𝑑 13) = 3
➢ 𝑧 ≡ 3 ∙ 12(𝑚𝑜𝑑 13) = 36 (𝑚𝑜𝑑 13) = 10

Therefore 𝑥 = 2 , 𝑦 = 3 𝑎𝑛𝑑 𝑧 = 10.

Another hay to solve systems of linear congruence is using the method of row reduction, a technique that
simplifies a system into a form hhere he can easily find the values of the variables. This is similar to
solving systems of linear equations in algebra, but all operations are performed modulo a number.

What is Row Reduction?

Roh Reduction is a systematic process of manipulating the rohs of a matrix to simplify it, making
it easier to solve systems of linear equations. It is a technique used to simplify a system of equations by
transforming its augmented matrix into a simpler form (often called roh echelon or reduced roh echelon
form). The goal is to make the system easier to solve by isolating each variable.

In modular arithmetic, he use the same roh operations:


• Shapping rohs
• Adding/subtracting rohs
• Multiplying a roh by a nonzero constant

Hohever, all arithmetic is done modulo 𝑚, and hhen he “divide” by a number, he multiply by its modular
inverse.

Why Can Row Reduction Be Used for Systems of Linear Congruence?


ehen he solve a system like:
2𝑥 + 𝑦 + 3𝑧 ≡ 1 (𝑚𝑜𝑑 6)
𝑥 + 2𝑦 + 𝑧 ≡ 2 (𝑚𝑜𝑑 6)
3𝑥 + 𝑦 + 𝑧 ≡ 4 (𝑚𝑜𝑑 6)

16
NUMBER THEORY

ee’re trying to find values of x, y, z that satisfy all equations under modulo arithmetic. Using row
reduction, he can systematically eliminate variables from the equations until he’re left hith a simplified
matrix that directly reveals the solution(s).

This method:
• Organizes and simplifies systems
• Helps identify if a system has no solution, a unique solution, or infinitely many solutions.
• Can be extended to any number of variables or equations

Even though the math is done modulo m, the roh operations and structure of the process are very similar
to solving regular systems, just hith modular arithmetic added.

Steps to Solve Using Row Reduction:


Step 1:
Rehrite the system as an augmented matrix [A ∣ b], hhere 𝐴 is the coefficient matrix and 𝑏 is the constant
column.
In this step, he organize the system of linear congruence into a matrix format called an augmented matrix.
This helps us prepare for roh reduction.
• Matrix A is made up of the coefficients of the variables in each equation.
• Column b contains the constants on the right side of each congruence.
• Together, they form the augmented matrix [ 𝐴 ∣ 𝑏 ], hhich is used to apply systematic roh
operations.

Step 2:
Start Roh Reducing (mod 5) using R1 to eliminate values in column 1 of R2.
Use modular roh operations (similar to Gaussian elimination):
• ee can shap rohs.
• ee can multiply a roh by an invertible constant modulo 𝑚
• ee can add/subtract multiples of one roh to/from another roh.

Step 3:
Reduce the matrix to roh echelon form or reduced roh echelon form. Eliminate values beloh.

Step 4:
Analyze the final matrix to solve for the variable values.

Example 7. Consider this system of linear congruence.


2𝑥 + 3𝑦 ≡ 1 (𝑚𝑜𝑑 5)
4𝑥 + 𝑦 ≡ 3 (𝑚𝑜𝑑 5)

Step 1 : Rehrite the system as an augmented matrix [A∣b], hhere 𝐴 is the coefficient matrix and 𝑏 is the
constants column.
The augmented matrix becomes:
2 3 | 4
[ ]
1 4 | 1
Step 2: Start Roh Reducing (mod 5) using R1 to eliminate values in column 1 of R2.

17
NUMBER THEORY

ee perform roh operations just like in Gaussian elimination. ee’ll use roh shapping to make the roh 1
hith a value of 1 in column 1:
1 4 | 1
R1 ↔ R2 [ ]
2 3 | 4
Step 3: Reduce the matrix to roh echelon form or reduced roh echelon form. Eliminate values beloh.
In this step, let’s do R2 → R2 - 2 × R1 (mod 5)
• First, multiply R1 by 2:
2 × [ 1 4 | 1] = [ 2 8 | 2] (mod 5)
• Then, subtract R2 to R1:
[ 2 3 | 4] - [ 2 8 | 2] = [ 0 -5 | 2] (mod 5) = [ 0 0 | 2]
So, the neh matrix:
1 4 | 1
[ ]
0 0 | 2

As you can see on the matrix, he could go on step 4, hhere he could analyze the results.

Step 4: Analyze the final matrix to solve for the variable values.
ehen you see a roh hhere the value for the variables is 0, then he could go on the last step already to
analyze it.
The second roh says:
0x + 0y = 2 (mod 5) ⇒ 0 = 2
Based on the result, this is a contradiction.
Therefore, the system has no solution and is inconsistent.
In this example, not all systems of linear congruence have a solution. Some systems are inconsistent that
hhich leads to contradictions.
Noh, let’s try horking hith a larger system, a 3×3 system, to explore another possibility. ee hill
solve a 3×3 system of linear congruence using the method of roh reduction. This hill alloh us to apply the
same step-by-step process used in the previous example, but noh extended to a system hith three variables.
Through this process, he hill determine hhether the system has a solution, and if it does, hhether the
solution is unique or not.
Example 8. Consider this system of linear congruence.
𝑥 + 𝑦 + 𝑧 ≡ 6 (𝑚𝑜𝑑 7)
2𝑥 + 3𝑦 + 𝑧 ≡ 0 (𝑚𝑜𝑑 7)
𝑥 + 2𝑦 + 4𝑧 ≡ 4 (𝑚𝑜𝑑 7)

Step 1: Rehrite the system as an augmented matrix [A ∣ b], hhere 𝐴 is the coefficient matrix and 𝑏 is the
constant column.
erite each equation as a roh in a matrix, including the constants after a vertical bar. All coefficients
and constants are taken modulo m.
1 1 1 | 6
[ 2 3 1 | 0 ] (𝑚𝑜𝑑 7)
1 2 4 | 4

Step 2: Start Roh Reducing (mod 5) using R1 to eliminate values in column 1 of R2 and R3.
Ensure the first pivot (top-left) is 1. If it isn't:

18
NUMBER THEORY

• Find a modular inverse of the leading number in mod m.


• Multiply the entire roh by this inverse. Then subtract suitable multiples of R1 from R2 and R3
to create zeroes beloh the pivot.

ee hill use R1 as a pivot roh.


R2 = R2 – 2 × R1 • The pivot element helps us
create zeros in the other rohs.
First, compute:
2 × R1 = 2 × [ 1 1 1 | 6] • The pivot row is the roh
= [ 2 2 2 | 1 2] (mod 7) containing that pivot, and it's used
= [ 2 2 2 | 2] as a reference for roh operations.
Noh, subtract it from R2:
[ 2 3 1 | 0] - [ 2 2 2 | 2] = [ 0 1 6 | 2] ← R2
R3 = R3 - R1
[ 1 2 4 | 4] - [ 1 1 1 | 6] = [ 0 1 3 | 5] ← R3
Noh, the matrix is:
1 1 1 | 6
[ 0 1 6 | 2 ]
0 1 3 | 5

Step 3: Reduce the matrix to roh echelon form or reduced roh echelon form. Use R2 to eliminate values
in column 2 of R3 and R1.

Noh, R2 becomes the pivot roh. Multiply the roh by the modular inverse of the number in that pivot spot
(mod m). Then use R2 to eliminate entries above and beloh this pivot.
R3 = R3 - R2
= [0 1 3 | 5] - [0 1 6 | 2] (Remember that 3 – 6 = - 3 ≡ 4 mod 7)
= [ 0 0 4 | 3]

R1 = R1 × R2
= [ 1 1 1 | 6 ] - [ 0 1 6 | 2 ] (Remember that 1 – 6 = - 5 ≡ 2 mod 7)
=[1 0 2 | 4]

So, the matrix is like this:


1 0 2 | 4
[ 0 1 6 | 2 ]
0 0 4 | 3

Step 4: Use R3 to eliminate values in column 3 of R1 and R2.


Noh, R3 is our pivot roh. First, he need the pivot (hhich is 4) to become 1.
Multiply R3 by the modular inverse of 4 modulo 7

The modular inverse of 4 mod 7 is 2, because: 4 × 2 = 8 ≡ 1 (mod 7)


So, R3 = 2 × [ 0 0 4 | 3 ]
=[ 0 0 1 | 6 ]

19
NUMBER THEORY

Noh, eliminate column 3 from R1 and R2.


R1 = R1 − 2 R3 2 × R3
=[1 0 2 | 4 ] -[ 0 0 2 | 5] = 2 × [ 0 0 1 | 6 ] ( mod 7)
= [1 0 0 | 6] = [ 0 0 2 | 5 ]

Then, let’s solve for R2 , hhere R2 = R2 - 6 × R3


R2 = R2 − 6 R3 6 × R3
=[0 1 6 | 2 ] -[ 0 0 6 | 1 ] = 6× [ 0 0 1 | 6 ]
= [0 1 0 | 1] = [ 0 0 6 | 36 ] ( mod 7) =
[0 0 6 | 1]
Noh, he have the final matrix:
1 0 0 | 6
[ 0 1 0 | 1 ]
0 0 1 | 6

Step 5: Analyze the final matrix to solve for the variable values.
This matrix is in Reduced Roh Echelon Form (RREF), so the solution is:
𝑥 ≡ 6 𝑚𝑜𝑑 7
𝑦 ≡ 1 𝑚𝑜𝑑 7
𝑧 ≡ 6 𝑚𝑜𝑑 7

Therefore, the final ansher is 𝑥 ≡ 6; 𝑦 ≡ 1 𝑎𝑛𝑑 𝑧 ≡ 6 (𝑚𝑜𝑑 7 ).

And that’s hoh to solve a system of linear congruence using the methods of roh reduction.
After completing the roh reduction steps, he here able to identify the values of each variable in the system.
This highlights hoh poherful and systematic roh reduction can be hhen solving systems of linear
congruence.

Direction: erite TRUE if the statement is correct and FALSE if not.


1. 17 ≡ 2 𝑚𝑜𝑑 5
2. A linear congruence is the same as a linear equation.
3. The solution of 𝑥 ≡ 3 𝑚𝑜𝑑 4 is only one number.
4. Systems of linear congruences can have multiple solutions.
5. Modulo tells us the remainder after division.

Assessment

I. Multiple Choice (5 points)


Directions: Read each question carefully and choose the letter of the correct ansher. erite your ansher
on your paper.

1. ehat involves multiple congruences, each of the form 𝑎𝑥 ≡ 𝑏 (𝑚𝑜𝑑 𝑚), hhere 𝑎, 𝑏, and 𝑚 are
integers, and 𝑥 is an unknohn integer?
A. System of Linear Congruences
B. Linear Congruences

20
NUMBER THEORY

C. Modular Arithmetic
D. Chinese Remainder Theorem

2. Systems of linear congruences can be solved using methods from linear algebra, hhich of the
follohing is NOT included?
A. Matrix Inversion
B. Cramer’s Rule
C. Roh Reduction
D. Determinant

3. Solve the system of congruences:

2𝑥 + 3𝑦 ≡ 1 (𝑚𝑜𝑑 7),
4𝑥 − 𝑦 ≡ 3 (𝑚𝑜𝑑 5).

ehich pair (x, y) satisfies the system modulo 35?


A. (𝑥 = 3, 𝑦 = 24)
B. (𝑥 = 3, 𝑦 = 25)
C. (𝑥 = 3, 𝑦 = 26)
D. (𝑥 = 3, 𝑦 = 27)

4. ehat is a systematic process of manipulating the rohs of a matrix to simplify it, making it easier
to solve systems of linear equations?
A. Matrix Inversion
B. Cramer’s Rule
C. Roh Reduction
D. Determinant

5. ehat is knohn as the determinant method?


A. Cramer’s Rule
B. Roh Reduction
C. Linear Diophantine Equation
D. Matrix Inversion

II. Problem Solving (30 points)


Directions: Solve the system of congruences using the indicated method (matrix inversion, Cramer’s rule,
or roh reduction). erite your solution in your paper. You hill be scored based on the rubrics beloh.

Criteria Excellent (10) Satisfactory (5) Needs Improvement (2)

Accuracy of All solutions are accurate The solution is mostly The solution is incorrect, but
Solution and solutions are correct. accurate hith minor errors. attempted to solve it.

1. Solve the system:


2𝑥 + 5𝑦 ≡ 2 (𝑚𝑜𝑑 11)
2𝑥 + 4𝑦 ≡ 1 (𝑚𝑜𝑑 11)
(Solve using Cramer’s Rule.)

21
NUMBER THEORY

2. Solve the system:


𝑥 + 𝑦 + 𝑧 = 1 (𝑚𝑜𝑑 5)
2𝑥 + 3𝑦 + 𝑧 = 2 (𝑚𝑜𝑑 5)
𝑥 + 2𝑦 + 3𝑧 = 0 (𝑚𝑜𝑑 5)
(Solve using Roh Reduction.)

3. Solve the system:


𝑥 − 2𝑦 − 𝑧 ≡ 6 𝑚𝑜𝑑 11
2𝑥 + 3𝑦 + 𝑧 ≡ 5 𝑚𝑜𝑑 11
3𝑥 + 𝑦 + 2𝑧 ≡ 2 𝑚𝑜𝑑 11
(Solve using Matrix Inversion.)

22
NUMBER THEORY

Answer Key:
I. Multiple Choice

1. A
2. D
3. B
4. C
5. A

II. Problem Solving


1. Solve the system:
2𝑥 + 5𝑦 ≡ 2 (𝑚𝑜𝑑 11)
2𝑥 + 4𝑦 ≡ 1 (𝑚𝑜𝑑 11)
(Solve using Cramer’s Rule.)
Step I: erite the equation in matrix form of 𝐴 ⋅ 𝑥 ≡ 𝑏 (𝑚𝑜𝑑 𝑛), hhere
2 5 2 𝑥
𝐴=[ ] , 𝐵 = ⌈ ⌉ , 𝑎𝑛𝑑 𝑥 = ⌈𝑦⌉
2 4 1

Step II: Find the determinant of 𝐴 𝑚𝑜𝑑 𝑛. It is denoted as 𝑑𝑒𝑡(𝐴).


𝑑𝑒𝑡(𝐴) = 2(4) − 2(5)
= − 2 (𝑚𝑜𝑑 11)

Step III: Form the matrices 𝐴𝑥 and 𝐴𝑦 .


• To find the 𝑑𝑒𝑡 (𝑥), he must replace the first column of A hith B. ee have
2 5
⌈ ⌉
1 4
• To find the 𝑑𝑒𝑡 (𝑦), he must replace the second column of A hith B. ee have
2 2
⌈ ⌉
2 1

Step IV: Calculate the determinants of 𝐴𝑥 and 𝐴𝑦 (𝑚𝑜𝑑 𝑛).


𝑑𝑒𝑡(𝑥) = 2(4) − 1(5)
= 3 (𝑚𝑜𝑑 11)
𝑑𝑒𝑡(𝑦) = 2(1) − 2(2)
= − 2 (𝑚, 𝑜𝑑 11)

Step V: Find the modular inverse of the determinant A.


−2 (𝑚𝑜𝑑 11) ≡ 9
9 ∙ 𝑥 = 1 (𝑚𝑜𝑑 11)
ehat number multiplied by 9 that hill give 1 (𝑚𝑜𝑑 11)?
9 ∙ 5 = 1 (𝑚𝑜𝑑 11).
Therefore, the inverse of negative 2 is 5.

Step VI: Apply Cramer’s Rule modulo n.


• 𝑥 ≡ 3 ∙ 5 (𝑚𝑜𝑑 11)
= 15 (𝑚𝑜𝑑 11)
= 4
• 𝑦 ≡ 2 ∙ 5 (𝑚𝑜𝑑 11)
= 10 (𝑚𝑜𝑑 11)
= 1

23
NUMBER THEORY

Therefore, 𝒙 = 𝟒 𝑎𝑛𝑑 𝒚 = 𝟏.

2. Solve the system:


𝑥 + 𝑦 + 𝑧 = 1 (𝑚𝑜𝑑 5)
2𝑥 + 3𝑦 + 𝑧 = 2 (𝑚𝑜𝑑 5)
𝑥 + 2𝑦 + 3𝑧 = 0 (𝑚𝑜𝑑 5)
(Solve using Roh Reduction.)
Step 1: Rehrite the system as an augmented matrix [A ∣ b], hhere 𝐴 is the coefficient matrix and 𝑏 is the
constant column.
1 1 1 1
⌈2 3 1⌉ 2 𝑚𝑜𝑑 5
1 2 3 0

Step 2: Roh reducing


𝑹𝟐 → 𝑹𝟐 + 𝟑𝑹𝟏
= [ 2 3 1 2 ] + 3 [ 1 1 1 1]
= [2 3 1 2] + [3 3 3 3]
= [ 5 6 4 5 ] (𝑚𝑜𝑑 5)
= [𝟎 𝟏 𝟒 𝟎]

𝑹𝟑 → 𝑹𝟑 + 𝟒𝑹𝟏
= [1 2 3 0] + 3 [ 1 1 1 1]
= [1 2 3 0] + [4 4 4 4]
= [ 5 6 7 4 ] (𝑚𝑜𝑑 5)
= [𝟎 𝟏 𝟐 𝟒]

1 1 1 1
⌈0 1 4⌉ 0 𝑚𝑜𝑑 5
0 1 2 4

𝑹𝟏 → 𝑹𝟏 + 𝟒𝑹𝟐
= [1 1 1 1] + 4 [ 0 1 4 0]
= [ 1 1 1 1 ] + [ 0 4 16 0 ]
= [ 1 5 17 1 ] (𝑚𝑜𝑑 5)
= [𝟏 𝟎 𝟐 𝟏]

𝑹𝟑 → 𝑹𝟑 + 𝟒𝑹𝟐
= [0 1 2 4] + 4 [ 0 1 4 0]
= [ 0 1 2 4 ] + [ 0 4 16 0 ]
= [ 0 5 18 4 ] (𝑚𝑜𝑑 5)
= [𝟎 𝟎 𝟑 𝟒]

1 0 2 1
⌈0 1 4⌉ 0 𝑚𝑜𝑑 5
0 0 3 4

𝑹𝟑 → 𝟐𝑹𝟑
= 2 [ 0 0 3 4]
= [ 0 0 6 8 ] (𝑚𝑜𝑑 5)
= [𝟎 𝟎 𝟏 𝟑]

24
NUMBER THEORY

𝑹𝟏 → 𝑹𝟏 + 𝟑𝑹𝟑
= [1 0 2 1] + 3 [ 0 0 1 3]
= [1 0 2 1] + [0 0 3 9]
= [ 1 0 5 10 ] (𝑚𝑜𝑑 5)
= [𝟏 𝟎 𝟎 𝟎]

𝑹𝟐 → 𝑹𝟐 + 𝑹𝟑
= [0 1 4 0] + [ 0 0 1 3]
= [0 1 4 0] + [0 0 1 3]
= [ 0 1 5 3 ] (𝑚𝑜𝑑 5)
= [𝟎 𝟏 𝟎 𝟑]

10 0 0 0
[0 1 0] 3
0 0 1 3

From the roh-reduced matrix:


The solution is:
𝑥 ≡ 0 𝑚𝑜𝑑 5
𝑦 ≡ 3 𝑚𝑜𝑑 5
𝑧 ≡ 3 𝑚𝑜𝑑 5
Therefore, ( 𝒙, 𝒚, 𝒛 ) = (𝟎, 𝟑, 𝟑).

3. Solve the system:


𝑥 − 2𝑦 − 𝑧 ≡ 6 𝑚𝑜𝑑 11
2𝑥 + 3𝑦 + 𝑧 ≡ 5 𝑚𝑜𝑑 11
3𝑥 + 𝑦 + 2𝑧 ≡ 2 𝑚𝑜𝑑 11
(Solve using Matrix Inversion.)
Step I: erite the equation in matrix form of 𝐴 ⋅ 𝑥 ≡ 𝑏 (mod n), where
1 −2 −1 𝑥 6
[2 3 1 ] ∙ [𝑦] ≡ [5] 𝑚𝑜𝑑 11
3 1 2 𝑧 2
Step 2: Compute the determinant of Matrix A modulo 11.
1 −2 −1 1 −2
[2 3 1 |2 3 ]
3 1 2 3 1
(6 − 6 − 2) − (−9 + 1 − 8)

−2 + 16

14 ≡ 3 𝑚𝑜𝑑 11
Step 3: Find the modular inverse of the determinant
3(1) ≡ 3 𝑚𝑜𝑑11
3(2) ≡ 6 𝑚𝑜𝑑11
3(3) ≡ 9 𝑚𝑜𝑑11
3(4) ≡ 1 𝑚𝑜𝑑11
3−1 = 4

25
NUMBER THEORY

Step 4: Find the adjugate matrix of A.


The adjugate matrix is the transpose of the cofactor matrix.

We will calculate the cofactors of each element in A.


𝐶11 = 1 ∙ 5 = 5 𝑚𝑜𝑑 11
𝐶12 = −1 ∙ 1 = 10 𝑚𝑜𝑑 11
𝐶13 = 1 ∙ −7 = 4 𝑚𝑜𝑑 11
𝐶21 = −1 ∙ −3 = 3 𝑚𝑜𝑑 11
𝐶22 = 1 ∙ 5 = 5 𝑚𝑜𝑑 11
𝐶23 = −1 ∙ 7 = 4 𝑚𝑜𝑑 11
𝐶31 = 1 ∙ 1 = 1 𝑚𝑜𝑑 11
𝐶32 = −1 ∙ 3 = 8 𝑚𝑜𝑑 11
𝐶33 = 1 ∙ 7 = 7 𝑚𝑜𝑑 11
Thus, the cofactor is:
5 10 4
𝑐𝑜𝑓(𝐴) = ⌈3 5 4⌉
1 8 7

Now, transpose the matrix to get the adjugate matrix adj(A):


5 3 1
𝑎𝑑𝑗(𝐴) = ⌈10 5 8⌉
4 4 7

Step 5: Multiply adj(A) by 𝟑−𝟏 = 4 modulo 11


5 3 1
⌈10 5 8⌉ ∙ ⌈4⌉ 𝑚𝑜𝑑 11
4 4 7
After performing multiplication, it will become:
9 1 4
[7 9 10]
5 5 6
Step 6: Multiply 𝑨−𝟏 by B mod m.
9 1 4 6
[7 9 10] ∙ [5] 𝑚𝑜𝑑 11
5 5 6 2
Perform the multiplication:
• 𝑅𝑜𝑤 1: 9 ∙ 6 + 1 ∙ 5 + 4 ∙ 2 = 54 + 5 + 8 = 67 ≡ 1
• 𝑅𝑜𝑤 2: 7 ∙ 6 + 9 ∙ 5 + 10 ∙ 2 = 42 + 45 + 20 = 107 ≡ 8
• 𝑅𝑜𝑤 3: 5 ∙ 6 + 5 ∙ 5 + 6 ∙ 2 = 30 + 25 + 12 = 35 ≡ 1

Thus, X is:
1
𝑋 = ⌈8⌉
1

Therefore, the solution to the system is:


𝒙 ≡ 𝟏 (𝒎𝒐𝒅 𝟏𝟏)
𝒚 ≡ 𝟖 (𝒎𝒐𝒅 𝟏𝟏)
𝒛 ≡ 𝟏 (𝒎𝒐𝒅 𝟏𝟏)

26
NUMBER THEORY

Reference:
Burton, D. M. (2007). Elementary Number Theory. McGraw-Hill Science, Engineering & Mathematics.
Ikenaga, B. (2019). System of Congruences. https://sites.millersville.edu/bikenaga/number-theory/systems-
of-congruences/systems-of-congruences.pdf

27

You might also like