Number Theory - The Chinese Remainder Theorem
Number Theory - The Chinese Remainder Theorem
x = 2 (mod 5)
x = 3 (mod 7)
For any system of equations like this, the Chinese Remainder Theorem tells us there
is always a unique solution up to a certain modulus, and describes how to find the
solution efficiently.
x = b (mod q)
Z 5 × Z 7 , and then apply the Chinese Remainder Theorem to find that (4, 2) is
9 (mod 35).
Let us restate the Chinese Remainder Theorem in the form it is usually presented.
For Several Equations
Theorem: Let m 1, be pairwise coprime (that is gcd(m i , m j )
. . . , mn = 1 whenever
i ≠ j). Then the system of n equations
x = a1 (mod m 1 )
...
x = an (mod m n )
Proof: This is an easy induction from the previous form of the theorem, or we can
write down the solution directly.
n
′
x = ∑ ai bi bi (mod M )
i=1
to get
Zn = Z k
1 ×. . . ×Z km
p pm
1
https://crypto.stanford.edu/pbc/notes/numbertheory/crt.html 2/3
10/21/24, 10:14 PM Number Theory - The Chinese Remainder Theorem
Contents
Number Theory
Modular Arithmetic
Euclid’s Algorithm
Division
Chinese Remainder
Polynomial Roots
Units & Totients
Exponentiation
Order of a Unit
Miller-Rabin Test
Generators
Cyclic Groups
Quadratic Residues
Gauss' Lemma
Quadratic Recip.
Carmichael
Multiplicative
Möbius Inversion
Generators II
Cyclotomic
Heptadecagon
Eisenstein
Gaussian Periods
Roots of Unity
Quadratic Forms
Notes
Ben Lynn
[back to top]
https://crypto.stanford.edu/pbc/notes/numbertheory/crt.html 3/3