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,if  clausei is true0,otherwisey_i = \begin{cases} 1, & if \; clause_i \text{ is true} \\ 0, & otherwise \end{cases}

#clauses = mm

Each clause has kk literals

E[i=1myi]=i=1mE[yi]linearity of expectation=i=1mPr[yi==1]see note=i=1m[1(12)k]=m×[1(12)k]\begin{aligned} E[\sum_{i=1}^m{y_i}] & = \sum_{i=1}^m{E[y_i]} \quad \text{linearity of expectation} \\ & = \sum_{i=1}^m{Pr[y_i==1]} \quad \text{see note} \\ & = \sum_{i=1}^m{[1 - (\frac{1}{2})^k]} \\ & = m \times [1 - (\frac{1}{2})^k] \end{aligned}

Note: Since yi={0,1}y_i = \{0, 1\}, E[yi]=yiPr[yi]=1Pr[yi==1]E[y_i] = y_i * Pr[y_i] = 1 * Pr[y_i==1].

Last updated