Suppose that we can obtain independent samples $X_{1}, X_{2}, \ldots$ of a random variable $X$ and that we want to use these samples to estimate $\mathbf{E}[X]$. Using $t$ samples, we use $\left(\sum_{i=1}^{t} X_{i}\right) / t$ for our estimate of $\mathbf{E}[X]$. We want the estimate to be within $\varepsilon \mathbf{E}[X]$ from the true value of $\mathbf{E}[X]$ with probability at least $1-\delta$. We may not be able to use Chernoff's bound directly to bound how good our estimate is if $X$ is not a 0-1 random variable, and we do not know its moment generating function. We develop an alternative approach that requires only having a bound on the variance of $X$. Let $r=\sqrt{\operatorname{Var}[X]} / \mathbf{E}[X]$.
(a) Show using Chebyshev's inequality that $O\left(r^{2} / \varepsilon^{2} \delta\right)$ samples are sufficient to solve the problem.
(b) Suppose that we need only a weak estimate that is within $\varepsilon \mathbf{E}[X]$ of $\mathbf{E}[X]$ with probability at least $3 / 4$. Argue that $O\left(r^{2} / \varepsilon^{2}\right)$ samples are enough for this weak estimate.
(c) Show that, by taking the median of $O(\log (1 / \delta))$ weak estimates, we can obtain an estimate within $\varepsilon \mathbf{E}[X]$ of $\mathbf{E}[X]$ with probability at least $1-\delta$. Conclude that we need only $O\left(\left(r^{2} \log (1 / \delta)\right) / \varepsilon^{2}\right)$ samples.