Experimentally determining the probability of a binomial experiment

54 Views Asked by At

I have a binomial experiment $X$ with probability $p$, and I want to experimentally determine $p$ to within an error $\epsilon$ by averaging the result of $X$ over multiple runs. Is the following a valid way to determine how many times to run $X$?

Let $X_n = X + X + ... + X$ ($n$ times) and $Y_n = \frac{1}{n}X_n$. The mean and std. dev. of $Y_n$ are:

$$ \mu Y_n = \mu (\frac{1}{n}X_n) = \frac{1}{n} \mu X_n = \frac{1}{n} (n\cdot \mu X) = \mu X $$ $$ \sigma^2 Y_n = \sigma^2( \frac{1}{n}X_n ) = \frac{1}{n^2} \sigma^2(X_n) = \frac{1}{n^2} \cdot n p(1-p) = \frac{1}{n}p(1-p) $$

If we choose $n$ large enough so that $3\sigma(Y_n) \le \epsilon$ there will be a 99.7% chance that the average of the runs will be within $\epsilon$ of $p$. Using $p(1-p) \le 1/4$ yields the inequality:

$$ \frac{9}{4\epsilon^2} \le n $$

Besides whether or not this is correct reasoning, I'd also like to know what the standard methodology is in this case. For instance, once you have determined a value for $n$, do you just sample $Y_n$ once or is there value in sampling $Y_n$ multiple times (as opposed to just using a larger value of $n$)?