Live data from Hacker News

An Elementary Proof of Wallis’ Product Formula for Pi (2005)

fermatslibrary.com

11–20 of 23 posts

Re: An Elementary Proof of Wallis’ Product Formula for Pi (2005)

#11
post #5

I had never heard of this product formula before, so I whipped up a quick python program: http://pastebin.com/FBR8rWxv All I can say is wow, that formula slow to converge on pi. The product after 100 million terms is: 3.141592637878503 You can see that 100M terms only gets you 8 decimals of precision.

Is there a acceleration ? May be it converge much faster than rest of the method after say a billion precision point ?

Re: An Elementary Proof of Wallis’ Product Formula for Pi (2005)

#13
post #5

I had never heard of this product formula before, so I whipped up a quick python program: http://pastebin.com/FBR8rWxv All I can say is wow, that formula slow to converge on pi. The product after 100 million terms is: 3.141592637878503 You can see that 100M terms only gets you 8 decimals of precision.

maybe I'm missing something (haven't tried to debug it), but that just results in 0.

edit: Oh that's interesting. Python 2 gave me 0, Python 3 worked fine.

Re: An Elementary Proof of Wallis’ Product Formula for Pi (2005)

#14
post #10
post #5

I had never heard of this product formula before, so I whipped up a quick python program: http://pastebin.com/FBR8rWxv All I can say is wow, that formula slow to converge on pi. The product after 100 million terms is: 3.141592637878503 You can see that 100M terms only gets you 8 decimals of precision.

For another famous, but also very slow series converging to pi, try pi/4 = 1 - 1/3 + 1/5 - 1/7 + ...

If anyone's curious, that series comes from the equation Arctan(1)=Pi/4 and the Taylor expansion around zero of Arctan(x) = x - x^3/3 + x^5/5 + ... where x=1.

What makes this expansion particularly painful is that usually Taylor expansion is done around a point where x is small, such that the x^n numerators of subsequent terms get progressively smaller. But in this case the numerator is always 1, so the series depends entirely on the denominator for convergence.

Meanwhile, the denominator doesn't grow by the usual increasing factorial terms common to Taylor series, but grows only linearly. So both effects combined cause this expansion to take a very long time to converge.

Re: An Elementary Proof of Wallis’ Product Formula for Pi (2005)

#15
A classic, and clear, example of "elementary" meaning something different than "trivial" in math, is Atle Selberg's Annals proof of the Prime Number Theorem. A link to notes on this proof, and some (!?) controversy relating to it, here: https://people.math.osu.edu/nevai.1/AT/ERDOS/ErdosSelbergDis...

Re: An Elementary Proof of Wallis’ Product Formula for Pi (2005)

#16
post #13
post #5

I had never heard of this product formula before, so I whipped up a quick python program: http://pastebin.com/FBR8rWxv All I can say is wow, that formula slow to converge on pi. The product after 100 million terms is: 3.141592637878503 You can see that 100M terms only gets you 8 decimals of precision.

maybe I'm missing something (haven't tried to debug it), but that just results in 0. edit: Oh that's interesting. Python 2 gave me 0, Python 3 worked fine.

Probably missing that python 2 defaults to integer division.

Re: An Elementary Proof of Wallis’ Product Formula for Pi (2005)

#17
post #5

I had never heard of this product formula before, so I whipped up a quick python program: http://pastebin.com/FBR8rWxv All I can say is wow, that formula slow to converge on pi. The product after 100 million terms is: 3.141592637878503 You can see that 100M terms only gets you 8 decimals of precision.

If speed of convergence is what you seek, i've yet to discover a more impressive case than a surprisingly simple method attributed to Gauss using the geometric and arithmetic means of two numbers. Three times around the loop and it's already correct to five decimal places: http://pastebin.com/674YJ9VM

You can get faster convergence although not quite as simple.

https://en.wikipedia.org/wiki/Approximations_of_π#Efficient_...

Re: An Elementary Proof of Wallis’ Product Formula for Pi (2005)

#18
post #5

I had never heard of this product formula before, so I whipped up a quick python program: http://pastebin.com/FBR8rWxv All I can say is wow, that formula slow to converge on pi. The product after 100 million terms is: 3.141592637878503 You can see that 100M terms only gets you 8 decimals of precision.

Are slow convergences useful for testing purposes?

What is being tested with 100million function calls?

Re: An Elementary Proof of Wallis’ Product Formula for Pi (2005)

#19
In order to appreciate how phenomenally basic this derivation is: here is a derivation using Euler's infinite product expansion of the sin(x) function.

http://www.jstor.org.sci-hub.cc/stable/10.4169/amer.math.mon...

Then if you want your answer plug in x = π/2 inevitably Wallis formula leads to either Stirling formula or the derivation of ζ(2)=π^2/6.

So for someone to solve it just by drawing some rectangles and finding the area is pretty amazing.

Post reply on HN