Chinese remainder theorem
Encyclopedia : C : CH : CHI : Chinese remainder theorem
Several related results in number theory and abstract algebra are known under the name Chinese remainder theorem.
Theorem statement
The original form of the theorem, contained in a third-century book by Chinese mathematician Sun Tzu and later republished in a 1247 book by Qin Jiushao, is a statement about simultaneous congruences (see modular arithmetic).
Suppose n1, n2, …, nk are integers which are pairwise coprime. Then, for any given integers a1,a2, …, ak, there exists an integer x solving the system of simultaneous congruences
- [x \equiv a_1 \pmod \,\! ]
- [x \equiv a_2 \pmod \,\! ]
- [\vdots \,\! ]
- [x \equiv a_k \pmod \,\! ]
Sometimes, the simultaneous congruences can be solved even if the nis are not pairwise coprime. A solution x exists if and only if:
- [a_i \equiv a_j \pmod \qquad \mboxi\mboxj . \,\! ]
A constructive algorithm to find the solution
This algorithm only treats the situations where the ni's are coprime. The method of successive substitution can often yield solutions to simultaneous congruences, even when the moduli are not pairwise coprime.
Suppose, as above, that a solution is needed to the system of congruences:
- [x \equiv a_i \pmod \quad\mathrm\; i = 1, \ldots, k.]
For each i the integers ni and N/ni are coprime. Using the extended Euclidean algorithm we can therefore find integers ri and si such that ri ni + si N/ni = 1. Then, choosing the label ei = si N/ni, the above expression becomes:
- [ r_i n_i + e_i = 1 \,\! ]
- [e_i \equiv 1 \pmod \quad \mathrm \quad e_i \equiv 0 \pmod \quad \mathrm ~ i \ne j]
- [ x = \sum_^k a_i e_i.\ ]
- [x \equiv 2 \pmod, \,\! ]
- [x \equiv 3 \pmod, \,\! ]
- [x \equiv 2 \pmod. \,\! ]
Statement for principal ideal domains
For a principal ideal domain R the Chinese remainder theorem takes the following form: If u1, ..., uk are elements of R which are pairwise coprime, and u denotes the product u1...uk, then the quotient ring R/uR and the product ring R/u1R × ⋯ × R/ukR are isomorphic via the isomorphism
- [f : R/uR \rightarrow R/u_1R \times \cdots \timesR/u_k R ]
- [f(x +uR) = (x + u_1R, \ldots , x +u_kR) \quad\mbox x\in R. ]
- [r u_i + s u/u_i = 1. \,\!]
- [g : R/u_1R \times \cdots \times R/u_kR\rightarrow R/uR ]
- [g(a_1+u_1R,\ldots ,a_k+u_kR)=\left( \sum_^k a_i e_i \right) + uR \quad\mboxa_1,\ldots,a_k\in R. ]
- [x \equiv a_i \pmod \quad\mathrm\; i = 1, \ldots, k]
Statement for general rings
The general form of the Chinese remainder theorem, which implies all the statements given above, can be formulated for rings and (two-sided) ideals. If R is a ring and I1, ..., Ik are two-sided ideals of R which are pairwise coprime (meaning that Ii + Ij = R whenever i ≠ j), then the product I of these ideals is equal to their intersection, and the quotient ring R/I is isomorphic to the product ring R/I1 x R/I2 x ... x R/Ik via the isomorphism
- [f : R/I \rightarrow R/I_1 \times \cdots \times R/I_k ]
- [f(x + I) = (x +I_1, \ldots , x+I_k) \quad\mbox x\in R.]
Applications
In the RSA algorithm calculations are made modulo [n], where [n] is a product of two primes [p] and [q]. Common sizes for [n] are 1024, 2048 or 4096 bits, making calculations very time-consuming. Using Chinese remaindering these calculations can be transported from the ring [\Bbb_n] to the ring [\Bbb_p \times \Bbb_q]. The sum of the bit sizes of [p] and [q] is the bit size of [n], making [p] and [q] considerably smaller than [n]. This greatly simplifies calculations.Another potential application of Chinese remainder theorem is for counting soldiers in an army. Via Chinese remainder theorem, the general has the soldiers quickly line up in groups of 2, 3, 5, 7, 11, and so on and counts the remaining soldiers that can't make complete groups. After enough of these tests are made, the general can quickly calculate how many soldiers he has exactly; thus he has done a 3 hour headcount in all of 2 minutes. This fact, that a large number can be represented by a small number of relatively small remainders, is also the core idea of residue number systems.
See also
External links
References
- Donald Knuth. The Art of Computer Programming, Volume 2: Seminumerical Algorithms, Third Edition. Addison-Wesley, 1997. ISBN 0-201-89684-2. Section 4.3.2 (pp.286–291), exercise 4.6.2–3 (page 456).
- Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms, Second Edition. MIT Press and McGraw-Hill, 2001. ISBN 0262032937. Section 31.5: The Chinese remainder theorem, pp.873–876.
From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.
