I once mentioned in an old and long forgotten thread that Pi could be calculated using random numbers, and I've finally got around to coding something to try it out

Basically, you generate pairs of random x & y coordinates then use Pythagorus to see if the coordinate falls inside or outside a circle (I actually got it wrong in the earlier thread - it's the number of points that fall inside the circle divided by the total number of iterations, and not the number that fall outside the circle, as I'd said earlier. To simply things I just used a quarter circle so I could just use values 0 < n < 1 and then multiplied the result by 4)

Anyway, after four runs of 10,000,000 iterations I got these results:

3.14275271428

3.14078311408

3.14159111416

3.14055391406

which gives a mean average of 3.141420214145.

Pretty poor results for the number of iterations, I think