The best approximation of pi!

I did some quick research and discovered that the Chudnovsky algorithm is the fastest and most accurate way for calculating Pi. But does anyone know how it works?

2 Likes

The explanation of why the Chudnovsky series converges to pi is quite involved:
it involves Generalized Geometric Series, Ramanujan Series, J-invariants, Fourier Series, Elliptic functions, Modular Groups … and a whole lot more advanced math concepts.
Some aspects were only understood very recently (2012).
If you want to start understanding the ideas behind these types of series you may start with Fourier Series and Generalized Geometric Series.

1 Like

I’ll pass. :sweat_smile: Haha. Maybe I will start smaller and then get somewhere.

2 Likes

What if you try making the hexadecimal Pi spigot (the one that gives you one digit in base 16, independent from others)?

1 Like

Sorry for the late response @Cubic_Sune but what’s a spigot? Also why would I choose hex over other bases, say binary? Is there an advantage to it? More memory efficient…?

A spigot function spits out one digit of a number at a time, without needing to know other digits. Essentially, it lets you ask “what is the nth digit of this number?”
For example, the decimal 5 spigot would be {n=0:5,0}.

The hexadecimal pi spigot works great, and the binary one could be constructed from it, but as far as I can tell, it’s difficult to make one for decimal, so I just chose the hexadecimal one. You could, obviously, make it in other bases, though.

Edit: fixed typo

Here’s the famous BBP algorithm for base 16 digits of pi:
https://www.desmos.com/calculator/z7luqnagyx

pi in base 16 = 3.2,4,3,15,6,10,8,8 …

For example D(50) = 4, this means that the 50th digit of pi in base 16 is 4.

there is not any known formula that gives you directly the n-th digit of pi in base 10.

1 Like