π (pi) is the ratio between a circle’s circumference and it’s diameter. You can check this by using a tape measure. Measure around a circle. Then measure across the circle.
π = Around / Across
Did you know there is a way to calculate π? There are a lot of different ways, but one is called the Leibniz formula for π.
Where the original Leibniz formula for π ends up calculating π/4, I’ve just factored this 4 into the infinite series.
π = 4/1 – 4/3 + 4/5 – 4/7 + 4/9 – 4/11 + 4/13 – 4/15 + 4/17 – … (forever)
The more terms you add/subtract to it, the closer it gets to being accurate. A problem with the Leibniz formula for π is that it takes a lot of calculations to get an accurate version of pi.
Here is a mini-program I wrote in Python 3 to repeat this one million times.
pi = 0
for n in range(1000000):
pi += ((-1)**n*4) / (2*n+1)
Here are some of the numbers from that calculation:
…999980 more times…
Here is real PI:
Isn’t it interesting that my version of PI, after a million iterations, is 1 digit off of real Pi, but the digit is in the middle? This has something to do with Euler numbers which you can read about at http://en.wikipedia.org/wiki/Euler_number .
For most practical purposes, 3.14159 is more than enough digits to use with Pi.
Ever wonder if you could use Pie to calculate Pi?