Trials needed to find event probability to degree of accuracy (using Chebychev's Inequality) A question from my class of Random Processes.
Question: How often do you have to toss a coin to determine its probability of heads p within 0.1 of its true value with probability at least 0.9?
My work:
Suppose, $X$ is Random Variable(R.V.) that denotes number heads obtained in n tosses. Thus, binomial R.V.
Suppose $\ \sigma \ \ \& \ \ \mu \ $ are Standard Deviation & Mean of Random Variable $X$
$$\Bbb P(|X-\mu| \leq 0.1) \approx 1 - \Bbb P(|X-\mu| \geq 0.1) $$
Using, Chebychev's Inequality $\ i.e. \ \
\Bbb P(|\frac{X}{n}-\mu| \geq a) \leq \frac{\sigma ^2 (\frac {X}{n})}{a^2}$
$$\Bbb P(|\frac{X}{n}-\mu| \leq 0.1) \geq 1 - \frac{\sigma ^2 (\frac {X}{n})}{(0.1)^2} $$
Thus, $\ 1 - \frac{\sigma ^2}{(0.1)^2} = 0.9 \ $
which gives:
$$\sigma = (0.1)^{\frac {3}{2}}$$
Now, $\sigma (X) = \sqrt{np(1-p)}$ for Binomial Random Variable
Thus, $\sigma ( \frac{X}{n} )= \frac{\sqrt{np(1-p)}}{n} = (0.1)^{\frac {3}{2}}$
If we check Discriminant for Quadratic Equation in p, condition on n is
$$n \leq \frac{1}{4 \sigma ^2} = 250$$
How, to move forward to get a value of n?
 A: Your thoughts on using Chebyshev's Inequality for this question is correct. However, as @Jeff mentioned, if $X$ is the random variable that denotes the number of heads obtained in $n$ tosses, i.e. $X \sim Bin(n, p)$, then you should not use $X$ to compare with the true probability of head ($p$) but rather $X/n$ (think about why this is the case by considering the values $X$ can possibly take). Equivalently, if we let $X_1, X_2, \dots$ denote the outcome of each coin toss, then we would be interested in comparing $\bar{X} = \frac{1}{n}\sum_{i=1}^n X_i$ with the true probability of head ($p$).
If the above explanation is clear, the solution should go as follows.
Let $X_1, X_2, \dots$ denote the outcome of each coin toss, that is, $X_i \overset{i.i.d.}{\sim} Bernoulli(p)$ where $p$ is the true probability of head. Further suppose $\mu$ and $\sigma^2$ are the mean and variance of $\bar{X} = \frac{1}{n}\sum_{i=1}^n X_i$, then we have $\mu = p$ and $\sigma^2 = \frac{p(1-p)}{n}$. Note that
$$\Bbb P(|\bar{X}-\mu| \leq 0.1) = 1 - \Bbb P(|\bar{X}-\mu| > 0.1) \geq 1 - \Bbb P(|\bar{X}-\mu| \geq 0.1).$$
Using Chebychev's Inequality, i.e. $\Bbb P(|\bar{X}-\mu| \geq a) \leq \frac{\sigma ^2}{a^2}$, we have
$$\Bbb P(|\bar{X}-\mu| \leq 0.1) \geq 1 - \Bbb P(|\bar{X}-\mu| \geq 0.1) \geq 1 - \frac{\sigma ^2}{(0.1)^2} \overset{\text{set}}{\geq} 0.9,$$
which gives
$$\frac{\sigma^2}{(0.1)^2} \leq 0.1 \Longleftrightarrow \sigma^2 \leq (0.1)^3.$$
Now, $\sigma^2 = \text{Var}(\bar{X}) = \frac{p(1-p)}{n}$ for $\bar{X} = \frac{1}{n}\sum_{i=1}^n X_i$ where $X_i \overset{i.i.d.}{\sim} Bernoulli(p)$, which implies
$$\sigma^2 = \frac{p(1-p)}{n} \leq (0.1)^3$$
need to hold for all $p \in [0, 1]$. If we check the discriminant for Quadratic Equation in $p$, we have
$$\max_{0\leq p \leq 1} p(1-p) = \frac{1}{4},$$
so that $n$ should satisfy
$$\frac{1}{4n} \leq (0.1)^3 \Longleftrightarrow n \geq \frac{1}{4\times (0.1)^3} = 250,$$
as desired.
