Different runs of theLet's suppose that we have a polynomial time randomized algorithm $A$ arefor a decision problem $\Pi$ with the property that $$ \mathrm{Pr}[A \text{ is right}] > 1/2 $$ for all inputs. (In particular, independent of the input length $n$.)
We can use Chernoff bounds to show something stronger, so ifnamely that for any fixed $A$$c$, there is righta polynomial time, randomized algorithm for $\Pi$ that is correct with probability at least $p = 1/2 + \epsilon$, with$1-n^{-c}$.
The algorithm is very simple: On an input of length $\epsilon > 0$$n$, thewe run $A$ a polynomial number of times $N$ (to be determined below) and then report the majority answer. Call this algorithm $A'$.
What we need is a bound on $$ \mathrm{Pr}[A' \text{ is wrong}] $$ in terms of the number of repetitions $N$. The hypothesis about $A$ implies that there is right overan $\epsilon > 0$ such that $$ \mathrm{Pr}[A \text{ is right}] \ge 1/2 + \epsilon $$ Since the $N$ runs hasof $A$ are independent, for any $k\in [N]$ we have $$ \mathrm{Pr}[k \text{ of } N \text{ runs of } A \text{ are right}]\ge Pr[X = k] $$ where $X$ is a binomial distributionrandom variable with parameters $B(N,p)$$N$ and $1/2+\epsilon$. So Since the algorithm $A'$ is wrong exactly when at most $N/2$ of the runs of $A$ are right, we obtain an upper bound on the failure probability by a "tail estimate" bounding $$ \mathrm{Pr}[A \text{ is wrong more than } N/2 \text{ times}]\le \mathrm{Pr}[B(N,p)\le N/2] $$$$ \mathrm{Pr}[X \le N/2] $$ This last probability is the kind of thing that you can analyze witha prototypical time to use a Chernoff bounds. In particularbound, it implies thatsince a polynomial numberbinomial r.v. is the sum of repetitions$N$ independent random variables. One instance of the Chernoff bound says that if $A$$Y$ is sufficient for the majority outcome to be rightsum of $N$ independent r.v.'s with support in $[0,1]$ and $t > 0$, then $$ \mathrm{Pr}[Y < E[Y] - t] \le e^{-2t^2/N} $$ Thus, since $E[X] = N/2 + N\epsilon$, we take $t = N\epsilon$ to obtain $$ \mathrm{Pr}[A' \text{ is wrong}]\le e^{-2\epsilon^2 N} $$ So we can take $N = (1/2)\epsilon^{-2}c\log n$, and we get the claimed error probability for $1-1/n$$A'$.