Problem solved in full
-
Judging whether 3.122 is a bad run from 2000 points 5 steps
Is 3.122 a bad run? The default state draws N = 2000 points from seed 42, and 1561 of them land inside the quarter circle. Work out what an ordinary count would have been before judging the estimate.
-
Each point is one trial that succeeds if it falls in the quarter disc, and because the enclosing square has area 1, the success probability is that area outright. Over 2000 independent trials the count is binomial, and a binomial's mean is the trial count times the probability.
-
The same two numbers fix the spread. The observed count is under ten short of expectation, which is barely half a standard deviation, so this seed is an ordinary one โ worth establishing before anything gets blamed on it.
-
The estimate is the count multiplied by a fixed constant, so its standard deviation is the count's multiplied by that same constant. This is where the familiar 1/โN enters: the count's spread grows like โN while the division is by N.
-
The printed error has to come out at the same 0.53 standard deviations, because multiplying by a constant cannot move a value relative to its own spread. It is one fact in two units, not two facts.
-
Now the part no seed can fix. Four times an integer over 2000 is always a multiple of 0.002, and ฯ is irrational, so it is never one of them โ the error cannot reach zero, and the closest the estimator can physically land is one step off the grid.
Answer
The tool prints 1561 points inside, an estimate of 3.122000, and an error of 1.959 ร 10โปยฒ against 3.141593. A typical error at N = 2000 is 0.0367, so this run is better than average rather than worse, and roughly three seeds in five would do worse than 42 did. The floor from step 5 is 4.073 ร 10โปโด: no seed at this N can beat it, because nothing the formula can output lies closer to ฯ than that. It is 90 times smaller than the typical error, so the grid is nowhere near the limiting factor, and the gap widens with N rather than closing โ the floor falls like 1/N while the random error falls only like 1/โN. That also settles a claim you will meet about this method: six correct decimals from a couple of thousand trials is not a lucky run but an arithmetically unreachable one, since at N = 2000 nothing the estimator can produce is even correct to the fourth decimal place.
-
References (1)
- Lazzarini's 3,408 tosses and why 355/113 gave him away: L. Badger, "Lazzarini's Lucky Approximation of ฯ." Mathematics Magazine 67(2), 83โ91, 1994.