QuasiMonteCarlo (PiEstimator) example

QuasiMonteCarlo (PiEstimator) is a program that estimates the value of Pi using the quasi-Monte Carlo method. The method generates random points in a unit square and counts the number of points that lie inside an inscribed circle of the square. The probability of a point to land in the circle is proportional to the relative areas of the circle and the square. The more points that are generated, the more accurate the approximation is.

For this example, assume that numTotal = numInside + numOutside. The fraction numInside/numTotal is a rational approximation of the value:

(Area of the circle)/(Area of the square)

where the area of the inscribed circle is Pi/4 and the area of the unit square is 1. Then, Pi is estimated to be 4 (numInside/numTotal).

The following sections describe the map and reduce functions, including input and output, and provides the commands needed to run this example.