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:
Some half-remembered geometry tells us that:
I first solved this problem as an undergraduate sometime in 1994 as part of a Computational Physics module. Using FORTRAN 77.