Section 4.2 Chinese Remainder Theorem
numberNow we add yet another twist to solving congruences.
In the first century A.D. Sun-Tsu asked what number yields remainders of \(2,3,\) and \(2\) when divided by \(3,5,\) and \(7,\) respectively? This is equivalent to solving the system
Theorem 4.2.1 (Chinese Remainder Theorem).
Let \(n_1, n_2,..., n_r \in\mathbb{N}\) such that \(\gcd(n_i, n_j) = 1\) for \(i \neq j.\) Then the system of linear congruences
has a simultaneous solution, which is unique modulo \(n_1n_2...n_r.\)
Proof.
Let \(n = n_1n_2...n_r,\) and for each \(k = 1, 2,..., r\) let
Note that this gives \(\gcd(N_k, n_k) = 1.\) So the congruence \(N_kx \equiv 1\pmod{n_k}\) has a unique solution modulo \(n_k,\) say \(x_k.\) We will show that the integer
is a simultaneous solution to the given system.
Since \(n_i\vert N_k\) for \(i \neq k, N_i \equiv 0 \pmod{n_k}\) if \(i\neq k.\) Thus
But since \(N_kx_k \equiv 1 \pmod{n_k},\) we have that
Thus \(\overline{x}\) is a simultaneous solution.
To see that it is unique modulo \(n,\) suppose that \(\overline{x}'\) is any other solution that satisfies the given system. Then
and so \(n_k\vert (\overline{x}-\overline{x}')\) for each \(k.\) But since \(\gcd(n_i, n_j)=1\) for \(i\neq j,\) we have that \(n_1n_2...n_r = n\vert (\overline{x}-\overline{x}').\) Thus \(\overline{x}\equiv\overline{x}'\pmod{n}.\) This proves the theorem.
Example 4.2.2.
To solve Sun-Tsu's problem, we have
Using the notation of the Chinese Remainder Theorem, we have \(n = 3\cdot 5\cdot 7 =105\) and
To find the \(x_i\)'s we solve each of the congruences
so that we have \(x_1 = 2, x_2 = 1, x_3 = 1.\) So a solution of the given system is
Now we can finally solve some more general congruences. Consider the next example. As a different way to solve some congruences.
Example 4.2.3.
Using the Chinese Remainder Theorem we can solve the congruence
Since \(276 = 3\cdot 4\cdot 23,\) we turn our one congruence into the system
which reduced is
Since \(x\equiv 0 \pmod{3}\) we know that \(x = 3k\) for some \(k.\) So we substitute this in the next congruence to see that
and so
so that \(k = 3 + 4j\) for some \(j,\) so that \(x = 3(3 + 4j) = 9 + 12j.\) Now we substitute this into the last congruence so that we need only solve
This reduces to
so that \(j \equiv 2 \pmod{23}.\) So \(j = 2 + 23t\) for \(t \in\mathbb{Z}.\) Hence
so \(x \equiv 33 \pmod{276}\) is the unique solution modulo \(276.\) It is unique since \(\gcd(17, 276) = 1.\)
The Chinese Remainder Theorem has numerous applications. It is conceivable that one of these might have been how the Chinese generals counted their troops:
\(\hspace{10mm}\) Line up \(7\) by \(7\text{!}\) \(\hspace{5mm}\) (Not factorial, but a SCREAMED military command.)
\(\hspace{10mm}\) Line up \(11\) by \(11\text{!}\)
\(\hspace{10mm}\) Line up \(13\) by \(13\text{!}\)
\(\hspace{10mm}\) Line up \(17\) by \(17\text{!}\)
Counting only the remainders in the incomplete rows, the intelligent generals could know the exact number of their soldiers 1 .