Randomized Algorithms
Intro
Want to solve NPC problems in P? Well we can! (with a small margin of error)
Applications
Google Maps (travelling salesman), etc
Example
Randomized Algorithm for 3-SAT
Let yi={1,0,ifclausei is trueotherwise
#clauses = m
Each clause has k literals
E[∑i=1myi]=∑i=1mE[yi]linearity of expectation=∑i=1mPr[yi==1]see note=∑i=1m[1−(21)k]=m×[1−(21)k]
Note: Since yi={0,1}, E[yi]=yi∗Pr[yi]=1∗Pr[yi==1].