Dots

.

Dots In
Circle

.

pi Approximation Computer Simulation - Digital Sampling

Current x

.

Current x coordinate of dot
Current y

.

Current y coordinate of dot
x2 + y2

.

(dot radius)2 = x2 + y2
Inside Circle?

.

(dot radius)2 < 12 ?
Official pi

.

Textbook value of pi
Estimated pi

.

(Dots In Circle) / Dots x 4
Error

    .

(Official pi) - (Estimated pi)
Error Percent

    .

Error / (Official pi) x 100

Home

Size of sampling grid

     


Numerical approximation of pi using digital sampling.

Similar to the first pi approximation, only instead of random x and y coordinates, a regular grid of coordinates is used.

The larger the number of dots, the finer the grid (something like the pixel resolution of a digital camera), and the more accurate the approximation.

Compare with the Monte Carlo Method.

  • For a given number of tries, which method gives a more accurate result?
  • Does this change depending on the number of tries?
  • Which method is more practical to use, if a large number of computers (with greatly varying speeds) are to be coordinated to together estimate the value of pi?