1 / 26

Modular Arithmetic

Modular Arithmetic. Lecture 8. Modular Arithmetic. Def : a  b (mod n) iff n|( a - b) iff a mod n = b mod n. Modular Addition. Lemma : If a  c (mod n), and b  d (mod n) then a+b  c+d (mod n). Modular Multiplication.

shen
Download Presentation

Modular Arithmetic

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Modular Arithmetic Lecture 8

  2. Modular Arithmetic Def:a  b (mod n) iff n|(a - b) iff a mod n = b mod n.

  3. Modular Addition Lemma: If a  c (mod n), and b  d (mod n) then a+b  c+d (mod n).

  4. Modular Multiplication Lemma: If a  c (mod n), and b  d (mod n) then ab  cd (mod n).

  5. Exercise 1444 mod 713 =

  6. Exercise 1243 mod 713 =

  7. Application Why is a number written in decimal evenly divisible by 9 if and only if the sum of its digits is a multiple of 9? Hint: 10  1 (mod 9).

  8. Linear Combination vs Common Divisor Greatest common divisor d is a common divisor of a and b if d|a and d|b gcd(a,b) = greatest common divisor of a and b Smallest positive integer linear combination d is an integer linear combination of a and b if d=sa+tb spc(a,b) = smallestpositive integer linear combination of a and b Theorem: gcd(a,b) = spc(a,b)

  9. Linear Combination vs Common Divisor Theorem: gcd(a,b) = spc(a,b) For example, the greatest common divisor of 52 and 44 is 4. And 4 is a linear combination of 52 and 44: 6 · 52 + (−7) · 44 = 4 Furthermore, no linear combination of 52 and 44 is equal to a smaller positive integer. To prove the theorem, we will prove: gcd(a,b) | spc(a,b) gcd(a,b) <= spc(a,b) spc(a,b) is a common divisor of a and b spc(a,b) <= gcd(a,b)

  10. GCD <= SPC

  11. SPC <= GCD We will prove that spc(a,b) is actually a common divisor of a and b.

  12. Linear Combination vs Common Divisor Theorem: gcd(a,b) = spc(a,b) Lemma:p prime and p|a·b implies p|a or p|b. Cor : If p is prime, and p| a1·a2···amthen p|aifor some i.

  13. Linear Combination vs Common Divisor Theorem: gcd(a,b) = spc(a,b) Lemma. If gcd(a,b)=1 and gcd(a,c)=1, then gcd(a,bc)=1.

  14. Fundamental Theorem of Arithmetic Every integer, n>1, has a unique factorization into primes: p0≤ p1 ≤ ··· ≤ pk p0p1 ··· pk = n Example: 61394323221 = 3·3·3·7·11·11·37·37·37·53

  15. Unique Factorization Claim: There is a unique factorization.

  16. Extended GCD Algorithm Example: a = 259, b=70

  17. GCD Algorithm Example: a = 899, b=493

  18. Multiplication Inverse The multiplicative inverse of a number a is another number a’ such that: a · a’ = 1 (mod n) Does every number has a multiplicative inverse in modular arithmetic?

  19. Multiplication Inverse Does every number has a multiplicative inverse in modular arithmetic? Nope…

  20. Multiplication Inverse What is the pattern?

  21. Multiplication Inverse Theorem. If gcd(k,n)=1, then have k’ k·k’  1 (mod n). k’ is an inversemod n of k

  22. Cancellation So  (mod n) a lot like =. main diff: can’t cancel 4·2  1·2 (mod 6) 4  1 (mod 6) No general cancellation Cor: If i·k  j·k (mod n), andgcd(k,n) = 1, then i  j (mod n)

  23. Fermat’s Little Theorem If p is prime & k not a multiple of p, can cancel k. So k, 2k, …, (p-1)k are all different (mod p). So their remainders on division by p are all different (mod p). This means that rem(k, p), rem(2k, p),…,rem((p-1)k, p) must be a permutation of 1, 2, ···, (p-1)

  24. Fermat’s Little Theorem Theorem: If p is prime & k not a multiple of p 1  kp-1 (mod p)

  25. Chinese Remainder Theorem Theorem: If n1,n2,…,nkare relatively prime and a1,a2,…,ak are integers, then x  a1(mod n1) x  a2(mod n2) x  ak(mod nk) have a simultaneous solution x that is unique modulo n, where n = n1n2…nk.

  26. Proof of Chinese Remainder Theorem

More Related