## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

No credit card required

# Hack #60. Estimate Pi by Chance

Statisticians like to think that anything important can be discovered using statistics. That might actually be true, since it turns out that you can use statistics to estimate the value of one of the most important basic values in science: pi.

The ability to calculate pi is one of the routine skills for all budding geniuses. I remember, for example, that dividing 22 by 7 comes pretty close. There are a variety of other ways, some more accurate than others. My favorite method, though, requires the element of chance and a long, lonely sea voyage or other period of enforced solitude. Intrigued? Read on, Gilligan.

Before showing how to estimate the value of pi, I'll begin our discussion by presenting a couple of basic facts from geometry. Don't panic; I don't know much about geometry, so we won't spend a lot of time on this. I'll just cover the basics we need to appreciate the magic of this hack.

## Pi

In geometry, key relationships have been found between pi, a number that is roughly 3.14159 (symbolized by π) and the way various parts of a circle fit together, as shown in Figure 5-6.

For example, if you take the diameter of a circle and multiply it by pi, you will get the circumference of the circle. If you take the radius of a circle, square it, and multiply that value by pi, you will get the circle's area.

All pretty cool, perhaps, ...

## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

No credit card required