How Do Computers Calculate The Digits Of Pi?

Computers calculate the value of Pi up to trillions of digits by making use of infinite series formulas that have been developed by mathematicians.

The movie ‘Life of Pi’ was released in 2012. Back then, there was a scene in the film that puzzled me every time. It’s the part where Piscine Patel tries and succeeds, to establish the short form of his name to ‘Pi’. I remember thinking every time I saw it, “So he wrote hundreds of digits of , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC on the board, that’s easy. You just keep dividing 22 by 7 in your head. I could have done that!”

But as I grew older, I realized how wrong I was. He wasn’t just dividing 22 by 7 in his head. He had memorized the value of , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC up to hundreds of digits (see, now that is impressive). 22/7 is simply an approximation for , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC, and will only give an accurate value till two decimal places (, How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC  = 3.14159265……. whereas, 22/7 = 3.1428571……).

How do we calculate the value of Pi?

Let’s say you have a circle (if not, just construct one). Measure its diameter using a scale and its circumference using a string. Now, if you divide the value of circumference by the diameter, you will probably get the quotient as 3.1415… (approx.). You will also observe that the division is never-ending. This is a value called Pi (, How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC). If we represent this mathematically,

Circumference of circle = 2 , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC r

Diameter of circle = 2 r

So, Circumference/Diameter = (2 , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC r) / (2 r) = , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC

circle with labels for radius, diameter and circumference(Morphart Creation)s

Circumference and diameter of circle (Photo Credit : Morphart Creation/Shutterstock)

The method of measurements used above is how Babylonians and Greeks discovered it thousands of years ago. Since then, many approximations have been made about the value of this number.

However, even today, when we have calculated about 2.7 trillion digits of , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC, we are nowhere close to the precise value. A number of books use the fraction 22/7 as the value of , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC, yet even that is simply an approximation (in fact, 22/7 is closer to the actual value of , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC than 3.14 is).

Why Don’t We Have the Precise Value of Pi?

The truth is, we don’t know the precise value of , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC because it is an irrational number.

An irrational number is a number that can not be represented in the form of a fraction. The digits after the decimal are never-ending and non- recurring, i.e., they don’t appear in a particular sequence. That is also the reason why 22/7 is only an approximation for , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC and not its real value.

Pythagoras mathematical numbers seriessymbol(Mark Rademaker)S

Digits of Pi are never-ending (Photo Credit : Mark Rademaker/Shutterstock)

Now, if we don’t even know all the digits of , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC, how are computers able to calculate them for us? After all, computers are programmed by humans themselves, right?

The answer to that is yes, computers are programmed by humans. But we need to understand exactly how computers work, in order to figure out this answer.

How Do Computers Work?

Computers basically work on algorithms. A computer is simply a machine. And a machine doesn’t make decisions on its own as we do. It works according to a set of instructions or steps that we feed into it. And it follows these sets of instructions until we tell it to stop. Of course, it wouldn’t be able to stop on its own, since it does not have the ability to make that decision.

Also, remember that , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC is a number with infinite decimal places. This means that if we are to calculate the value of , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC using a computer, it will have to follow a set of instructions an infinite number of times, since the digits of , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC go on forever.

So, this means, if somehow, we are able to figure out this set of instructions that generate the precise value of , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC if it is computed an infinite number of times, then the computer can do the entire calculation by itself. And it will keep calculating until we give the instruction to stop.

What is the Algorithm For Our Calculation?

In our case, this set of operations is called an infinite series. An infinite series is an infinite sequence of values that follow a particular rule throughout.

For example, we have the series-

1/2, 1/4, 1/8…….

Each term here is multiplied by half of the previous term.

If we add them,

, How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC

This is termed as an infinite series. It can be written in short using the symbol ‘sigma’: –

, How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC

In this case, the addition of all terms S amounts to 1. In case you are confused as to how it can be 1, here is an illustration of the proof:

Unit fractions drawn as portions of a square. One divided by the first six powers of two(Peter Hermes Furian)S

Proof for sum of series (Photo Credit : Peter Hermes Furian/Shutterstock)

Now, if we are able to find an infinite series such that the value of ‘S’ in the above equation equals pi, we will have found an algorithm to generate the value of pi. After that, all we would need to do is feed this algorithm into the computer.

There are numerous series today that are used to generate the value of pi. One of the most well- known and simplest series to calculate , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC is the Gregory- Leibniz Series :

, How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC

With this series, you will be able to calculate , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC/4 exactly. Then if you multiply that by 4, you will have the value of , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC. The only problem with this series is that it is not very efficient. You will have to add a lot of terms if you wish to get an accurate value (Around 300 terms in order to compute till 2 decimal places). That is a lot of time- consuming work, even for a computer.

Another series that is more efficient than the one given above is Nilakantha Series:-

, How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC

These are only some of the simplest of formulas that can be used to calculate , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC. There are other, more efficient, series developed by mathematicians that can be used to calculate this value using computers- like the algorithm of Brent and Salamin.

Imagine an extremely efficient infinite series and a super-fast computer. That’s how the value of , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC has been calculated to trillions of digits today. The world record for calculating the most number of digits of , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC is held by Timothy Mullican. He computed 50 trillion digits of , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC on his personal computer (as of 30th January 2020).

We have certainly made plenty of progress, from calculating this value by hand to using super- slow computers in the 1950s (which were, actually, the most efficient computers of the time), to this day, where computers can calculate , How Do Computers Calculate The Digits Of Pi?, Science ABC, Science ABC in mere seconds.

References:

  1. UMass Boston
  2. Exploratorium
  3. University of Toronto
The short URL of the present article is: http://sciabc.us/XqIQv
Help us make this article better
Science ABC YouTube Videos

  1. Are Zebras Black with White Stripes or White with Black Stripes?Are Zebras Black with White Stripes or White with Black Stripes?
  2. What Are Asteroids And Where Do They Come From?What Are Asteroids And Where Do They Come From?
  3. Why Do We Find Babies Cute?Why Do We Find Babies Cute?
  4. How Hurricanes Form? Why Hurricanes Spin AntiClockwise in North and Clockwise in Southern HemisphereHow Hurricanes Form? Why Hurricanes Spin AntiClockwise in North and Clockwise in Southern Hemisphere
  5. Why Is It Called "Dead" Sea? Why Does Everyone Float In This Sea?Why Is It Called "Dead" Sea? Why Does Everyone Float In This Sea?
  6. How to live without a heart or a brain - Lessons from a JellyfishHow to live without a heart or a brain - Lessons from a Jellyfish
  7. How Do Sunflowers Face The Sun?How Do Sunflowers Face The Sun?
  8. Do bones decompose? How long does it take for bones to decompose?Do bones decompose? How long does it take for bones to decompose?

Tags: