Beyond the syllabus · Monte Carlo methods
Finding π by throwing darts
Throw points at a square at random and count how many land inside the quarter circle. The fraction is the ratio of the two areas, π/4. The answer is rough at first and sharpens slowly: a hundred times as many points for one more digit.
or open it full screen →
Free, in your browser, nothing to install. Topic: Monte Carlo integration.
The textbook's answers
At the starting settings. As it runs, the simulation measures each of these and shows its value beside the textbook's.
| π | 3.142 |
|---|
What you can change
Every slider changes the physics, not just the picture: the engine works it all out again.
| Setting | Range | Starts at |
|---|---|---|
| Points thrown at each step | 1 to 2,000 | 50 |