Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chinese Remainder Theorem

Similar presentations


Presentation on theme: "Chinese Remainder Theorem"— Presentation transcript:

1 Chinese Remainder Theorem
Part 1: Modular arithmetic Part 2: Sun-Tsu’s problem Part 3: Chinese Remainder Theorem Part 4: Some more famous problems Divides Relatively prime Congruent Inverse (multiplicative) Divisor

2 Modular Arithmetic a = b mod n 13 divided by 12 has a remainder of 1
13 is congruent to 1 mod 12 13 = n 13 = 1 mod 12

3 Modular Arithmetic If a = b mod n; then n divides a-b
If a = b mod n and c = d mod n; then (a+c) = (b+d) mod n then (a-c) = (b-d) mod n then ac=bd mod n If p is prime and a ≠ 0 mod p then there exists a b such that ab = 1 mod p

4 Modular Arithmetic Multiplicative Inverses
If p is prime and a ≠ 0 mod p then there exists a b such that ab = 1 mod p What is an inverse? Example: Mod 7

5 Sun-Tsu’s Problem The original form of the theorem was contained in the 3rd-century book Sunzi's Mathematical Classic (孫子 算經) by the Chinese mathematician Sun Tzu. There are certain things whose number is unknown. When divided by 3 the remainder is 2, when divided by 5, the remainder is 3, when divided by 7 the remainder is 2. What is the number of things?

6 Sun-Tsu’s Problem There are certain things whose number is unknown. When divided by 3 the remainder is 2, when divided by 5, the remainder is 3, when divided by 7 the remainder is 2. What is the number of things? x = 2 mod 3 x = 3 mod 5 x = 2 mod 7

7 Chinese Remainder Theorem
Let m1, m2, ..., mk be pairwise relatively prime. Then the system: x= a1 mod m1 x= a2 mod m2 x= ak mod mk Has one unique solution modulo M, where M= m1 x m2 x ... x mk This solution can be found in the form: x = a1M1y1 + a2M2y akMkyk Were Mk = M/mk and Mkyk = 1 mod mk

8 Your turn… I’m thinking of a number…
When divided by 4 the remainder is 3 when divided by 7, the remainder is 2 when divided by 9 the remainder is 1 What is my number?

9 Pirates! A band of 17 pirates stole a sack of gold coins. When they tried to divide the fortune into equal portions, 2 coins remained. In the ensuing brawl over who should get the extra coins, one pirate was killed. The wealth redistributed, but this time an equal division left 10 coins. Again an argument develop, another pirate was killed. But now the total was evenly distributed among the pirates. What was the least number of gold coins that could have been stolen?

10 Eggs  A girl was carrying a basket of eggs, and a man driving a horse hit the basket and broke all the eggs. Wishing to pay for the damage, he asked the girl how many eggs there were. The girl said she did not know, but she remembered that when she counted them by twos, there was one left over; when she counted them by threes, there were two left over; when she counted them by fours, there were three left over; when she counted them by fives, there were four left; and when she counted them by sixes, there were five left over. Finally, when she counted them by sevens, there were none left over. `Well,' said the man, `I can tell you how many you had.' What was his answer?

11 References http://www.math.harvard.edu/~knill/crt/lib/Kangshe ng.pdf
1/The%20History%20of%20the%20Chinese%20Remin der%20Theorem%20(Law%20Huang%20lng).pdf eorem.html


Download ppt "Chinese Remainder Theorem"

Similar presentations


Ads by Google