Dudley Section 5
Dudley Section 5
Linear Congruences 1
Note. If integer r is a solution to ax ≡ b (mod m), then there are infinitely many
other integers x that also satisfy the equation since for each x = r + km and for all
integers k we have: a(r + km) = ar + km ≡ ar (mod m) ≡ b (mod m).
Exercise 5.1. Construct congruences modulo 12 with no solutions, just one solu-
tion, and more than one solution.
Solution. Consider 2x ≡ 1 (mod 12). Since 2x is even for all x ∈ Z , but any
Section 5. Linear Congruences 2
number which is 1 (mod 12) is odd, then there are no solutions to this equation.
Consider x ≡ 1 (mod 12). The unique solution is x = 1.
Consider 2x ≡ 2 (mod 12). Then x = 1 and x = 7 are solutions.
Note. We want to quantify the number of solutions for a linear congruence. This
is accomplished in Theorem 5.1, which is based on the next three lemmas.
Note 5.A. In the proof of Lemma 5.2, we showed that two least residues modulo
m are congruent (mod m) then they are equal. We will use the idea again.
Note 5.B. Before we state the result giving the number of solutions to ax ≡ b (mod
m), we explain some techniques of solving such equations. We can manipulate the
equation until cancellation is a possibility. For example, to solve 4x ≡ 1 (mod 15),
can can equivalently consider the equation 4x ≡ 16 (mod 15) which has the unique
Section 5. Linear Congruences 3
Note 5.C. We can use this method to solve linear Diophantine equations ax+by =
c. This single equation implies the two linear congruences ax ≡ c (mod b) and
by ≡ c (mod a). Solving one equation with the method described in Note 5.B leads
to the solution of the original equation.
Example 5.4. Solve (a) 8x ≡ 1 (mod 15), and (b) 9x + 10y = 11.
Note. In each of the examples above of the form ax ≡ b (mod m), we have the
greatest common divisor (a, m) = 1. In the event that (a, m) 6= 1, we can apply
Theorem 4.5. For example, with 6x ≡ 15 (mod 33) we have (a, m) = (6, 33) = 3
and by Theorem 4.5 (with c = 3) we have 2x ≡ 5 (mod 11). With the method of
Note 5.B, we get 2x ≡ 5 ≡ 5+11 ≡ 16 (mod 11) and so x = 8 is the solution to this
equation. All values of x which satisfy this equation are of the form x ≡ 8 (mod
11). So the solutions to the original equation (which we take modulo 33) 6x ≡ 15
(mod 33) are x = 8, 19, 30. Notice that we get 3 solutions and (a, m) = 3. This is
not a coincidence, as we now show.
Lemma 5.3. Let d = (a, m). If d | b then ax ≡ b (mod m) has exactly d solutions.
Note. Lemmas 5.1, 5.2, and 5.3 combine to yield the following result which gives
the number of solutions to ax ≡ b (mod m) in terms of the greatest common divisor
(a, m).
Note 5.D. We now turn out attention to the Chinese Remainder Theorem. The
first known reference to a problem related to the Chinese Remainder Theorem is
in Sun Zi’s Sunzi suanjing (in English, “Sun Zi’s Mathematical Manual”). It is
estimated that Sun Zi lived between about 400 and 460, but little is known about
Section 5. Linear Congruences 5
him and these dates are debatable. In Problem 26 of Chapter 3, Sun Zi states the
following problem:
“Suppose we have an unknown number of objects. When counted in
threes, 2 are left over, when counted in fives, 3 are left over, and when
counted in sevens, 2 are left over. How many objects are there?”
(This historical information on Sun Zi is from the MacTutor History of Mathematics
Archive biography on Sun Zi, accessed 10/1/2021.) With x as the number of
objects, this problem translates into solving the three congruences:
Note. We now solve Sun Zi’s problem. The first congruence x ≡ 1 (mod 3) implies
that x = 1 + 3k1 for some k1 ∈ Z. With this in the second congruence, we have
1 + 3k1 ≡ 2 (mod 5) which implies (by the method of Note 5.B) that k2 ≡ 2 (mod
5), or that k1 = 2 + 5k2 where k2 ∈ Z. Then x = 1 + 3k1 = 1 + 3(2 + 5k2 ) = 7 + 15k2
satisfies the first two congruences. This then requires from the third congruence
that x = 5 + 15k2 ≡ 3 (mod 7), or (reducing modulo 7) k2 ≡ 3 (mod 7), or that
k2 = 3 + 7k3 where k3 ∈ Z. Then x = 7 + 15k2 = 7 + 15(3 + 7k3 ) = 52 + 105k3
where k3 ∈ Z satisfies all three congruences. That is, x ≡ 52 (mod 105) satisfies
the system of linear congruences. Notice that 105 is the product of 3, 5, and 7 (and
these are pairwise relatively prime). The Chinese Remainder Theorem addresses
this type of problem.
Section 5. Linear Congruences 6