Chinese Remainder TheoremAccording to D. Wells, the following problem was posed by Sun Tsu Suan-Ching (4th century AD): There are certain things whose number is unknown. Repeatedly divided by 3, the remainder is 2; by 5 the remainder is 3; and by 7 the remainder is 2. What will be the number? Oystein Ore mentions another puzzle with a dramatic element from Brahma-Sphuta-Siddhanta (Brahma's Correct System) by Brahmagupta (born 598 AD): An old woman goes to market and a horse steps on her basket and crashes the eggs. The rider offers to pay for the damages and asks her how many eggs she had brought. She does not remember the exact number, but when she had taken them out two at a time, there was one egg left. The same happened when she picked them out three, four, five, and six at a time, but when she took them seven at a time they came out even. What is the smallest number of eggs she could have had? Problems of this kind are all examples of what universally became known as the Chinese Remainder Theorem. In mathematical parlance the problems can be stated as finding n, given its remainders of division by several numbers
The modern day theorem is best stated with a couple of useful notations. For non-negative integers
where, as always, "s|m" means that s divides m exactly. The least common multiple of k numbers is defined as
Both gcd() and lcm() are symmetric functions of their arguments. They are complementary in the sense that, for gcd(m1, m2)·lcm(m1, m2) = m1· m2. (A proof and an interactive illustration for this identity appears elsewhere.) However, for k > 2 a similar identity does not in general hold. For an example, consider two triplets: gcd(m1, (gcd(m2, m3)) = gcd(gcd(m1, m2), m3) and, both equal gcd(m1, m2, m3). Similarly, lcm(m1, (lcm(m2, m3)) = lcm(lcm(m1, m2), m3) NoteIf, for a prime p, pαi|mi, with αi being the largest exponent with that property, then Associativity allows one to proceed a step at a time with an inductive argument without putting all eggs into a basket at once. Jumping at the opportunity I'll prove the most basic case of Theorem 1Two simultaneous congruences
n = n1 (mod m1) and are only solvable when (When m1 and m2 are coprime their gcd is 1. By convention, ProofBy a generalization of the Euclid's algorithm, there are integers s and t such that tm1 + sm2 = gcd(m1, m2). Since n2 - n1 = 0 (mod gcd(m1, m2)), for some, possibly different t and s,
Then n = tm1 + n1 = -sm2 + n2 satisfies both congruences in the theorem. This proves the existence of a solution. To prove the uniqueness part, assume n and N satisfy the two congruences. Taking the differences we see that N - n = 0 (mod m1) and N - n = 0 (mod m2) which implies N - n = 0 (mod lcm(m1, m2)). As was previously stated, a more general theorem can now be proved by induction. Theorem 2
The simultaneous congruences (1)
ProofTheorem 1 serves the initial step verification. Assume the theorem holds for k congruences and consider
n = n1 (mod m1) Let s be a solution to the first k equations. Then the congrurence
Let's write g u = gcd(m u, mk+1), u = 1, ..., k. Then we know that s = nk+1 (mod g u), u = 1, 2, ..., k. If so,
because lcm(gcd(m1, mk+1), ..., gcd(mk, mk+1)) = gcd(lcm(m1, ..., mk), mk+1). Thus the system
n = s (mod lcm(m1, m2, ..., mk)) has a solution which is unique modulo CorollaryThe simultaneous congruences (1)
n = n1 (mod m1) where all mi's are pairwise coprime has a unique solution modulo If some mi's are not mutually prime, a solution may not exist unless the corresponding congruence agree. For example, the system Let's now solve the two problems we started the page with. Problem #1Solve
From p1, x = 3t + 2, for some integer t. Substituting this into p2 gives
which, in turn, is equivalent to t = 5s + 2 for an integer s. Substitution into Note that 105 = lcm(3, 5, 7). Thus we have solutions 23, 128, 233, ... Problem #2Solve
With the experience we acquired so far, the combination of q1-q5 is equivalent to
x = 60t + 1. Plugging this into q6 gives 60t = -1 (mod 7). Casting out 7 simplifies this to References
|Contact| |Front page| |Contents| |Algebra| |Store| Copyright © 1996-2012 Alexander Bogomolny |
| 40585764 |

