Suppose that we have an algorithm A that estimates the mean E[Y] of a random variable Y within some specified range r with probability ρ>21. We can derive a new algorithm A∗ from A that boosts the successful probability to 1−δ, as follows:
Repeat A for m=2(ρ−0.5)21lnδ1 times.
Take the median of the m outputs.
To prove it, define the indicator random variable
Xi={1, if the i-th output of A is within the range r0,otherwise
for 1≤i≤m. Then E[Xi]=ρ>0.5.
Let μ=E[∑i=1mXi]=mρ.
By Hoeffding's inequality, for λ>0,
Pr[i=1∑mXi−μ≥λ]≤exp(−m2λ2)
Replacing λ with μ−0.5m, and m with m=2(ρ−0.5)21lnδ1, we get