It’s a Pi day!*
It is possible to calculate using nothing more elaborate than a dart board (and a couple of darts). Throwing darts at the circular target drawn on the board, we can take note how many hits did in fact fall within the circle, and how many hit the bounding box of the circle.
Since the area of the circle inscribed inside a square is of that of the square, we can easily calculate based on the number of hits and misses:
Of course, this is a game invented for mathematicians, who can boast -among other things - of true randomness in their dart game. Being random is surprisingly hard for regular humans.
I made a little interactive gadget to simulate calculating using the dart board: https://rawgit.com/dagothar/pi-throw/master/index.html
You can now try your hand at the game. Simply click on the board to place the dart. You can make the computer throw the dart for you by clicking on Step. You can also launch a whole series using Start/Stop.
The method does not converge very quickly, and is prone to being slightly wrong about . You can help it to get the right result by placing the darts as it goes.
No comments:
Post a Comment