{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lec_sept_26

# lec_sept_26 - CS 2800 Discrete Math Sept 26 2011 Lecture...

This preview shows pages 1–3. Sign up to view the full content.

CS 2800: Discrete Math Sept. 26, 2011 Lecture Lecturer: John Hopcroft Scribe: June Andrews Review See previous lecture notes for the Fundamental Theorem of Arithmetic, Euler’s φ function, and Euler’s Theorem. The cool part of Euler’s Theorem was that we got 2 very useful corollaries from it: Fermat’s Little Theorem and a test of primality. And a small note, the exam will only cover today’s lecture and previous lectures. Module Tricks We present yet another corollary from Euler’s Theorem (useful theorem!). Corollary 1. If gcd ( a, n ) = 1 , then a x a x mod φ ( n ) mod n . This may seem a bit of a surprise. How did we get the mod φ ( n ) in the exponent? Let us remember our mod tricks and look at the proof. Proof. We need two tools to prove the corollary: 1. Euler’s theorem: if gcd ( a, n ) = 1, then a φ ( n ) 1 mod n 2. The module of a product is the product of the modules: z 1 y 1 mod n z 2 y 2 mod n z 1 z 2 y 1 y 2 mod n. So if x = ( x mod φ ( n )) + ( n ), then a x a x mod φ ( n ) a ( n ) mod n a x mod φ ( n ) mod n a ( n ) mod n mod n by product of modules a x mod φ ( n ) mod n (1 mod n ) mod n by Euler’s Theorem a x mod φ ( n ) mod n Done! Now how does this help us? Example 2. Let’s say we wanted to calculate 2 999 mod 21 . It would be nice if we could avoid calculating 2 999 . To use the previous corollary, we need to check a = 2 and n = 21 are relatively prime, gcd ( a, n ) = gcd (2 , 21) = 1 . So we can! 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
We now calculate φ (21) . Instead of linearly determining(see definitions) φ (21) , remember that 21 = 3 * 7 and that φ ( pq ) = ( p - 1)( q - 1) . Hence, φ (21) = 12 . Putting it altogether: 2 999 2 999 mod 12 mod 21 2 3 mod 21 8 mod 21 That’s how the corollary helps - it allows us to reduce the exponent dramatically. Even using that trick, it may not reduce the exponent to a particularly small number. We may be faced with an irreducible mod calculation of 2 100 . We still don’t want to have to multiply 2(2(2(2( . . . )))). But we can re-examine the order with which we multiply, like 2 8 = 2 4 * 2 4 . So if we already had 2 4 , we could just square it to get 2 8 . In an inductive manner of thought, the same logic can be applied to 2 4 = 2 2 * 2 2 .
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern