How is Pi calculated?

621 views

Ok, pi is probably a bit over the head of your average 5 year old. I know the definition of pi is circumference / diameter, but is that really how we get all the digits of pi? We just get a circle, measure it and calculate? Or is there some other formula or something that we use to calculate the however many known digits of pi there are?

In: 716

28 Answers

Anonymous 0 Comments

[deleted]

Anonymous 0 Comments

[removed]

Anonymous 0 Comments

You take a circle and draw a square in it so that the four corners of the square are on the circle. The diagonal through the square is the diameter of the circle. The perimeter of the square is a (very bad) approximation of the circumference. Knowing the diagonal of the square, you can calculate the sides of the square, and therefore the perimeter. Perimeter / Diameter = a (very bad) approximation of pi.

Now do it with a pentagon. The perimeter of a pentagon is a better approximation of the circumference, therefore you get a better approximation of pi.

Now a hexagon

Now a heptagon

Now a octagon

Now a nonagon

etc. etc.

The more sides you have, the closer you get to actual pi.

Anonymous 0 Comments

[removed]

Anonymous 0 Comments

Draw a circle. Now draw a box around that circle with a width the same diameter as the circle. Then draw a box inside that circle, with the corners on the circle. Since we know that pi = circumference divided by diameter, you now know that pi must lie between the lengths of the inner and outer circle, each divided by the circle diameter. You can do that with a 5-sided figure for a more accurate range of values, then a 6-sided figure, and so on. The more sides the polygons have, the closer you are to approximating the circumference of that circle, and hence finding the value of pi. When you get to a polygon with 696 sides, you have a value of 3.1416, which isn’t bad.

There are more complicated algorithms to calculate pi, but that’s the simplest way I know to explain it.

Anonymous 0 Comments

I feel like the refs can throw the flag on any close play they want really. But usually if a DB turns their head it will help their case for a no-call.

Anonymous 0 Comments

> I know the definition of pi is circumference / diameter, but is that really how we get all the digits of pi?

That’s the historical definition, and that’s probably how people got the approximate value of pi (slightly more than 3) thousands of years ago.

At that time, they didn’t care about the digits (they didn’t even invent decimal writing), so they often used the approximation 22/7 which was discovered to be a rather good approximation by Archimedes. (more precisely he proved that 223/71 < pi < 22/7 using a geometrical approximation of a circle by polygons)

But no we don’t use real circles to measure pi since a very very long time.

> We just get a circle, measure it and calculate?

Fun fact, if we had a perfect circle the size of the observable universe, and we were able to measure its circumference and diameter up to the atomic scale, we would only get 40 digits of the decimal expansion.

So obviously, that would not work, even with the best available equipement.

> Or is there some other formula or something that we use to calculate the however many known digits of pi there are?

Yes, there are formulas. Some formulas are easier than other. For example, a very simple formula that will get you as close to pi as you want is the following :

pi = 4 * (1- 1/3 + 1/5 – 1/7 + 1/9 – 1/11 + 1/13 + … + 1/(2n+1) + … )

Each term you add will gte you closer to pi. The problem is that this formula gets closer to pi very very slowly (You need 200 terms to get an approximation that is only as good as 22/7) .The proof of this formula is not that hard (accessible to any undergrad) but perhaps not at the ELI5 level.

Fortunately for us, we have other formulas, that are more complicated to understand, but that will get you as close to pi as you want much quicker. For example :

pi = 2 * (1 + 1/3 + (2*3)/(3*5) + (2*3*4)/(3*5*7)+ …) that will get you 10 correct digits after 30 terms

And many other formulas far more effective, but that are really ugly.

EDIT : I changed the . into * to avoid confusions.

Anonymous 0 Comments

People posted some methods, but none of them are actually used to calculate pi today. Instead, we use formulas for pi that _converge_ very _fast_, meaning that we need to do relatively little to get many digits. One of the best methods is [Chudnovsky’s algorithm](https://en.wikipedia.org/wiki/Chudnovsky_algorithm). Take a look at this monstrous looking formula… yet it allows us to calculate a hundred trillion digits of pi!

Anonymous 0 Comments

While not strictly speaking a calculation, I think the monte carlo method is kind of cute.

Take a square with sides equal to 2. Inscribe a circle inside such that it touches all four sides. The circle will have a radius of 1 (it has a diameter of 2).

The square will have an area of 2^2 = 4

The circle will have an area of pi*r^2 = pi * (1^2) = pi

The ratio of the circle’s area to the square’s area is just pi / 4.

This means that if we picked a random point inside the square, the chance of it being inside the circle is pi/4.

Algorithm:

1) Set InsideCircle counter to 0

2) Set InsideSquare counter to 0

3) Repeat the following many times. The greater the number of repetitions the better your approximation will be (assuming you’re truly picking random numbers):

a) Pick a random point inside the square. You do this by picking two random values from -1 to 1. One value is the point’s x position, and the other is it’s y position. We are making the origin (0,0) the center of both our square and circle to make the maths easier.

b) Since this value is inside the square, increment the InsideSquare counter by 1.

c) Calculate the distance of this point from the origin. If it is less than 1 then it inside the circle (the circle had a radius of 1 and is located at the origin). d = sqrt(x^2 + y^2) where x and y are the two values we picked in step a.

d) If d < 1 then increment InsideCircle counter by 1

e) Calculate approximation of pi. As mentioned earlier, the ratio of inside circle to inside square is pi/4, so pi is 4 times this value. In other words: pi ~= 4 * (InsideCircle / InsideSquare)

We’ve just estimated pi by picking a whole bunch of random numbers.

Anonymous 0 Comments

Modern calculations are done with very boring equations that computers can do very quickly.

Because pi shows up in so many places involving circles, there’s actually many ways to approximate it’s value. Matt Parker is a comedian/mathematician who famously does a video every year where he finds a new outrageous way of calculating pi. My favorite is by throwing darts