jblog
toc

𝜋 Approximation

2015-12-19, post № 91

mathematics, programming, Python, #approximating, #approximation, #circle, #circle constant, #constant, #Euler, #infinite, #infinite sum, #pi, #sum

Using an infinite series shown by Euler, 𝜋 can be approximated.
The series goes as follows: \sum\limits_{n=1}^{\infty}\frac{1}{n^2}=\frac{1}{1^2}+\frac{1}{2^2}+\frac{1}{3^2}+\frac{1}{4^2}+\dots=\frac{\pi^2}{6}
By rearranging the equation, you get the following: \pi=\sqrt{6\cdot\big(\frac{1}{1^2}+\frac{1}{2^2}+\frac{1}{3^2}+\frac{1}{4^2}+\dots\big)}

pi-approximation.png
Source code: pi-approximation.py