Professional Documents
Culture Documents
Chinese Reminder Theorem: The Problem
Chinese Reminder Theorem: The Problem
Fall 2005
The problem
Here is the statement of the problem that the Chinese Remainder Theorem solves.
Theorem (Chinese Remainder Theorem). Let m1 , . . . , mk be integers with gcd(mi , mj ) = 1
whenever i 6= j. Let m be the product m = m1 m2 mk . Let a1 , . . . , ak be integers. Consider the
system of congruences:
()
x a1
x a2
...
x ak
(mod m1 )
(mod m2 )
(mod mk ).
The algorithm
The solution to the system (*) may be obtained by the following algorithm.
Theorem (Chinese Remainder Theorem Algorithm). We may solve the system (*) as follows.
(1) For each i = 1, . . . , k, let zi = m/mi = m1 m2 . . . mi1 mi+1 . . . mk .
(2) For each i = 1, . . . , k, let yi = zi1 (mod mi ). (Note that this is always possible because
gcd(zi , mi ) = 1.)
(3) The solution to the system (*) is x = a1 y1 z1 + + ak yk zk .
Proof. Why does the Chinese Remainder Theorem algorithm work? The notation makes the proof
surprisingly simple to state. Lets study x = a1 y1 z1 + + ak yk zk and compute x (mod m1 )
for example. The same argument will work for x (mod mi ) for i > 1. The key observation (and a very clever one too) is that zi 0 (mod m1 ) when i 6= 1 since m1 divides zi =
m/mi = m1 m2 . . . mi1 mi+1 . . . mk . Thus when we compute x (mod m1 ), we obtain x a1 y1 z1
(mod m1 ). But y1 z1 1 (mod m1 ) by (2), and we obtain x a1 (mod m1 ).
Chinese Reminder Theorem
Page 1 of 3
Math 470
Fall 2005
An application
The text (p. 74) emphasizes the opposite line of thought from the above. Now we wish to solve
the equation x a (mod m) where m is a multiple of two or more pairwise relatively prime
integers. The Chinese Remainder Theorem Algorithm tells us that the x is precisely the solution
to the modular system
()
x a1
x a2
...
x ak
(mod m1 )
(mod m2 )
(mod mk ).
Page 2 of 3
Math 470
Fall 2005
Page 3 of 3