Pi is defined as the ratio between the circumference of a circle and the diameter of a circle. The problem is that this number is known to be what’s called an irrational number, which is a number that cannot be described as a fraction of two integers. More simply, it has an infinite, non-repeating pattern of numbers after the decimal point. For practical everyday use, we use 3.14 or 22/7 as approximations, but that’s all they are: approximations.
There are a number of infinite sums that converge to some multiple of pi, so it’s a question of finding one that converges quickly and having a really powerful computer.
Every Pi Day (March 14), [Matt Parker](https://youtube.com/@standupmaths) does a YouTube video where he uses one such method in a silly and labor-intensive way to get a couple of decimal places if he’s lucky
[Here’s a wiki page](https://en.wikipedia.org/wiki/Chronology_of_computation_of_%CF%80) that you might find interesting: what people have calculated pi to be since about 2000 BCE. 22/7 is actually an approximation that has been in use since Archimedes’ time, and was a world record for accuracy for a while.
But as to your question, the method varies. One of the reasons more accurate calculations of pi are found is because of better calculators (hurray for electric computers), but a bigger reason has been more efficient formulas are found. So to fully answer your question is less ELI5 and more history lesson, which is why I linked the first wiki page.
As a partial answer, first they knew what pi is: the ratio of a circle’s circumference to its diameter. Then they’d use that in combination with other definitions they knew to narrow things down, such as the perimeter of a square will always be bigger than a circle that fits inside it. [Archimedes’ specific example used with a 96 sided shape to get the 22/7 approximation](https://en.wikipedia.org/wiki/Proof_that_22/7_exceeds_%CF%80).
Modern day maths will use polynomials and series, things used often in calculus and thus beyond this answer, but the concept is the same. Starting from the definition of pi, get a formula with a certain answer that will get close to it. And then calculate that formula using as big a number as you can get (like Archimedes’ 96 sided shape being as big a number of sides as he could get).
A very old method makes use of the definition of pi: the ratio between the circumference of a circle and it’s diameter. You can use a polygon with many sides as an approximation of a circle. The more sides it has, the closer to pi you get.
For example, using a hexagon (6 sides) gives you a value of 3. 12 sides give about 3.11.
Nowadays, there are faster methods, but with those, it is not as obvious as to why they work.
> I always thought pi is 22/7
Then you misremembered (or had bad teachers). I clearly remember I think in 4th grade that we were taught to use 22/7 as an approximation.
Pi is simply how many times the diameter wraps around the circumference of the circle.
You can get a decent amount of decimals by doing a physical experiment with string and whatnot, but to get past a handful of decimals you’d need to do math.
There are several techniques. The most simple to understand mathematically is probably calculating perimeters of inscribed and circumscribed polygons of a unit circle.
The perimeter of a unit circle is 2(pi). You can get the formula for a side of a regular polygon easy enough, and calculate the perimeters of the inscribed and circumscribed polygons. Start with a square and double the number of sides for each successive calculation, and the upper bound and lower bound quickly converge to 2(pi).
I have once wrote a program to calculate pi.
You get tons of random points from (0-1)x(0-1) range. They form a square. You calculate how many of these points are inside circle of center 0,5×0,5 and radius 0,5.
Total points quantity divided by quantity of points inside circle will be an approximation of square area divided by circle area. From this data, we can calculate pi. After enough iterations, we can get pretty nice precision.
Latest Answers