Several related results in number theory and abstract algebra are known under the name Chinese remainder theorem.
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
Furthermore, all solutions x to this system are congruent modulo the product N = n1n2…nk.
Sometimes, the simultaneous congruences can be solved even if the nis are not pairwise coprime. A solution x exists if and only if:
All solutions x are then congruent modulo the least common multiple of the ni.
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:
Again, to begin, the product N = n1n2…nk is defined. Then a solution x can be found as follows.
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:
Consider ei. The above equation guarantees that its remainder, when divided by ni, must be 1. On the other hand, since it is formed as si N/ni, the presence of N guarantees that it's evenly divisible by any nj so long as j ≠ i.
Because of this, combined with the multiplication rules allowed in congruences, one solution to the system of simultaneous congruences is:
For example, consider the problem of finding an integer x such that
Using the extended Euclidean algorithm for 3 and 4×5 = 20, we find (−13) × 3 + 2 × 20 = 1, i.e. e1 = 40. Using the Euclidean algorithm for 4 and 3×5 = 15, we get (−11) × 4 + 3 × 15 = 1. Hence, e2 = 45. Finally, using the Euclidean algorithm for 5 and 3×4 = 12, we get 5 × 5 + (−2) × 12 = 1, meaning e3 = −24. A solution x is therefore 2 × 40 + 3 × 45 + 2 × (−24) = 167. All other solutions are congruent to 167 modulo 60, which means that they are all congruent to 47 modulo 60.
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
such that
The inverse isomorphism can be constructed as follows. For each i, the elements ui and u/ui are coprime, and therefore there exist elements r and s in R with
Set ei = s u/ui. Then the inverse of f is the map
such that
Note that this statement is a straightforward generalization of the above theorem about integer congruences: the ring Z of integers is a principal ideal domain, the surjectivity of the map f shows that every system of congruences of the form
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
such that
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.
Modular arithmetic | Commutative algebra | Mathematical theorems
Chinesischer Restsatz | Teorema chino del resto | Théorème des restes chinois | Teorema sisa Cina | Teorema cinese del resto | משפט השאריות הסיני | Chinese reststelling | 中国の剰余定理 | Chińskie twierdzenie o resztach | Китайская теорема об остатках | Kinesiska restsatsen | 中国剩余定理
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Chinese remainder theorem".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world