The Chinese Remainder Theorem

8
The Chinese Remainder Theorem A presentation by Vincent Kusiak

description

The Chinese Remainder Theorem. A presentation by Vincent Kusiak. Origins. First developed in the third century A.D. by Chinese mathematician Sun Tzu- unfortunately not the same as his more famous countryman who authored the Art of War - PowerPoint PPT Presentation

Transcript of The Chinese Remainder Theorem

Page 1: The Chinese Remainder Theorem

The Chinese Remainder Theorem

A presentation by Vincent Kusiak

Page 2: The Chinese Remainder Theorem

Origins

• First developed in the third century A.D. by Chinese mathematician Sun Tzu- unfortunately not the same as his more famous countryman who authored the Art of War

• Re-published in a 1247 book by Qin Jiushao, titled “Mathematical Treatise in Nine Sections”

Page 3: The Chinese Remainder Theorem

Modular Arithmetic

• The theorem only applies in modular arithmetic.

• Specifically, when we have the relationship x = k mod j, where x minus k equals some number which is a multiple of j.

• For example, 38 = 14 mod 12• We can see, then that k is broken up into

multiple ‘classes’, with any given k +/- j

Page 4: The Chinese Remainder Theorem

So what the heck is it?

Page 5: The Chinese Remainder Theorem

Well first…

• You need a set of numbers that are pairwisecoprime integers; {9,10,19} or {10,7,33,13}

• That is, a set of numbers that, when paired, are only divisible by 1; {9,10} or {33,13}

• The theorem states that for any set of these integers n1, n2… nk and any given integers a1, a2… ak, there exists an X such that—

• X = a1 mod n1, X = a2 mod n2… X = ak mod nk

Page 6: The Chinese Remainder Theorem

A problem—

• Just by knowing the truth of the theorem, can you figure out what X must be in the system

• X = 2 mod 3• X = 3 mod 4• X = 1 mod 5

Page 7: The Chinese Remainder Theorem

A simple(ish) proof

X = 2 mod 5 gives X = 5k + 2X = 1 mod 11X = 4 mod 19X = 5k + 2 = 1 mod 11 so 5k = -1 mod 11 which

via equivalence classes is 5k = 10 mod 11, thus k = 5 mod 11

Page 8: The Chinese Remainder Theorem

SO…

k = 11j +2 and thus X = 5(11j + 2) + 2 and THUSX = 5(11j) + 12 = 4 mod 19 so5 * 11 * j = -8 mod 19 so 5 * 11 * j = 11 mod 19So 5j = 1 mod 19And j = 4 mod 19 because 4 * 5 -1 = 19So j = 19m + 4 and so X = 5 * 11 * 19m +5 * 11 *

4 +12Phew.