Solve systems of congruences using the Chinese Remainder Theorem (CRT). Calculate the unique solution modulo the product of moduli.
Chinese Remainder Theorem (CRT): If moduli m₁, m₂, ..., mₙ are pairwise coprime, then the system of congruences x ≡ aᵢ (mod mᵢ) has a unique solution modulo M = m₁ × m₂ × ... × mₙ.
The Chinese Remainder Theorem (CRT) is a theorem in number theory that provides a unique solution to a system of simultaneous congruences with pairwise coprime moduli. It has applications in cryptography, computer science, and coding theory.
Mathematical Statement:
Given pairwise coprime positive integers m₁, m₂, ..., mₙ and arbitrary integers a₁, a₂, ..., aₙ, the system of congruences:
x ≡ a₁ (mod m₁)
x ≡ a₂ (mod m₂)
...
x ≡ aₙ (mod mₙ)
has a unique solution modulo M = m₁ × m₂ × ... × mₙ.
Compute M: Calculate the product of all moduli: M = m₁ × m₂ × ... × mₙ
Compute Mᵢ: For each modulus mᵢ, compute Mᵢ = M / mᵢ
Find inverses: For each i, find yᵢ such that Mᵢ × yᵢ ≡ 1 (mod mᵢ) using the extended Euclidean algorithm
Compute solution: x = Σ(aᵢ × Mᵢ × yᵢ) mod M
The extended Euclidean algorithm finds integers x and y such that ax + by = gcd(a, b). It's used to find modular inverses in the CRT solution.
| Step | Quotient q | Remainder r | x | y |
|---|---|---|---|---|
| 0 | 17 | 1 | 0 | |
| 1 | 5 | 0 | 1 | |
| 2 | 3 | 2 | 1 | -3 |
| 3 | 2 | 1 | -2 | 7 |
| 4 | 2 | 0 | 5 | -17 |
Example: Finding the inverse of 5 modulo 17 gives 7, since 5×7 = 35 ≡ 1 (mod 17)
Calculator Features:
x ≡ 2 (mod 3)
x ≡ 3 (mod 5)
x ≡ 1 (mod 2)
x ≡ 2 (mod 3)
x ≡ 3 (mod 5)
x ≡ 0 (mod 2)
x ≡ 0 (mod 3)
x ≡ 1 (mod 5)
x ≡ 1 (mod 3)
x ≡ 4 (mod 5)
x ≡ 6 (mod 7)