The current record for number of digits of pi calculated is roughly thirty trillion
digits, which is surely deliberate because it is roughly pi times 10^13 digits. Better
still, this record was created on pi day. For the curious, all the records broken
in the previous decade all used the Chudnovsky algorithm, based on this monstrous formula.
We will not talk about how to derive this formula, because to understand it fully, it
requires a year’s worth of videos. Instead, we will explore a much simpler, but only slightly
less computationally efficient class of algorithms known as Machin-like formulas, and the
simplest of which only relies on this pretty easily understood formula. Using a more
complicated algorithm similar to this, a record trillion digits of pi was calculated
back in 2002, and we are going to see how this type of algorithm works.
The main mathematical concept behind this family of algorithm is just some basic complex
numbers manipulation. It is actually possible to use geometry to prove this simple formula,
but in general, this kind of diagram will get extremely complicated to draw for just
slightly more complicated formulas. So we still opt for the algebraic method for much
easier generalisation. If you have not learnt complex numbers, head over to Welch
labs for an amazing introduction. But here is a quick refresher on the basics of complex
numbers.
Complex numbers can be written in two forms, the rectangular form, as well as the polar
form. For the sake of simplicity, we use a bracket with a and b inside to denote this
complex number in rectangular form, and a square bracket to denote the complex number
in polar form. This is a formula that converts between the rectangular and polar forms. There
are definitely concerns over the range of the inverse tangent function, but for the
purpose of this video, it will be okay to leave it like that. For multiplication
of complex numbers, in rectangular form, it is rather messy, while in polar form,
multiplication is pretty easy. And these two very basic things you know about complex
numbers would be enough for the discussion afterwards.
We now consider the product of these two complex numbers. We use this product formula for
the rectangular form here, and get the product to be 5 + 5i. However, we can also
use the change of form formula, plug all these numbers in, and then we get the equivalent
expression written in polar form. Now compare with the product formula in polar form, we
can see that these two numbers should add up to pi over 4, which is one formula of
pi that we saw a minute ago. Basically, by expressing the same thing in two different
ways, namely rectangular, and polar forms, we see something new.
Of course, this is only the simplest such example, because by considering other similar
special products, we obtain similar forms of identity, and the list here is not exhaustive.
In particular, this boxed expression was discovered by Machin, so this entire family
of formulas is known as Machin-like formulas. But why are these useful in computing pi?
These formulas are coupled with this series expansion of inverse tangent function for
computation of pi. For this series to make sense, the absolute value of x has to be sufficiently
small, but in all those formulas, the argument of the inverse tangent function is smaller
than 1, so we are good. In fact, the numbers inside the inverse tangent function should
be as small as possible, because each term in the series will get smaller faster. This
is why this formula discovered by Machin is computationally more efficient, as these
numbers inside the inverse tangent function is much smaller. Now of course, we can
make the formulas more complicated, in hopes that some of these terms will be very
small. But there is always kind of tradeoff, because more terms mean less computationally
efficient, and smaller terms mean more efficient for an algorithm. So we need
to balance these two factors when it comes to choosing an algorithm. This formula
strikes a balance between these two factors, and it was one of the formulas used to create
the record 1.2411 trillion digits of pi calculated.
For the sake of completeness, here is a very short proof for the inverse tangent series,
using very elementary calculus. [Music]
So you have seen how pi can be calculated to trillions of digits, but the bigger
question is why. Does it have any practical purposes? Well yes, but not in the way
that you might have imagined. 200 digits of pi already give you subatomic accuracy
even when you calculate the volume of the observable universe, so using it on Earth
is a massive overkill. The main purpose is actually testing supercomputers, and current
technology in general. And the most recent record was broken using cloud, the first time
in the history of pi computation.
There are actually a lot of things to explore around this topic that I am surprised not
more math channels talk about it. I get much more interested in this topic during my research
for this video, and I will put links in the description as some pointers for you to learn
more.
If you enjoyed this video, give it a like and share this video. Don’t forget to subscribe
to the channel with notifications on. See you next time!