Hacker News new | ask | show | jobs
by mturmon 4099 days ago
This post has an opportunity to find the error bars on its estimate of π. The estimate came out as 3.14616.

The number of in-the-circle counts is S ~ binomial(N,p) where N=1e5 and p=π/4, which we'll take to be 0.75. Then

  var(S) = p(1-p)N ≤ N/4
and the standard deviation of S is the square root of this, or about ∆=137.

(If we weren't willing to use a guess for p in the variance above, we could use the universal bound of N/4.)

The estimate of π is (S/N) * 4, so the sdev on the estimate of π is (∆/N)*4 = 0.0055.

So the estimate turned out to be a little less than one standard deviation higher than π. Which is satisfying.

--

The point being that, for just a little extra work, you get not only a Monte Carlo estimate, but also a bound on its error. Sometimes the bound is just as important as the estimate.