Overview
The Chinese Remainder Theorem (CRT) states that if you know the remainders of a number when divided by several pairwise coprime integers, you can uniquely determine the remainder of when divided by the product of those integers.
Structurally, CRT establishes a bijection (a perfect one-to-one correspondence) between a number modulo and a tuple of its remainders modulo each . This means that any operation you do on the large modulus can be broken down, computed on the smaller moduli independently, and then stitched back together.
Visualizing the Theorem: The Number Line Alignment
To see why this works, imagine overlapping number lines. Suppose we want to find a number that satisfies:
If we list the valid non-negative numbers for each condition, we are looking for the points where the two sequences "align" or intersect:
| Condition | Valid Solutions for |
|---|---|
| 2, 5, 8, 11, 14, 17, 20, 23, 26, 29 | |
| 3, 8, 13, 18, 23, 28, 33 |
The sequences overlap at 8 and 23. Notice that the distance between these overlapping solutions is exactly , which is . The Chinese Remainder Theorem formalizes this exact phenomenon: the intersection of these periodic sequences will always form a new, perfectly regular sequence modulo the product of their coprime bases!
Key Ideas
- The Core Theorem: If are pairwise coprime positive integers ( for ), the system has a unique solution modulo .
- Constructive Substitution: To solve manually, write the congruence with the largest modulus as an algebraic equation (e.g., ), substitute it into the next congruence, and solve for .
- The Formulaic Approach (Using Inverses): For a system of two congruences and , you can use the Extended Euclidean Algorithm to find such that . The solution is then .
Worked Examples
Example 1: Standard System Reconstruction
Find the smallest positive integer that satisfies:
Solution: First, look for shortcuts. Notice that and . Because 3 and 7 are coprime, we can directly combine these into a single congruence: .
Now we have a two-congruence system:
Convert the first congruence into an equation: for some integer . Substitute this into the second congruence:
Reduce to :
Write as an equation: . Substitute back into :
Thus, . The smallest positive integer is .
Example 2: Finding Last Digits of Massive Powers
What are the last two digits of ?
Solution: Finding the last two digits is equivalent to finding . Computing modulo 100 directly is tedious, but , and . We can compute the remainders modulo 4 and modulo 25 separately.
Modulo 4:
Modulo 25: We can use Euler's Totient Theorem. . Therefore, . We divide the exponent: .
Calculate step-by-step:
Now we have the system:
From the second equation, . Substitute into the first:
So, . Substitute back: . The last two digits are .
Common Pitfalls
- Forgetting the coprimality requirement: CRT only works cleanly if the moduli share no common factors.
- Arithmetic errors in substitution: Reducing negative numbers incorrectly during the substitution steps (e.g., is , not ).
- Losing the final modulus: The solution is unique modulo the product of all the coprime moduli, not just the largest one.
Practice Problems
| Status | Source | Problem Name | Difficulty | Tags | ||
|---|---|---|---|---|---|---|
Module Progress:
Join the AoPS Community!
Stuck on a problem, or don't understand a module? Join the AoPS community and get help from other math contest students.
