58

There's been some oohing and ahhing in the science press recently over the discovery of a new formula for $\pi$ obtained as a side effect of computing amplitudes in string theory: $$\pi=4+\sum_{n=1}^\infty \frac1{n!}\left(\frac1{n+\lambda}-\frac4{2n+1}\right)\left(\frac{(2n+1)^2}{4(n+\lambda)}-n\right)_{n-1}$$

Here $(a)_b$ is the usual Pochammer symbol ($(a)_b=a(a+1)(a+2)\ldots(a+b-1)$) and $\lambda$ is a free parameter; in the large-$\lambda$ limit this becomes the classic Madhava-Leibniz formula $\pi=4\sum\frac{(-1)^n}{2n+1}$. The last term here is $\left(\frac{4(n-\lambda)+1}{4(n+\lambda)}\right)_{n-1}$; if I'm looking at it right then for large $n$ this is essentially the product of a term fairly close to $1$, a term of size roughly $\frac{2\lambda}{n+\lambda}$ (more specifically, $\frac{4(n-\lambda)-4(n+\lambda)+1}{4(n+\lambda)}$ $=\frac{1-8\lambda}{4(n+\lambda)}$), and then a set of terms coming to roughly $(n-3)!$. This would seem to suggest that the terms in the sum go as $\Theta(n^{-5})$ as $n\to\infty$: a factor of $\Theta(n^{-1})$ from the term in the first set of parentheses, a factor of $\Theta(n^{-1})$ from the $\approx\frac{2\lambda}{n+\lambda}$ term, and then a factor of $\Theta(n^{-3})$ from the $\frac{\approx(n-3)!}{n!}$ piece. That would suggest that this series converges quickly but not nearly so quickly as the various series with terms of order $c^{-n}$ that give a number of digits linearly proportional to the number of terms.

My questions are then basically: (1) Is my analysis roughly correct here, do I have the right order on terms? and (2) if not (or if so, I suppose) is this in fact a practical or competitive way to compute $\pi$? As a sort of secondary question, this formula bears at least a passing resemblance to the sort of term one might get by applying the Euler transformation to a different alternating series; is it possible that this is a transform of a known series?

Alex Ravsky
  • 106,166
  • 8
    +1 to the question but I’m not sure why the article says this series for $\pi$ will essentially make some calculations in physics easier, and “make it easier to derive $\pi$”. Could someone explain this? Or is it just popsci oversimplification misconstruing the main point – FShrike Jun 26 '24 at 06:43
  • 8
    It’s been a while since I did serious analysis, but I struggle to see how this series could hope to beat any of the “efficient formulas” on Wikipedia (since their convergence is geometric) – and even if it did, we already know digits of $\pi$ immensely beyond any kind of practical purpose. For what it’s worth, although he might be biased about it, Peter Woit (https://www.math.columbia.edu/~woit/wordpress/) is rather dismissive about the formula’s usefulness and even harsher on the news reports. – Aphelli Jun 26 '24 at 09:30
  • 3
    I do not know if this could help to find digits of $\pi$ but the convergence is quite impressive (at least to me). – Claude Leibovici Jun 26 '24 at 11:27
  • 2
    Pochhammer, not Pochammer. – no comment Jun 26 '24 at 12:42
  • 1
    Woit's comments at https://www.math.columbia.edu/~woit/wordpress/?p=14001 (providing a more permanent link in case people come across this later) – Michael Lugo Jun 26 '24 at 13:28
  • 8
    Also, those trained as combinatorialists (like me) may interpret $(a)_b$ as a "falling power", that is, $(a)_b = a(a-1)(a-2) \ldots (a-b+1)$. Of course we should keep the original notation but I want to point this out to clear up any confusion. – Michael Lugo Jun 26 '24 at 13:47
  • Also there are answers here: https://mathoverflow.net/q/473931/173402 – Math Admiral Jun 26 '24 at 15:50
  • 1
  • 1
    A new video on this topic by Numberphile. https://youtu.be/2lvTjEZ-bbw?si=dbYRYSyn24tgg6o- – Pustam Raut Jul 22 '24 at 10:32

2 Answers2

22

Too long for a comment.

Going from Pochhammer symbols to the gamma function, the summand is $$a_{n,\lambda}=-\frac{(2n+4 \lambda -1)\,\, \Gamma \left(\frac{4 n^2-4 \lambda +1}{4 (n+\lambda )}\right)}{(2 n+1) (n+\lambda ) \,\,\Gamma (n+1)\,\, \Gamma \left(\frac{1-4 n (\lambda -1)}{4 (n+\lambda )}\right)}$$

$$\frac{a_{n+1,\lambda}}{a_{n,\lambda}}=1-\frac{\lambda +2}{n}-\frac{(2 \lambda -1)^2 \log (n)-\alpha}{4 n^2}$$ where $$\alpha=4 \lambda ^2+(2 \lambda-1 )^2\,\psi ^{(0)}(1-\lambda )+17$$

Adding $10,000$ terms for various $\lambda$, some numbers $$\left( \begin{array}{cc} \lambda & 4+\sum_{n=1}^{10^4} a_n \\ 0 & \color{red}{3.14169265}6449014122789803 \\ 1 & \color{red}{3.141592653589}876574977781 \\ 2 & \color{red}{3.141592653589793}182123845 \\ 3 & \color{red}{3.1415926535897932384}87758 \\ 4 & \color{red}{3.1415926535897932384626}31 \\ 5 & \color{red}{3.141592653589793238462643} \\ \end{array} \right)$$

while, for the same number of terms, Madhava-Leibniz formula gives $\color{red}{3.141}6926436$.

Using the same number of terms, for $\lambda=10$, the absolute error is $2.91\times 10^{-42}$ and, for $\lambda=100$, it drops to $3.92\times 10^{-250}$ and for $\lambda=1000$ it is less than $1.00\times 10^{-1000}$.

Oscar Lanzi
  • 48,208
  • 7
    I don’t understand: if in the large $\lambda$ limit the formula is just $\pi=4\sum_{n \geq 0}{\frac{(-1)^n}{2n+1}}$, why is the approximation getting better as $\lambda$ grows? – Aphelli Jun 26 '24 at 08:32
  • 2
    @Aphelli. I think that the major difference is that we only add positive terms which decrease very fast. – Claude Leibovici Jun 26 '24 at 10:30
  • 1
    How can these terms decrease so fast, though? Where is the flaw in the OP’s asymptotic discussion (which shows that the decrease is polynomial of small degree), if the Pochhammer symbol basically cancels the factorial out? – Aphelli Jun 26 '24 at 11:57
  • 3
    @Aphelli. I fully agree with you. This looks like magics. In fact, if If $b_{n,\lambda}$ is the summand, the contribution of the diagonal part is impressive. What would be interesting is to look at a contour plot of them. I mentally visualize it but I do not know how to make it. Moreover, being blind, I never produce plots which could be far from decent. Do you know how to make it ? – Claude Leibovici Jun 26 '24 at 12:19
  • 4
    @ClaudeLeibovici Out of curiosity -- only if you don't mind: Does some program/OS read the text here in Math.SE to you aloud? Can it read the Latex? Is there a Braille output device? – Peter - Reinstate Monica Jun 26 '24 at 13:41
  • 36
    @Peter-ReinstateMonica. I have a lot of devices but thé best is .... my wife. She does not understand anything but she uses to stay next to me when I am working. We married sixty years ago and she is typing this message (thanks, honey !) – Claude Leibovici Jun 26 '24 at 14:51
  • 14
    @ClaudeLeibovici What can I say except "wow", thank you and best wishes to both of you. I'm sure your little team has helped a lot of people. – Peter - Reinstate Monica Jun 26 '24 at 15:00
  • 12
    @Peter-ReinstateMonica. The most funny is her comments when I produce numbers. When I was involved in QM in the very early 60's, she Saïd that I had a strange manner to write environ; in fact, this was eV !!! – Claude Leibovici Jun 26 '24 at 15:30
  • 2
    I haven't gone through to check the algebra but this looks excellent; thank you! Given $\frac{a_{n+1}}{a_n}=1-\frac{\lambda+2}{n}+O^(n^{-2})$ we can as usual take logarithms to get $\log(a_{n+1})-\log(a_n)=-\frac{\lambda+2}{n}+O^(n^{-2})$, then sum to get $\log a_n=(-\lambda+2)H_n+O^(n^{-1})$ $=-(\lambda+2)\log n+O(1)$, so $a_n\approx Cn^{-(\lambda+2)}$ which would explain why the convergence gets so much better for large $\lambda$. ($O^()$ here is a slightly sloppy 'up to logarithmic factors in $n$'). – Steven Stadnicki Jun 26 '24 at 16:41
  • 8
    @Aphelli What must be happening here is that the optimal value of $\lambda$ to minimize the error depends on, and grows with, the number of terms summed. Since the number of terms summed is $10,000$ the optimal value must be quite large, but for $\lambda$ even larger than that you will see the error start to grow again and approach the Madhava-Leibniz error. – Will Sawin Jun 26 '24 at 16:54
  • 1
    An obvious follow-up question (though perhaps out of scope for this one) is how this optimal value scales with the number of terms summed. – Semiclassical Jun 27 '24 at 02:50
  • In your comparison with the Madhava-Leibnitz series the latter is off in the $10^{-4}$ place with a $6$ where there should be a $5$, so the M-L series is actually really bad. If we render $\sqrt2$ with accuracy via Newton's Method and then use the series here, then 9999 terms give $\color{blue}{3.1415926}6...$. – Oscar Lanzi Jun 27 '24 at 14:05
18

You can compute an asymptotic equivalent of the sum's terms: $$ u_n(\lambda) = \frac1{n!}\left(\frac1{n+\lambda}-\frac4{2n+1}\right)\left(\frac{(2n+1)^2}{4(n+\lambda)}-n\right)_{n-1}\sim-\frac1{\Gamma(1-\lambda)n^{\lambda+2}} $$ Which gives the asymptotic equivalent of the sum: $$ R_N(\lambda) = \sum_{n=N}^\infty u_n\sim -\frac1{(\lambda+1)\Gamma(1-\lambda)n^{\lambda+1}} $$ This confirms the fact that increasing $\lambda$ generally improves the convergence due to the larger power law decay. However, this holds for $\lambda\not\in\mathbb N^*$. When $\lambda\in\mathbb N^*$, the prefactor vanishes so you would expect that the leading order coefficient would be even smaller. This is the case, this time, the equivalent is: $$ u_n(\lambda) \sim\frac{(-1)^\lambda(\lambda-1)!}{4n^{\lambda+3}} $$ and for the series remainder: $$ R_N(\lambda)\sim \frac{(-1)^\lambda(\lambda-1)!}{4(\lambda+2)n^{\lambda+2}} $$ This is consistent: larger $\lambda$ leads to a faster asymptotic convergence. Furthermore, the exponent is improved by a factor $1/n$ compared to neighbouring $\lambda$.

However there is a subtle behaviour as $\lambda\to \infty$. The issue is that the previous asymptotic equivalent is not uniform in $\lambda$. For $n \ll \lambda$ which is possible due to the separation of scale, you rather recover the Leibniz formula: $$ u_n(\lambda)\sim \frac{(-1)^n}{2n-1} $$ which has a slower convergence for $1\ll N\ll\lambda$: $$ R_N \sim \frac{(-1)^N}{2N} $$ The region where this is valid grows linearly as $\lambda\to\infty$ and "contaminates" the faster power law tail. You can already predict the downfall of the latter by noticing its rapidly increasing factorial prefactor.

You can compare this to the simple formula with geometric convergence like. Take for example $\tan(\pi/6) = 1/\sqrt3$: $$ \pi = 2\sqrt3\sum_{n=0}^\infty \frac{(-1)^n}{3^n(2n+1)} $$ Obviously, this formula is superior asymptotically, but you could imagine that the new formula could have a good head start and give the first digits with fewer terms. For it to have a good head start, you need to have a relatively small $\lambda$ or else you recover the first terms of the Leibniz formula. The $n$ for which this happens is before the region of validity of the asymptotic equivalent, but you can still observe the behaviour numerically:

non integerinteger

In short, no, compared to the most simple geometric converging formula, the formula is an improvement only for the first couple digits, and asymptotically pretty terrible.

LPZ
  • 6,049