# Monte carlo Method to estimate a proportion

I'd like to use Monte Carlo method to estimate a proportion and I'd like to be sure my idea is correct mathematically speaking.

Let a pool full of red and blue balls. I'd like to estimate the proportion of blue balls into the pool.

1. One ball is randomly taken into the pool and its color is noted.
2. The ball is put back into the pool

This process is repeated N times. let p the proportion of blue balls among the N taken balls. I'd like to have a bound on this error.

If I understand correctly, I have

$$|e_n| \leq z_{1-\alpha/2}\frac{\sigma_g}{\sqrt{N}}$$

with probability $1-\alpha$. $z_{1-\alpha}$ is the quantile of the normal distribution.

I also have an estimator of $\sigma_g$ : $p(1-p)* N/(N-1)$

Is this all true ? Have I some hypothesis to make sure ? on the size of N or something else ? Is my estimator correct ? On small values of N, that seems incorrect : If the real proportion is near 1. And N is small, we can have an estimator of sigma_g = 0, then whatever is the alpha, the error is zero.

Thanks

• Your confidence interval is based on the central limit theorem, an asymptotic theorem, so obviously you have no guarantee that it is correct in finite time. You can use Hoeffding's bound or Chernoff's bound if you want results that are true for all $n$. As for the question: "is my estimator correct?", what do you mean by a "correct estimator"? – Adrien Jan 8 '14 at 15:02
• Thanks for your answer. Concerning the estimator, I just wanted to be sure that my formula for $\sigma$ is correct. Using Hoeffding's or Chernoff's bound, what would be the bound for the error $|e_N|$ ? – pebz Jan 8 '14 at 15:24
• While it is possible to do this with Monte Carlo, it would be much better to do a Bayesian hypothesis test. – oliversm Aug 13 at 10:02