Scanning for π

August 27, 2013

In a previous episode, we looked at how we could use random sampling to get a good estimate of \pi, and found that we couldn’t, really, unless using zillions of samples. The imprecision of the estimated had nothing to do with the “machine precision”, the precision at which the machine represents numbers. The method essentially counted (using size_t, a 64-bits unsigned integer—at least on my box) the number of (random) points inside the circle versus the total number of points drawn.


Can we increase the precision of the estimate by using a better method? Maybe something like numerical integration?

Read the rest of this entry »