This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani 39 Fermat test (base a = 2 ) Composites Pass Fail 10 9 primes 20 , 000 composites Before primality test: all numbers 25 10 9 After primality test Primes Randomized algorithms: a virtual chapter Surprisinglyalmostparadoxicallysomeofthefastestandmostcleveralgorithmswehave rely on chance : at specified steps they proceed according to the outcomes of random coin tosses. These randomized algorithms are often very simple and elegant, and their output is correct with high probability . This success probability does not depend on the randomness of the input; it only depends on the random choices made by the algorithm itself. Insteadofdevotingaspecialchaptertothistopic,inthisbookweintersperserandomized algorithms at the chapters and sections where they arise most naturally. Furthermore, no specialized knowledge of probability is necessary to follow what is happening. You just need to be familiar with the concept of probability, expected value, the expected number of times we must flip a coin before getting heads, and the property known as linearity of expectation. Here are pointers to the major randomized algorithms in this book: One of the earliest and most dramatic examples of a randomized algorithm is the randomized primality test of Figure 1.8. Hashing is a general randomized data structure that supports inserts, deletes, and lookups and is described later in this chapter, in Section 1.5. Randomized algorithms for sorting and median finding are described in Chapter 2. A randomized algorithm for the mincutproblemis described intheboxon page150. Randomizationplaysanimportantrole in heuristics as well; these are described in Section 9.3. And finally the quantum algorithm for factoring (Section 10.7) works very much like a randomized algorithm, its output being correct with high probabilityexcept that it draws its randomness not from coin tosses, but from the superposition principle in quantum mechanics. Virtual exercises : 1.29, 1.34, 2.24, 9.8, 10.8. 1.4 Cryptography Our next topic, the RivestShamirAdelman (RSA) cryptosystem, uses all the ideas we have introduced in this chapter! It derives very strong guarantees of security by ingeniously ex ploitingthe widegulfbetween the polynomialtimecomputabilityof certain numbertheoretic tasks(modularexponentiation,greatestcommondivisor,primalitytesting)andtheintractabil ity of others (factoring). 40 Algorithms The typical setting for cryptography can be described via a cast of three characters: Alice and Bob, who wish to communicate in private, and Eve, an eavesdropper who will go to great lengths to find out what they are saying. For concreteness, lets say Alice wants to send a specific message x , written in binary (why not), to her friend Bob. She encodes it as e ( x ) , sends it over, and then Bob applies his decryption function d ( ) to decode it: d ( e ( x )) = x . Here e ( ) and d ( ) are appropriate transformations of the messages.are appropriate transformations of the messages....
View
Full
Document
This note was uploaded on 09/06/2009 for the course CS 70 taught by Professor Papadimitrou during the Spring '08 term at University of California, Berkeley.
 Spring '08
 PAPADIMITROU
 Algorithms

Click to edit the document details