diff --git a/pages/CSE347/Exam_reviews/CSE347_E2.md b/pages/CSE347/Exam_reviews/CSE347_E2.md index e444a62..95be0c2 100644 --- a/pages/CSE347/Exam_reviews/CSE347_E2.md +++ b/pages/CSE347/Exam_reviews/CSE347_E2.md @@ -114,11 +114,16 @@ $$ - Assume we run the algorithm $k$ times, and the probability of success is $\frac{1}{2} + \epsilon$. - The probability that all trials fail is at most $(1-\epsilon)^k$. - The majority vote of $k$ runs is wrong is the same as probability that more than $\frac{k}{2}+1$ trials fail. -- So, the probability is - $$\begin{aligned} - Pr[\text{majority fails}] &=\sum_{i=\frac{k}{2}+1}^{k}\binom{k}{i}(\frac{1}{2}-\epsilon)^i(\frac{1}{2}+\epsilon)^{k-i}\\ - &= \binom{k}{\frac{k}{2}+1}(\frac{1}{2}-\epsilon)^{\frac{k}{2}+1} - \end{aligned}$$ +- So, the probability is + +$$ +\begin{aligned} +Pr[\text{majority fails}] &=\sum_{i=\frac{k}{2}+1}^{k}\binom{k}{i}(\frac{1}{2}-\epsilon)^i(\frac{1}{2}+\epsilon)^{k-i}\\ +&= \binom{k}{\frac{k}{2}+1}(\frac{1}{2}-\epsilon)^{\frac{k}{2}+1} +\end{aligned} +$$ + + - If we want this probability to be at most $p$, we can just solve for $k$ in the inequality make it less than some $\delta$. Then we solve for $k$ in the inequality $\binom{k}{\frac{k}{2}+1}(\frac{1}{2}-\epsilon)^{\frac{k}{2}+1} \leq \delta$. ## Online Algorithms