From 0515e9167ea3f9a586ec9e10ed37772c5d90cf2d Mon Sep 17 00:00:00 2001 From: Trance-0 <60459821+Trance-0@users.noreply.github.com> Date: Tue, 3 Dec 2024 13:54:15 -0600 Subject: [PATCH] Update CSE347_E2.md --- pages/CSE347/Exam_reviews/CSE347_E2.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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