- #1
Eclair_de_XII
- 1,083
- 91
- TL;DR Summary
- It was derived by inscribing half a semi-circle within a square of side-length one, and estimating the arc length by using hypotenuses of triangles whose side lengths depend on the length of one of the previous hypotenuses recursively, then multiplying the hypotenuse by a certain power of two.
The recurrence relation was given as:
##p_k=2^{k+1}\cdot h_k##
where
##h_0^2=2##
##h_{k+1}^2=(\frac{1}{2}h_k)^2+(1-\frac{1}{2}h_k \cdot \cot(2^{-k}\cdot \alpha))^2##
and ##\alpha=\arctan(1)##.
This is not exactly an original or noteworthy derivation, is it? I feel that it's been done already two-thousand years ago, and I even found a web-page showing nearly exactly the same thing I am describing right now.
https://www.craig-wood.com/nick/articles/pi-archimedes/
Oh, and I did write some code that confirmed the validity of this recursion.
##p_k=2^{k+1}\cdot h_k##
where
##h_0^2=2##
##h_{k+1}^2=(\frac{1}{2}h_k)^2+(1-\frac{1}{2}h_k \cdot \cot(2^{-k}\cdot \alpha))^2##
and ##\alpha=\arctan(1)##.
This is not exactly an original or noteworthy derivation, is it? I feel that it's been done already two-thousand years ago, and I even found a web-page showing nearly exactly the same thing I am describing right now.
https://www.craig-wood.com/nick/articles/pi-archimedes/
Oh, and I did write some code that confirmed the validity of this recursion.
Python:
import math
def hypotenuse_sequence(n):
"""This function calculates the length of the hypotenuse of any given right triangle after the n-th recursion.
Input: integer
Output: positive number
"""
if n==0:
return math.sqrt(2)
angle = math.atan(1)
x = hypotenuse_sequence(n - 1) / 2
y = 1 - x/math.tan(2 ** (-(n - 1)) * angle)
return math.sqrt(x**2+y**2)
def est_pi_8th(n):
"""This function returns an actual estimate of pi using the hypotenuse_sequence function.
Input: integer
Output: estimate of pi
"""
return hypotenuse_sequence(n)*2**(n+1)