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.

SettingRangeStarts at
Points thrown at each step1 to 2,00050

More in Monte Carlo methods