3

Can someone provide a good explanation of the Chinese Remainder Theorem? I can never seem to understand it. When you make your answer, please explain everything as simply as possible and don't just provide a link.

Thomas Andrews
  • 186,215
suomynonA
  • 7,303

1 Answers1

5

The Chinese Remainder Theorem - which does actually have a genuine Chinese association from the 3rd century - states that for an unknown number, given the remainders of that to a set of mutually coprime bases, we can identify a unique number corresponding to that less that the product of the bases.

The first examples considered are usually to two bases. For example

A positive number $n$ has a remainder of $3$ when divided by $5$, and a remainder of $2$ when divided by $7$. What is the smallest possible value of $n$?

Maybe a visualization of this example system would be useful:

enter image description here

with the top line being remainders after division by $5$ and the bottom line remainders after division by $7$ for the numbers $1$ to $35$.

What the Chinese Remainder Theorem says is, that since $5$ and $7$ are coprime, the paired values of remainders of each number up to $5\times 7 = 35$ will be unique.

If you pick some sample remainder value for base $5$, say $2$, and scan along, you can see that you encounter each possible remainder to base $7$ exactly once: $(2,0,5,3,1,6,4)$ in succession.

The details of how to solve such a problem are well-covered in the Wikipedia article, but by examination here you can see that the answer to the small problem above is $23$, and you also know that the next larger solution is $23+35 = 58$.

The same effect also applies, perhaps more impressively, when looking at a set of more than two coprime bases - every combination of possible remainders corresponds to exactly one number in the repeat range.

Joffan
  • 40,356
  • So the theorem is just saying for two coprimes $a$ and $b$ there is only one number in every $ab$ numbers where both leave remainder $0$? – suomynonA Nov 27 '16 at 02:42
  • I've always thought it was a way to convert high value mods into lower value mods, something like $2323423\equiv531\pmod {572}=52\equiv 2\pmod 5$ Note: I know this isn't a correct conversion... I don't know how to simplify these mods – suomynonA Nov 27 '16 at 02:45
  • Yes, the Chinese Remainder thoerem is an important but fairly low-level result. In every $ab$ numbers, every pair of remainders to $a$ and $b$ is associated with exactly one number in that range. $(0,0)$ is one such pair but equally any other valid pair also. – Joffan Nov 27 '16 at 05:15
  • So basically what I said in my first comment, correct? – suomynonA Nov 27 '16 at 18:55
  • @suomynonA I just wanted to be sure that you knew that it wasn't just for the remainder $0$ case - for any pair (set) of viable remainders, there's only and exactly one matching number. (Keeping in mind we could be talking about more than two bases, I just used two to keep it simple) – Joffan Nov 27 '16 at 19:36