### Another Piece of Pi

July 28, 2010 Last week we celebrated "Pi Approximation Day," July 22, or 22/7 when written in a day/month format. This fraction is a close approximation to the value of pi, a fact discovered by Archimedes. Archimedes estimated the value of pi using polygons inscribed in, and circumscribed around, a circle. It's a simple matter to get the perimeters of the polygons and ratio them to the radius of the circle to get π ≈ P/(2R), where P is the perimeter and R is the radius of the circle. As shown in the figure, it's possible to find the length of one side of any circumscribed polygon by using the tangent function. Archimedes didn't have trig tables, or a calculator with trig functions, so his analysis was limited to particular triangles, but the idea is the same. Archimedes obtained his estimate of 22/7 for pi using a circumscribed 96-sided polygon. This is the value of pi I learned in elementary school, and it's great for homework problems at that age level, when only integer arithmetic is known. Ptolomey decided to best Archimedes with a 360-sided polygon, from which he obtained 3,141666..., a value that's correct to three decimal places.*Circumscribed polygon*

Computer techniques have now allowed a calculation of pi to 2,699,999,990,000 decimal digits[1]. Our present estimate of the diameter of the universe is 93 billion light-years (8.8 x 10

^{26}meters), so we only need twenty-seven digits of pi to calculate the circumference of the universe to better than a meter, and thirty-eight digits to get a value of the circumference closer than the size of an atom. In a previous article (Buffon's Needle, July 19, 2010), I showed a physical method, devised by Georges-Louis Leclerc, Comte de Buffon, for obtaining a value of pi by dropping needles on floor boards and counting the fraction of needles that crossed the cracks between boards. Today, I'll present a different method to estimate pi that depends also on randomness. I was reminded of this method while reading an article[2] by David Patterson, a well known computer scientist, in this month's IEEE Spectrum. Patterson was addressing the question of how useful multi-core processors really are, and he gave some examples of problems that can be solved by parallel programming methods, including estimation of pi

"You could, for instance, determine the value of pi. Just compute what happens when you throw darts at a square board. If the darts hit random points on the square, what fraction of them fall within the largest circle you can draw on the board? Calculate that number for enough darts and you'll know the area of the circle. Dividing by the radius squared then gives you a value for pi."I remember this same simulation involving the casting of millet seed onto a circle inscribed in a square. This was possibly in deference to Zeno, who had a thing with millet seeds, but the idea is the same (see figure).

*Casting millet seed*

This is a Monte Carlo method[3], and it's quite easy to program. You can review my C code, here. As you remember, our Buffon's needle calculation made us 95% confident that the value of pi lay between 3.126605 and 3.156433. The millet seeds do a little better. For the same number of trials (10,000), and the same number of actions (100,000), we calculate a mean value of 3.141548 with a standard deviation 0f 0.005213. This means that we're 95% confident that the value of pi lies between 3.131122 and 3.151974, which is somewhat better.

*Histogram of pi estimates using the Monte Carlo method*

### References:

- Digits of pi on Wikipedia.
- David Patterson, "The Trouble With Multicore," IEEE Spectrum (July, 2010)
- For the history of the computational Monte Carlo method, see my previous article, Nicholas Metropolis, June 11, 2010.

*Permanent Link to this article*

RSS Feed

### Google Search

Latest Books by Dev Gualtieri

**Previews Availableat Tikalon Press**

*STEM-themed novel for middle-school students*

*Mathematics-themed novel for middle-school students*

*Complete texts of LGM, Mother Wode, and The Alchemists of Mars*

Other Books

- A.I., Wine, and Beer, June 10, 2024

- Bergmann's rule, June 3, 2024

- 60 Hertz Standard, May 27, 2024

- Droplets, May 20, 2024

- Levitation, May 13, 2024

- 100 Years of IBM, May 6, 2024

- Cicada Apocalypse, April 29, 2024

- Critical Materials, April 22, 2024

- Eclipse 2024, April 15, 2024

- Reverse Sprinkler, April 8, 2024

- T Coronae Borealis, April 1, 2024

- Coffee and Tea, March 25, 2024

- Arno Penzias (1933-2024), March 18, 2024

- Wave-Particle Duality, March 11, 2024

- Offshore Wind, March 4, 2024

- High Entropy Ceramics, February 26, 2024

- Methane Emissions, February 19, 2024

- Thales, Heron, and Experimental Mathematics, February 12, 2024

- Mica, February 5, 2024

- Disk Packing, January 29, 2024

- Is e
^{π}> π^{e}?, January 22, 2024

- Brownian Motion Energy Harvesting, January 15, 2024

- Coin Flip, January 8, 2024

- Holidays 2023, December 18, 2023

- Fast Radio Bursts, December 11, 2023

- Adhesives, December 4, 2023

- MOND and Planet Nine, November 27, 2023

- Earthquake Light, November 20, 2023

- Antimatter Gravitation, November 13, 2023

- Koch Snowflake, November 6, 2023

### Deep Archive

Deep Archive 2006-2008

**Blog Article Directory on a Single Page**