lecture11 - CS 70 Spring 2005 1 Primality Discrete...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 70 Discrete Mathematics for CS Spring 2005 Clancy/Wagner Notes 11 1 Primality We are studying the complexity of two very fundamental, and intimately related, computational problems: PRIMALITY Given an integer x , is it a prime? FACTORING Given an integer x , what are its prime factors? Obviously, PRIMALITY cannot be harder than FACTORING, since, if we knew how to factor, we would definitely know how to test for primality. What is surprising and fundamental —and the basis of modern cryptography— is that PRIMALITY is easy while FACTORING is hard! As we know, PRIMALITY can be trivially solved in O ( x ) time —in fact, we need only test factors up to x . But, of course, these are both exponential algorithms —exponential in the number n of bits of x , which is the more accurate and meaningful measure of the size of the problem (seen this way, the running times of the algorithms become O ( 2 n ) and O ( 2 n / 2 ) , respectively). In fact, pursuing this line (testing fewer and fewer factors) will get us nowhere: Since FACTORING is hard, our only hope for finding a fast PRIMALITY algorithm is to look for an algorithm that decides whether n is prime without discovering a factor of n in case the answer is “no.” We describe such an algorithm next. This algorithm is based on the following fact about exponentiation modulo a prime: Theorem 11.1 : (Fermat’s Little Theorem.) If p is prime, then for all a 6 = 0 mod p we have a p - 1 = 1 mod p. Proof
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

lecture11 - CS 70 Spring 2005 1 Primality Discrete...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online