man-and-laptop 6 years ago

Sketch of an alternative proof, more DSP:

Use the fact that the approximation in the paper is equal to the inner product of e^{-x^2} with a Dirac comb [1]. The amazing thing about the Gaussian function and the Dirac comb is that they're both preserved by the Fourier transform. So apply the Fourier transform to both of them, observe that the Fourier transform is unitary (essentially a rotation), and therefore doesn't affect the inner product; then expand the inner product of the Fourier transforms.

Essentially, it's the same proof, but not in the language of Theta functions. In fact, I'd argue it's a better proof, because it generalises.

Generalisation: This technique applies to all Riemann sums, as long as you can compute the Fourier transform of the function. The thinner the tails of the function's Fourier transform, the faster its Riemann sums will converge.

[1] - https://en.wikipedia.org/wiki/Dirac_comb

  • abenedic 6 years ago

    Myself, I would say this is 80% correct. The bigger deal is the spectral convergence of the trapezoidal sum for periodic entire functions.

    • man-and-laptop 6 years ago

      I gave my generalisation in terms of frequency, and not in terms of "number of rectangles" in the Riemann sum, which I conveniently assumed to be infinite.

      A better generalisation: if a function is thin-tailed, and its Fourier transform is thin-tailed, then it's Riemann sums converge to its integral at an exponential rate. In particular, this applies to the Gaussian function.

      I'll check out what you said.

xamuel 6 years ago

The formula involves a parameter c=10^10 and initially seems unbelievable because one's initial inclination is to assume that the 10^10 is particularly important, like it has to be that particular value in order for the formula to work. The "trick" is that higher values of c, like c=10^19, give even more accuracy. Obviously c=10^10 was chosen to optimize the formula's aesthetic beauty.

  • madcaptenor 6 years ago

    Even c = 2 works.

      > n = seq(-1000, 1000); #assume 1000 is big enough to be infinity
      > sum(exp(-n^2/2))^2 / 2
      [1] 3.141593
    • miduil 6 years ago

      Which programming language is that?

      Edit: Ah, it's "R".

      • madcaptenor 6 years ago

        Yes, it's R. Not necessarily the ideal language for this but I had an RStudio window open.

madcaptenor 6 years ago

That "wrong formula" approximates pi by an integral: more precisely, exp(-x^2) integrated over the real line integrates to sqrt(pi). So the question is, in some sense, why is that such a good approximation? (My Fourier analysis is rusty, so I can't answer that question.)

  • hammock 6 years ago
    • madcaptenor 6 years ago

      I'm familiar with the integral. But why is that sum a particularly good approximation to the integral? It seems better than one has a right to expect, although it's been a while since I did any numerical analysis.

      • madcaptenor 6 years ago

        Replying to my own comment. See (4.4) in the article and the discussion after it. The error in this approximation is like exp(-pi^2 c). (4.10) in the article translates this to that we should expect about 4.2c digits of accuracy, since log_10 exp(-pi^2) is about 4.2. This falls out of Poisson's summation formula, according to the OP.

        Generally I'd expect a numerical integration scheme to have an error like h^k for some constant k - for example for Riemann sums the error goes like h^2 and for Simpson's rule like h^5. h is the distance between the sampling points and so is analogous to 1/c. So this doesn't just follow from Riemann summation.

        • tanderson92 6 years ago

          Trapezoidal rule quadrature is better than you would expect (2nd order) for periodic (even better for analytic and indeed entire, in this case) integrands. See this paper: http://eprints.maths.ox.ac.uk/1734/

      • messe 6 years ago

        Riemann sums. EDIT: The short answer is that it's a good approximation because e^(-n^2/c) drops off very vast as n approaches zero, meaning most of the contributions will come from small (on the order of sqrt(c)).

        Other than that, it's just a Riemann sum presented in an aesthetically pleasing manner.

        • TimonKnigge 6 years ago

          Do you mean 'approaches infinity'? Because at n=0 the expression is maximal :-)

          But the point is not to drop small terms at the extremes - it is still an infinite sum. The point is to approximate sections of the function by rectangles, and those rectangles are a bad approximation around 0 too.

xyzzyz 6 years ago

Seems like the formula is simply a fine enough Riemann sum for calculating Gaussian integral int_-inf^inf e^(-x^2) dx = sqrt(pi). It makes it much less surprising, though the exact estimation of error is still quite ingenious and worth following.

messe 6 years ago

Spoiler alert: It's just a Riemann sum. This is like being surprised that (1+10^-100)^(10^100) approximates e astonishingly accurately.

  • WhiteSage 6 years ago

    What is surprising is how small the error term is. For the sake of comparison, (1+10^-5)^(10^5) only gets five digits of e right.

    • saagarjha 6 years ago

      And this one gets fewer than a hundred.

    • philbot1008 6 years ago

      I would be more surprised if the "formula" didn't include the value of pi.

      Edit: I'm an idiot, and blind. It was 'n', not pi.

  • saagarjha 6 years ago

    Interestingly, it seems that Wolfram|Alpha cannot figure out that there's a difference: http://www.wolframalpha.com/input/?i=N%5B((1%2B10%5E-100)%5E...

    • messe 6 years ago

      It's accurate to about a 100 digits, admittedly not quite as good as the expression in the OP, but it's the same principle. It's taking a fairly standard approximation, in the OP's case a Riemann sum, and inserting concrete but aesthetically pleasing numbers and acting as if something is incredible about it.

      • saagarjha 6 years ago

        Yes, I get that. It seems like Wolfram|Alpha thinks 10^100 is too large of a number for it to have to care about, and is rounding it to infinity internally somewhere, hoping it doesn't change the final result. But, of course, it does matter in this case.

        • kidme5 6 years ago

          You asked WA for the result with 100 digits of precision. It probably is 1 to that precision.

          • btilly 6 years ago

            There is no need to guess. First of all:

                (1 + 1/n)^n = e^(log(1 + 1/n) * n)
            
            Now from the Taylor series approximation:

                log(1 + t) = t - t^2/2 + t^3/3 - t^4/4 + ...
            
            Substitute that in and we get:

                e^(log(1 + 1/n) * n)
                    = e^((1/n - 1/(2 n^2) + 1/(3 n^3) - ...) n)
                    = e^(1 - 1/(2n) + 1/(3n^2) - ...)
            
            And now you can apply the tangent line approximation to find that this is:

                e - e/(2n) + O(1/n^2)
            
            So if n = 10^N, then the first error should be around the N'th digit.
          • saagarjha 6 years ago

            I don't think it is. Try N[((1+10^-n)^(10^n))/e, n] for smaller values of n. At first it approaches e faster than the precision can "catch up", and up until around n=50 it will result in 1. But at 10^60 and above it will return 1.0000000…

anonytrary 6 years ago

Interesting article, but I found the title a bit funny. I'd like to see an article about Newton's laws titled "Getting to the Moon from a Wrong Formula".

gesman 6 years ago

This formula is worthy to be printed on T-shirt :)

preparedzebra 6 years ago

For any pattern, constant, irrational, etc, in math, there exists a set of formulas that models it up until n. It still is a cool little Riemann sum in this paper

amelius 6 years ago

There's still the hypothesis that any finite sequence of digits appears somewhere in pi.

  • saagarjha 6 years ago

    Ah, the normality hypothesis. It seems like it should be true, but apparently this is something that's really hard to prove.

    • mamon 6 years ago

      I might be ignorant here, but wouldn't it suffice to prove that digits of Pi are random? Just check whether the distribution is uniform, the same way you would validate pseudorandom sequence generator for a programming language. Once you proved that Pi digits are random the normality hypotesis becomes trivial: as number of known Pi digits approaches infinity the probablity of any finite sequence to appear approaches 1.

      • amelius 6 years ago

        That's sort of the whole point of normal numbers, and pi is not known to belong to this class.

        https://en.wikipedia.org/wiki/Normal_number

        Quoting:

        > It is widely believed that the (computable) numbers √2, π, and e are normal, but a proof remains elusive.

      • mikeash 6 years ago

        You can’t just check all the digits. There are an infinite number of them and you don’t know if they stop looking random at some point after you stop checking.

      • v_lisivka 6 years ago

        Digits of Pi are not random, instead they are uniformly distributed or "pseudo-random".

        Not all sequences are uniformly distributed, thus it very unlikely that we will be able to find long pieces of non-uniformly distributed sequences in uniformly distributed sequence.

        • saagarjha 6 years ago

          I’m sorry, but I don’t think you quite understand what randomness, or pseudorandomness, means. In a truly random sequence, the probability of any given finite sequence appearing in it is 1.

      • pitaj 6 years ago

        The distribution wouldn't even need to be uniform, right? As long as one or more digits never stopped appearing at any point, the infinite sequence would include every possible sequence of numerals.

        • ginnungagap 6 years ago

          Normality also includes the distribution of the substrings in the definition, it's not just "every finite string of numbers compares somewhere"

        • v_lisivka 6 years ago

          I'm 100% sure that Pi doesn't include e.g. 0.(3) sequence, or e sequence, or many many other sequences, or even just million of zeroes in the row.

          • billforsternz 6 years ago

            Why would you be sure it doesn't include a million zeroes in a row? If the digits are random, as appears likely, it definitely will include a million zeroes in a row. The problem is even if you could turn every atom in the universe into a supercomputer, and somehow get them all cooperatively working on calculating the digits, you'd still never get to the million zeroes sequence in a million universe lifetimes. But they're still out there somewhere.

            • billforsternz 6 years ago

              I cannot reply to the reply from v_lisivka (for some reason) but I don't know why you'd think a temporary run of decimal digits in pi would have any effect on the geometry of a circle. It all comes down to whether pi is Normal or not. Repeating the quote above, it is thought likely but not proven at this stage;

              Quoting:

              > It is widely believed that the (computable) numbers √2, π, and e are normal, but a proof remains elusive.

              • v_lisivka 6 years ago

                My rough understanding is that Pi is representation of certain curve: circle. If we skew sequence too far to one side or another, then curve will lost it shape.

                • billforsternz 6 years ago

                  I hope it is becoming apparent that you need more than a rough understanding of one of the properties of pi to contribute usefully to the discussion.

            • v_lisivka 6 years ago

              Because geometry of a circle will be skewed if Pi will contains millions zeroes in a row.

              Pi is not a random number even if it digit sequence looks as pseudo-random sequence.

              • zuminator 6 years ago

                One would expect a repdigit sequence of length k to appear once in a 10^k normal sequence. So in the 10^1000000 expansion of pi, one should expect a million zeroes to appear in a row once. You can check this to a limited extent here: http://www.angio.net/pi/. It only goes up to 200 million (2 x 10^8) digits, but sure enough 00000000 happens to appear twice. (Nonetheless, we don't actually know if pi is normal.)

                • billforsternz 6 years ago

                  Thanks for this, very interesting. My earlier intuition is more than confirmed; If you turn every atom in the universe into a supercomputer, get them all working together generating digits of pi, for a million universe life times, you only get 10^80 (atoms in universe approx) * 10^10 (10 billion digits per sec each say) * 10^11 (years in a universe life time roughly) * 10^8 (seconds in a year roughly) * 10^6 (a million universe lifetimes) = 10^115 (ish) digits. In fact that is an incomparably smaller number that 10^1000000 digits, only good for a single run of 115 zeroes in a row.

                  Basically there's an awful lot of room between zero and mathematical infinity, and normal large numbers that we experience or even try to reason about in everyday life don't and can't begin to stretch even a little way towards the ultimate mathematical limits.

                  • v_lisivka 6 years ago

                    We can use BPP formula and sampling to try to find 100 zeroes in a row.

dajohnson89 6 years ago

Wouldn't a better title be, "An accurate approximation of pi"? Not as clickbaity though....

  • xamuel 6 years ago

    It's not clickbait. The article is genuinely interesting, and the title is quite relevant to why it's interesting.

  • jack6e 6 years ago

    > "Not as clickbaity though...."

    Not as accurate, either, given that the title of the paper is "Get Billions and Billions of Correct Digits of pi from a Wrong Formula," and it was published before "click-bait" was a thing.

    • djmips 6 years ago

      Click-bait has long existed as headlines and movie and novel titles.

    • izzydata 6 years ago

      Perhaps that means this paper invented click-bait.

Kenji 6 years ago

Am I the only one who is not surprised at all that this exists?