randomized and de-randomized algorithms jeff kinne, indiana state university slides online at...
TRANSCRIPT
![Page 1: Randomized and De-Randomized Algorithms Jeff Kinne, Indiana State University Slides online at kinnejeff.comkinnejeff.com](https://reader030.vdocument.in/reader030/viewer/2022032607/56649ec15503460f94bcc674/html5/thumbnails/1.jpg)
Randomized and De-Randomized
Algorithms
Jeff Kinne, Indiana State University
Slides online at kinnejeff.com
![Page 2: Randomized and De-Randomized Algorithms Jeff Kinne, Indiana State University Slides online at kinnejeff.comkinnejeff.com](https://reader030.vdocument.in/reader030/viewer/2022032607/56649ec15503460f94bcc674/html5/thumbnails/2.jpg)
The Plan…• Randomized Algorithms – examples
• How to “de-randomize” a randomized algorithm
![Page 3: Randomized and De-Randomized Algorithms Jeff Kinne, Indiana State University Slides online at kinnejeff.comkinnejeff.com](https://reader030.vdocument.in/reader030/viewer/2022032607/56649ec15503460f94bcc674/html5/thumbnails/3.jpg)
Research • Versus industry/internship…
o Lower pay (probably)o Less applied
o But
o You choose what to work on (mostly)o More cutting-edge, forward-lookingo Give presentations, meet peopleo Write a paper, tell others about your results
![Page 4: Randomized and De-Randomized Algorithms Jeff Kinne, Indiana State University Slides online at kinnejeff.comkinnejeff.com](https://reader030.vdocument.in/reader030/viewer/2022032607/56649ec15503460f94bcc674/html5/thumbnails/4.jpg)
Randomized Algorithms
![Page 5: Randomized and De-Randomized Algorithms Jeff Kinne, Indiana State University Slides online at kinnejeff.comkinnejeff.com](https://reader030.vdocument.in/reader030/viewer/2022032607/56649ec15503460f94bcc674/html5/thumbnails/5.jpg)
Median Finding• Unsorted list of #’s
6, 10, 0, 2, 3, 77, 55, 32
• Find median: 6
• Sorting – n log(n) running time
• Randomized – quickselect, O(n) running time
![Page 6: Randomized and De-Randomized Algorithms Jeff Kinne, Indiana State University Slides online at kinnejeff.comkinnejeff.com](https://reader030.vdocument.in/reader030/viewer/2022032607/56649ec15503460f94bcc674/html5/thumbnails/6.jpg)
Shortest Path• Breadth-first search
Depth-first searchDijkstra’s algorithm...o Running time – goodo Memory space – bad!
• “Drunkard’s walk”o Connectivity on undirected graphso Memory space – good!o Running time – not as goodo “De-randomized” – Reingold
![Page 7: Randomized and De-Randomized Algorithms Jeff Kinne, Indiana State University Slides online at kinnejeff.comkinnejeff.com](https://reader030.vdocument.in/reader030/viewer/2022032607/56649ec15503460f94bcc674/html5/thumbnails/7.jpg)
Is ___ Prime?• Is 2 a factor? Is 3? … Is ?
• Fermat test o Pick a at randomo If n not prime.o Not always correct – Carmichael numbers
• Miller-Rabin – always correct with high probability
• Application – RSA cryptography needs large primes
![Page 8: Randomized and De-Randomized Algorithms Jeff Kinne, Indiana State University Slides online at kinnejeff.comkinnejeff.com](https://reader030.vdocument.in/reader030/viewer/2022032607/56649ec15503460f94bcc674/html5/thumbnails/8.jpg)
Is ___ Prime?• Miller-Rabin test
o try a = 2, 3, …, o Generalized Riemann Hypothesis always correct
• AKS testo Always correct!
• Can do better?
![Page 9: Randomized and De-Randomized Algorithms Jeff Kinne, Indiana State University Slides online at kinnejeff.comkinnejeff.com](https://reader030.vdocument.in/reader030/viewer/2022032607/56649ec15503460f94bcc674/html5/thumbnails/9.jpg)
• * Up to ___ digits – for # operations • RSA requires – about 300 or 600 digit
primes
Is ___ Prime?Time Up to ___
digits *Notes
Trial Division 18
Best Factoring
100 – 200
Fermat 10,000 mistakes
Miller-Rabin (if GRH)
10,00050
randomizedconditional
AKS 10
![Page 10: Randomized and De-Randomized Algorithms Jeff Kinne, Indiana State University Slides online at kinnejeff.comkinnejeff.com](https://reader030.vdocument.in/reader030/viewer/2022032607/56649ec15503460f94bcc674/html5/thumbnails/10.jpg)
General-PurposeDerandomization
![Page 11: Randomized and De-Randomized Algorithms Jeff Kinne, Indiana State University Slides online at kinnejeff.comkinnejeff.com](https://reader030.vdocument.in/reader030/viewer/2022032607/56649ec15503460f94bcc674/html5/thumbnails/11.jpg)
Randomized Algorithm• Fermat test
o n prime test correcto n composite, not Carmichael correct for ½ of all a’s
• Randomized Alg Ao For any input n
• Derandomizeo Evaluate A(n, a) for all possible ao Running time: time(A) #a
![Page 12: Randomized and De-Randomized Algorithms Jeff Kinne, Indiana State University Slides online at kinnejeff.comkinnejeff.com](https://reader030.vdocument.in/reader030/viewer/2022032607/56649ec15503460f94bcc674/html5/thumbnails/12.jpg)
Pseudorandom Bits
Replace random a by “pseudorandom” a
a
n
![Page 13: Randomized and De-Randomized Algorithms Jeff Kinne, Indiana State University Slides online at kinnejeff.comkinnejeff.com](https://reader030.vdocument.in/reader030/viewer/2022032607/56649ec15503460f94bcc674/html5/thumbnails/13.jpg)
Pseudorandom Bits
• Try A(n, PRG(s)) for all seeds to PRGo Running time: (time(A) + time(PRG))
n
a
s
![Page 14: Randomized and De-Randomized Algorithms Jeff Kinne, Indiana State University Slides online at kinnejeff.comkinnejeff.com](https://reader030.vdocument.in/reader030/viewer/2022032607/56649ec15503460f94bcc674/html5/thumbnails/14.jpg)
PRGsGenerators
Uses Security Speed
LCG, LSFR scientificsimulations
statistical tests very fast
BBS, RSA cryptography any poly-time test slower
NW, SU Derandomization
any fixed-poly-time test
slower
LCGRSA
![Page 15: Randomized and De-Randomized Algorithms Jeff Kinne, Indiana State University Slides online at kinnejeff.comkinnejeff.com](https://reader030.vdocument.in/reader030/viewer/2022032607/56649ec15503460f94bcc674/html5/thumbnails/15.jpg)
PRG Derandomization• “Major Important” Result …
o Plausible assumptions PRG’s of exponential “stretch”
o remove randomness with polynomial slowdown (aka BPP = P)
o E.g., time might become
• What is best possible from this approach?o Perhaps… getting a quadratic slowdown…
perhaps…
![Page 16: Randomized and De-Randomized Algorithms Jeff Kinne, Indiana State University Slides online at kinnejeff.comkinnejeff.com](https://reader030.vdocument.in/reader030/viewer/2022032607/56649ec15503460f94bcc674/html5/thumbnails/16.jpg)
Questions/Goals• Actually implement “theoretical” PRGs, what is
best possible running time?
• For particular problem (e.g., primality) – best possible derandomization?
• New PRGs that are both very fast and secure, for particular kinds of randomized algorithms?
![Page 17: Randomized and De-Randomized Algorithms Jeff Kinne, Indiana State University Slides online at kinnejeff.comkinnejeff.com](https://reader030.vdocument.in/reader030/viewer/2022032607/56649ec15503460f94bcc674/html5/thumbnails/17.jpg)
Other Projects…• Distributed factoring, Mersenne prime search
• Computational complexityo Many things…o P vs NPo Lower bounds for … matrix permanento …
• Brain trauma AI
• …