# Approximating π by throwing darts

 Throws Hits π

We can approximate π using nothing more than random numbers and some simple geometry: we randomly throw darts at a square board of side r; within the square we inscribe a quadrant of a circle of radius r with its centre at (0, 0). We count all of the 'throws'; if a dart lands within the quadrant, we also count a 'hit'.

For a large number of throws, we see that:

$\frac{\mathrm{hits}}{throws}=\frac{\mathrm{area-of-quadrant}}{area-of-square}$

Some half-remembered geometry tells us that:

$\frac{\mathrm{area-of-quadrant}}{\mathrm{area-of-square}}=\frac{{\mathrm{\pi r}}^{2}/4}{{r}^{2}}=\frac{\pi }{4}$

Or:

$\pi =4\left(\frac{\mathrm{area-of-quadrant}}{\mathrm{area-of-square}}\right)=4\left(\frac{\mathrm{hits}}{\mathrm{throws}}\right)$

I first solved this problem as an undergraduate sometime in 1994 as part of a Computational Physics module. Using FORTRAN 77.