Timeline for Why mpmath computes $\sum_{n=2}^\infty (-1)^n\log(n)=\log\left(\frac1 2 \sqrt{2} \sqrt{\pi}\right)$
Current License: CC BY-SA 4.0
25 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 16, 2022 at 16:03 | comment | added | François Brunault | @IosifPinelis Actually it would be great if the OP could clarify what was the problem exactly... | |
May 16, 2022 at 14:21 | comment | added | Iosif Pinelis | @PeterTaylor : Thank you for the reference. | |
May 16, 2022 at 14:17 | comment | added | Iosif Pinelis | @FrançoisBrunault : Thank you for this information. Of course, designing efficient computational methods involves nontrivial mathematics, but the problem here was, rather, how to find the sum of a series in closed form or, perhaps, to find out how a particular kind of software does that. | |
May 16, 2022 at 10:41 | comment | added | Peter Taylor | @FrançoisBrunault, there's a recent review of resources for (ii) on arxiv. | |
May 16, 2022 at 6:52 | comment | added | François Brunault | @IosifPinelis I'm not aware of a type (i) algorithm except recognising rational numbers and more generally $\mathbb{Z}$-linear relations (LLL algorithms). For (ii), in the old times there was the Plouffe inverter. It does not exist anymore but if I understood correctly this is now part of OEIS, and here it indeed works. After that, there still needs to be explained why some summation algorithms also work with divergent series. | |
May 16, 2022 at 6:45 | comment | added | François Brunault | @IosifPinelis Almost certainly mpmath does not recognize the closed-form expression $\log\sqrt{\pi/2}$, it is human's work to find a reasonable candidate for the number output by the computer. My point is that mpmath relies on non-trivial summation algorithms, and why a given algorithm produces a value suggested by theory remains to be proven mathematically. For details see Cohen--Rodriguez-Villegas-Zagier's article "Convergence Acceleration of Alternating Series" p. 6 (they don't provide a proof). In any case, I find OP's current "Q1" rather unclear, and I hope that the OP will clarify it. | |
May 16, 2022 at 0:14 | comment | added | Iosif Pinelis | @FrançoisBrunault : (i) I agree that there may be nontrivial math in recognizing a closed-form constant from its (say decimal) approximations. (Do you know if such math exists?) (ii) But it also may be a matter of just keeping a large library of such constants along with their respective decimal approximations, and then nontrivial math is not needed. Since, as you noted, this same series is present in a known book on numerical approximations, this may well be just a type-(ii) case, without significant math content. So, then this is indeed a question about the mpmath inner workings. | |
May 15, 2022 at 23:07 | comment | added | François Brunault | @joro Do you know exactly the algorithm used by mpmath? Apparently several options are possible for the function nsum, so it would be useful if you could do some testing and tell us which one produces this result. | |
May 15, 2022 at 23:03 | comment | added | François Brunault | @IosifPinelis Assuming we know the algorithm mpmath is using (which should not be too hard to figure out, but the OP should make this precise), it is still a non-trivial math question to show that when applied to this particular series, it recovers the regularised value. | |
May 15, 2022 at 22:44 | comment | added | François Brunault | As Aurel says, this phenomenon has already been observed in PARI/GP, see the book by Belabas and Cohen, "Numerical Algorithms for Number Theory - Using PARI/GP", p. 210 mentions exactly the same series. In this book, the computation relies on an efficient algorithm due to Cohen, Rodriguez-Villegas and Zagier for evaluating alternating series. The function used is called SumAlt (p. 209), the PARI/GP code is freely available here: math.u-bordeaux.fr/~kbelabas/Numerical_Algorithms (there is also the built-in PARI/GP function sumalt). | |
May 15, 2022 at 19:30 | comment | added | Iosif Pinelis | With your Added sentence, the question becomes looking more like a question about inner workings of software (mpmath) and thus apparently inappropriate for MO. To avoid this (impression?), you may want to consider removing this addition and, moreover, amending your question to something like this: "Are there theoretical reasons for (1)?" | |
May 15, 2022 at 17:07 | answer | added | Iosif Pinelis | timeline score: 7 | |
May 15, 2022 at 15:25 | comment | added | LSpice | @Wojowu, I think that the reference to working numerically is just the precision with which the CAS claims that the two sides of (1) agree, not a claim about how the CAS arrived at its answer. | |
May 15, 2022 at 15:07 | comment | added | Wojowu | The sum clearly doesn't converge, as its terms do not go to zero. The sum has very oscillatory behavior, so I have no idea where your suggestion that it arrives at the result purely numerically comes from. | |
May 15, 2022 at 15:05 | history | edited | joro | CC BY-SA 4.0 |
mpmath works purely numerically
|
May 15, 2022 at 14:56 | answer | added | Gerald Edgar | timeline score: 9 | |
May 15, 2022 at 14:39 | history | edited | LSpice | CC BY-SA 4.0 |
1/2 -> \frac1 2
|
May 15, 2022 at 14:39 | comment | added | T. Amdeberhan | This evaluation of a "divergent" series should be due to "analytic continuation" of a certain convergence series. Look at the LerchPhi function show below (Iosif Pinelis). Example: $\zeta(-s)=\sum n^s=-\frac{B_{s+1}}{s+1}$ for $B_k$ the Bernoulli number. | |
May 15, 2022 at 14:33 | answer | added | Iosif Pinelis | timeline score: 2 | |
May 15, 2022 at 14:32 | comment | added | Gerald Edgar | @T.Amdeberhan ... The value is $$\log\left(\frac{\sqrt{2}\sqrt{\pi}}{2}\right) = \frac{\log\pi - \log 2}{2}$$ | |
May 15, 2022 at 14:31 | comment | added | Aurel | It is very frequent that algorithmic summation methods produce a consistent value for divergent series. In Pari/gp, sumalt (designed for convergent alternating series) gives the same result. | |
May 15, 2022 at 14:28 | comment | added | T. Amdeberhan | Is $\sqrt{2\pi}$ in the denominator or numerator? | |
May 15, 2022 at 14:26 | history | edited | GH from MO |
edited tags
|
|
May 15, 2022 at 14:25 | comment | added | Gerald Edgar | This looks like the value of a Cesaro (or Abel) summation method. If npmath uses such summation methods, they should tell you so in their documentation. | |
May 15, 2022 at 14:02 | history | asked | joro | CC BY-SA 4.0 |