Let $P$ be a YES-NO decision problem. Let $A$ be an algorithm for deciding on it such that it is correct with probability $4/5$, in both cases (YES an NO). Design an algorithm that is correct with probability at least $p$, in both cases (YES an NO).
This is my solution but I'm stuck at bounding the probability. Let be $B$ be an algorithm that runs $A$, $n$ number of times. Let $X_i$ with $1\leq i \leq n$ such that $X_i = 1$ if $A$ outputs $YES$ and, $X_i = 0$ if $A$ outputs $NO$. Without loss of generality assume that $P=YES$ then $\Pr[\text{B is correct}] = \Pr[\text{B = YES}] = \Pr[X \geq \frac{n}{2}]$. I know that in this case $E[X] = \frac{4}{5}n$, but don't know what else to do.