1 / 10

Announcements: Homework 2 due now Quiz this Friday on concepts from chapter 2

DTTF/NB479: Dszquphsbqiz Day 10. Announcements: Homework 2 due now Quiz this Friday on concepts from chapter 2 Practical quiz next week on breaking codes from chapter 2 Questions? Today: Congruences Chinese Remainder Theorem Modular Exponents. How to find x and y?.

Télécharger la présentation

Announcements: Homework 2 due now Quiz this Friday on concepts from chapter 2

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. DTTF/NB479: Dszquphsbqiz Day 10 • Announcements: • Homework 2 due now • Quiz this Friday on concepts from chapter 2 • Practical quiz next week on breaking codes from chapter 2 • Questions? • Today: • Congruences • Chinese Remainder Theorem • Modular Exponents

  2. How to find x and y? x and y swapped from book, which assumes that a < b on p. 69 Assume a > b Let qi and ri be the series of quotients and remainders, respectively, found along the way. a = q1b + r1 b = q2r1 + r2 r1 = q3r2 + r3 ... ri-2 = qiri-1 + ri rk-2 = qkrk-1 + rk rk-1 = qk+1rk To find x, take x0 = 1, x1 = 0, xj = xj-2 – qj-1xj-1 To find y, take y0 = 0, y1 = 1, yj = yj-2 – qj-1yj-1 Use to calculate xk and yk (the desired result) Example: gcd(5862,1856)=2 Yields x = -101, y = 319 Check: 5862(-101) + 1856(319) = 2?

  3. Congruence Properties • Properties

  4. Solving Congruences • Solve. Check with a partner.

  5. Solving ax=b(mod n) when gcd(a,n)~=1 Example: 10x=4(mod 10) Other examples: • Let gcd(a,n)=d • If d doesn’t divide b then no solution • Else divide everything by d and solve(a/d)x=(b/d)(mod (n/d)) • Get solution x0 • Multiple solutions:x0, x0+n/d,x0+2n/d,…x0+(d-1)n/d • This is an easy program to code once you have Euclid…

  6. Can we write x = 16 (mod 35) as a system of congruences?

  7. Chinese Remainder Theorem • Equivalence between a single congruence mod a composite number and a system of congruences mod its factors • Two-factor form • Given gcd(m,n)=1. For integers a and b, there exists exactly 1 solution (mod mn) to the system:

  8. Chinese Remainder Theorem • Solve: • How many solutions? • Find them.

  9. Chinese Remainder Theorem • n-factor form • Let m1, m2,… mk be integers such that gcd(mi, mj )=1 when i ~= j. For integers a1, … ak, there exists exactly 1 solution (mod m1m2…mk) to the system:

  10. Modular Exponentiation • Compute last digit of 3^2000 • Compute 3^2000 (mod 152) • Technique: • Repeatedly square 3, but take mod at each step. • Matlab’s powermod()

More Related