How does the Chinese remainder theorem solve systems of remainder problems?

Created from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.

The Chinese remainder theorem provides a method for finding an integer that satisfies a system of simultaneous congruence equations. It addresses problems where you know the remainders of an unknown number when divided by several different moduli.12

How the Theorem Works

The theorem states that if you have a set of moduli n1,n2,…,nk that are pairwise relatively prime—meaning they share no common factors other than 1—there is always a solution for any set of remainders a1,a2,…,ak.1

In modular arithmetic, this is expressed as:
a≡ai(modni)
for each i=1,2,…,k. The solution a is unique modulo N, where N is the product of all moduli (N=n1×n2×…×nk).1

Solving the System

To find the solution, one must determine an integer that satisfies all conditions simultaneously. Historically, mathematicians like Qin Jiushao developed algorithms to compute these values, often using techniques related to finding the greatest common divisor. If the moduli are not pairwise relatively prime, a solution may not exist unless common factors are first addressed.21