DOC PREVIEW
Duke CPS 102 - Lecture 16

This preview shows page 1-2-23-24 out of 24 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Randomness and Computation: Some Prime ExamplesEarth has huge file X that she transferred to Moon. Moon gets Y.Slide 3Their estimatesSlide 5The Prime Density TheoremSlide 7Slide 8Slide 9Slide 10Really useful factPicking A Random PrimeSlide 13Slide 14Slide 15Moral of the storySlide 17Are X and Y the same n-bit numbers?Why is this any good?Slide 20Almost there…Slide 22Slide 23Exponentially smaller error probabilityGreat Theoretical Ideas In Computer ScienceCOMPSCI 102 Fall 2009Lecture 16 October 19, 2009 Duke UniversityRandomness and Computation: Some Prime ExamplesEarth has huge file X that she transferred to Moon. Moon gets Y.Earth: XEarth: X Moon: YDid you get that file ok? Was Did you get that file ok? Was the transmission accurate?the transmission accurate?Uh, yeah.GaussLet (n) be the number of primes between 1 and n. I wonder how fast (n) grows? Conjecture [1790s]: ( )lim 1/ lnnnn np��=LegendreTheir estimatesx pi(x) Gauss' Li Legendre x/((lnx )- 1)1000 168 178 172 16910000 1229 1246 1231 1218100000 9592 9630 9588 95121000000 78498 78628 78534 7803010000000 664579 664918 665138 661459100000000 5761455 5762209 5769341 57403041000000000 50847534 50849235 50917519 5070154210000000000455052511455055614 455743004 454011971J-S HadamardTwo independent proofs of the Prime Density Theorem [1896]:( )lim 1/ lnnnn np��=De la Vallée PoussinThe Prime Density TheoremThis theorem remains one of the celebrated achievements of number theory. In fact, an even sharper conjecture remains one of the great open problems of mathematics!RiemannThe Riemann Hypothesis [1859] ( ) / lnlim 0nn n nnp��-=Slightly easier to show (n)/n ≥ 1/(2 log n).Random (log n)-bit number is a random number from 1..n(n) / n ≥ 1/2log nmeans that a random (log n)-bit number has at least a 1/2log n chance of being prime.Random k-bit number is a random number from 1..2k(2k) / 2k ≥ 1/2kmeans that a random k-bit number has at least a 1/2k chance of being prime.Really useful factA random k-bit number has at least a 1/2k chance of being prime.So if we pick So if we pick 2k random k-bit 2k random k-bit numbersnumbers the expected number of primes on the expected number of primes on the list is the list is at least 1at least 1Picking A Random PrimeMany modern cryptosystems (e.g., RSA) include the instructions:“Pick a random n-bit prime.”How can this be done efficiently?Picking A Random Prime“Pick a random n-bit prime.”Strategy:1) Generate random n-bit numbers2) Test each one for primality [more on this later in the lecture]Picking A Random Prime“Pick a random n-bit prime.”1)Generate kn random n-bit numbersEach trial has a ≥ 1/2n chance of being prime.Pr[ all kn trials yield composites ]≤ (1-1/2n)kn = (1-1/2n)2n * k/2 ≤ 1/ek/2Picking A Random Prime“Pick a random n-bit prime.”Strategy:1) Generate random n-bit numbers2) Test each one for primality For 1000-bit primes, if we try out 10000 random1000-bit numbers, chance of failing ≤ e-5Moral of the storyPicking a random prime is “almost as easy as”picking a random number.(Provided we can check for primality.More on this later.)Earth has huge file X that she transferred to Moon. Moon gets Y.Earth: XEarth: X Moon: YDid you get that file ok? Was Did you get that file ok? Was the transmission accurate?the transmission accurate?Uh, yeah.Are X and Y the same n-bit numbers?p = random (2 log n)-bit primeSend (p, X mod p)Answer to “X Answer to “X  Y mod p ?” Y mod p ?”Earth: XEarth: X Moon: YWhy is this any good?Easy case:If X = Y, then X  Y (mod p)Why is this any good?Harder case:What if X ≠ Y? Mess up if p | (X-Y), i.e., X  Y (mod p)Define Z = (X-Y). To mess up, p must divide Z.Z is an n-bit number. Z is at most 2n.But each prime ≥ 2.Hence Z has at most n prime divisors.Almost there…Z has at most n prime divisors.How many (2log n)-bit primes? at least 22logn/(2*2 log n) = n2/(4 log n) >> 2n primes.Only (at most) half of them divide Z.Make mistake with probability at most ½.A random k-bit number has at least a 1/2k chance of being prime.Theorem: Let X and Y be distinctn-bit numbers. Let p be a random (2 log n)-bit prime.ThenProb [X = Y mod p] < 1/2Earth-Moon protocol makes mistakewith probability at most 1/2!Are X and Y the same n-bit numbers?EARTH: XEARTH: XMOON: YMOON: YPick k random (2 log n)-bit primes: P1, P2, .., PkSend (X mod Pi) for 1 ≤ i ≤ kk answers to “X = Y mod Pi ?”Exponentially smaller error probabilityIf X=Y, always accept.If X  Y,Prob [X = Y mod Pi for all i] ≤


View Full Document

Duke CPS 102 - Lecture 16

Documents in this Course
Lecture

Lecture

34 pages

Lecture

Lecture

42 pages

Lecture

Lecture

46 pages

Lecture

Lecture

77 pages

Notes

Notes

17 pages

Notes

Notes

52 pages

Lecture 9

Lecture 9

72 pages

Lecture

Lecture

7 pages

Lecture

Lecture

11 pages

Lecture

Lecture

28 pages

Lecture

Lecture

25 pages

Forbes

Forbes

9 pages

Lecture

Lecture

53 pages

Lecture

Lecture

21 pages

Lecture 4

Lecture 4

54 pages

Lecture

Lecture

24 pages

Lecture

Lecture

46 pages

Lecture

Lecture

16 pages

Lecture

Lecture

7 pages

Lecture

Lecture

46 pages

Graphs II

Graphs II

34 pages

Lecture

Lecture

81 pages

Lecture

Lecture

46 pages

Load more
Download Lecture 16
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 16 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 16 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?