From: mueller@schaefer.math.wisc.edu (Carl Douglas Mueller) Subject: Re: pi mnemonics Keywords: 3.1415926535... Date: Wed, 16 Sep 92 21:35:12 GMT >elkies@ramanujan.harvard.edu (Noam Elkies) writes: > >There is a class of pi mnemonics in the form of sentences whose >n-th word encodes the n-th digits of pi by its number of digits. >Please e-mail me more suitable examples or pointers to same >(wasn't there a Martin Gardner column or chapter that listed these?). >They don't even have to be in English. > I don't suppose this counts, but a musical group called "Two Dead Geese" (they performed locally in Champaign, IL many years ago) had a song called The PI Song (or some such thing). The words went something like: The PI song Some got religion Some got drugs Some got a natural high But I think my system Beats them all 'Cause I've got my PI Three point one four one five nine two six five three five eight nine seven nine three two three ain't it good to be alive? Some say my life is over 'Cause I'm flunking out At the big U of I But I don't fret No I don't sweat 'Cause I've got my PI Three point one four one five nine two six five three five eight nine seven nine three two three ain't it good to be alive? (c) Two Dead Geese (about 1980) I'd sing it, but my voice is terrible. Anyway, this song gives PI to seventeen decimal places. *** From: SHERE@SLACVM.SLAC.STANFORD.EDU In article , guckes@math.fu-berlin.de (Sven Guckes) says: > >elkies@ramanujan.harvard.edu (Noam Elkies) writes: > >>There is a class of pi mnemonics in the form of sentences whose >>n-th word encodes the n-th digits of pi by its number of digits. >>Please e-mail me more suitable examples or pointers to same >>(wasn't there a Martin Gardner column or chapter that listed these?). >>They don't even have to be in English. > >Subject: Pi poem (mnemonic for memorizing Pi) > >3,14159 265358 979 323846 264338 32795 0?! >Sir, I bear a rhyme excelling >In mystic force and magic spelling >Celestial sprites elucidate >All my own striving can't relate Or locate they who can cogitate And so finally terminate finis >Count the number of letters in each word. >Consider the "," a decimal point. *** From: jbaez@riesz.mit.edu (John C. Baez) The following fiendish math puzzles were lifted from an article by Jonathan and Peter Borwein in the October 1992 Notices of the AMS. They're nice because while they have some sophisticated math lurking behind them, they are also accessible to anyone with a heavy-duty calculator or computer. 1. AN AMUSING LIE. First for the true part. It's well-known that pi/4 equals 1 - 1/3 + 1/5 - 1/7 + .... So if you add up the first 500,000 terms of 4(1 - 1/3 + 1/5 - 1/7 + ....) you should get a decent approximation to pi. Now for the amusing lie: "This gives pi accurate to 40 decimal places." Show that this is a lie, and show why it is curiously close to being true!!! 2. A CURIOUS SUM. Let o(n) be the function that counts the number of odd digits of the integer n (in base 10); for example, o(34) = 1 and o(1001) = 2. Figure out a closed-form expression for the sum from 1 to infinity of o(2^n)/2^n . As I said, anyone who can use a calculator or computer can have some fun with these - do some "experimental mathematics"! *** From: jbaez@riesz.mit.edu (John C. Baez) Oh well, here are (partial) answers to my first 2 math puzzles. The amusing lie concerns the sum of the first 500,000 terms of the sum 4(1 - 1/3 + 1/5 - ...), which converges to pi. This sum gives us 3.141590653589793240462643383269502884197 while pi to 40 digits is 3.141592653589793238462643383279502884197, so while the sum does not give pi to 40 digits, it comes "close" in a curious way. There's a good explanation. The second question concerned the sum from 1 to infinity of o(2^n)/2^n. Here o(2^n) is the number of odd digits in the decimal representation of 2^n. The sum is surprisingly simple - it's 1/9. *** From: jbaez@riesz.mit.edu (John C. Baez) If the math puzzles I just gave weren't silly enough for you, you may enjoy the following one, also taken from the same source (but dramatized). My colleague across the hall came running into my room excited and out of breath. "I've discovered the most amazing formula for pi!" "What is it?" I asked. He wrote it on my blackboard: pi = (10^{-5} Sum_{n=-infinity}^{n=infinity} e^{-n^2/(10^10)} )^2 "This is amazing!" I cried. "Yes," he said, "it PROVES at last that there is something fundamental about the decimal system!" "Well, wait a minute," I said. "That would be really weird. First of all, are you sure this formula is true?" "Well, I haven't proved it yet, but I've been letting my computer run for weeks and so far it checks to thousands of places." "Hmm, that's not a proof, although it seems like pretty good evidence." But, being, a suspicious sort, I cranked up my CRAY and checked the formula. The irritating thing is that the convergence is incredibly slow at first, because of the 10^10 in the denominator of the exponent. Luckily, after a while the n^2 starts growing fast and then convergence becomes quite rapid. I let the computer print out the digits and I compared them to my massive tables of the digits of pi (all mathematicians have such tables in their office). It checked out perfectly for over 42 billion digits! But then, at some point (I lost count) it went wrong!! I went over and told my colleague and he was crushed, at first. Then he became convinced that there must have been an error in my program - or more likely, just a random bit error due a cosmic ray! After all, how could it be right for 42 BILLION digits but not correct???? Who is right and why? *** From: bs@gauss.mitre.org (Robert D. Silverman) Hint: Think "Normal Distribution" 1/(sqrt(2pi) sigma) e^-(x - mu)/2sigma^2 Its integral from -infty to + infty = 1. *** From: jbaez@riesz.mit.edu (John C. Baez) In article hrubin@pop.stat.purdue.edu (Herman Rubin) writes: [I wrote:] >>My colleague across the hall came running into my room excited and out >>of breath. "I've discovered the most amazing formula for pi!" "What is >>it?" I asked. He wrote it on my blackboard: pi = (10^{-5} Sum_{n=-infinity}^{n=infinity} e^{-n^2/(10^10)} )^2 And it turned out to be *pretty* close -- but not accurate after the 42 billionth decimal place or so! >This is the well-known application of the Poisson summation formula to >the elliptic modular function. Suppose we consider the function > > f(x) = sum e^(-(n+x)/c)^2/(sqrt(pi*c) > >Since this function is periodic of period 1, we can compute it as a >Fourier series > > f(x) = sum e^(2*pi*i*n*x) * e^(-4*pi^2*n^2) > >So for x=0 the relative error is the sum of the coefficients for n different >from 0, with doubling for squaring. Good job! Unfortunately the less mathematically sophisticated may not see where the 42 billion decimal figure came from, since you left out the crucial constant "c" in the last formula, and put a "4" in the exponent that shouldn't be there, as far as I can tell. (I hate these differing conventions for Gaussians and Fourier transforms!) Anyway, my colleague across the hall's formula was off by a small amount, and the largest contribution to the error terms was 2Pi e^{-10^10 pi^2} which is about 10^{-4.2 10^10}, so the first 42 billion decimals or so were correct. Or to be precise, about the first 42,863,147,298 digits were correct. Let's see... yes, that "7" should have been a "3"! The poor guy will be heartbroken. *** From: hrubin@pop.stat.purdue.edu (Herman Rubin) >>Hint: >>Think "Normal Distribution" >>1/(sqrt(2pi) sigma) e^-(x - mu)/2sigma^2 >>Its integral from -infty to + infty = 1. >So far so good. I'm no numerical analyst, but I don't think that's ALL >there is to it. Namely, why would this be accurate to 42 billion >decimal places? (I wasn't joking about that part!) This is the well-known application of the Poisson summation formula to the elliptic modular function. Suppose we consider the function f(x) = sum e^(-(n+x)/c)^2/(sqrt(pi*c) Since this function is periodic of period 1, we can compute it as a Fourier series f(x) = sum e^(2*pi*i*n*x) * e^(-4*pi^2*n^2) So for x=0 the relative error is the sum of the coefficients for n different from 0, with doubling for squaring. *** From: blom@husc15.harvard.edu Well, if you really know FEWER than 100 digits, this may be of some use. 3.14159 26535 89793 23846 26433 83279 50288 41971 69399 37510 58209 74944 59230 78164 06286 20899 86280 34825 34211 70679 . . . Those are the first 101 digits, off the top of my head. That's all I know. Sorry. I used Derive to find pi in the first place, but Mathematica or Maple would work, and there are plenty of other programs out there. Well, for an algorithm, how about x_nt x_n+1 = xsin(x_n), and use the Taylor series expansion for sine? Start with x_0 = 3. Or, maybe use the fact that the sum of the reciprocals of the tenth powers is pi to the tenth power divided by 93555. I think. Don't quote me. This is based on the Riemann Zeta function as it relates to the Bernoulli numbers. 1/93555 is the tenth Bernoulli number, I think. Again, don't quote me. :) Along the lines of arctangents, Machin's formula is pi = 16 atan(1/5) - 4 atan(1/239). Use the Taylor series for arctangent, which is atan(x) = x - x^3/3 + x^5/5 - x^7/7 . . . Also, pi = 48 atan(1/18) + 32 atan(1/57) - 20 atan(1/239) and pi = 80 atan(1/57) + 96 atan(1/68) + 48 atan(1/117) - 20 atan(1/239) I derived these formulas knowing that atan(1/n) = atan(1/(n+delta)) + atan(delta/(delta*n + n^2 + 1)) Choose positive or negative delta values which divide n^2+1. You want to evaluate the arctangents of small values because they converge faster. Probably the fastest algorithm to find pi, but a really hairy one, and not necessary unless you need zillions of digits, is based on the Arithmetic-Geometric Mean. I happen to have the book "PI and the AGM" by Borwein and Borwein beside me, so you're in luck. By the way, this book is probably the best single reference for this type of thing. Anyway, here's the AGM-related algorithm: x_n+1 := ((x_n)^(1/2) + (x_n)^(-1/2)) / 2 x_0 := 2^(1/2) y_n+1 := (y_n(x_n)^(1/2) + (x_n)^(-1/2)) / (y_n + 1) y_0 := 2^(1/4) pi_n := pi_n-1 (x_n + 1) / (y_n + 1) pi_0 := 2 + 2^(1/2) The eleventh iteration of this yields over 5000 digits. Oh, I have the first 1.25 million digits on my computer, but that's too much bandwidth for the net or for the Unix mail system. If you wanted, I could send you like 10,000 digits by mail, but it's kinda fun calculating them! My computer calculated 10,000 just fine, but it choked when I tried writing to disk. Oh, well. C'est la vie! So I went with 5000 until I d/l'ed the first 1.25 million from somewhere, via anonymous FTP. Keep your eyes peeled for the sci.math FAQ, which details how to do that. One last thing . . . BASIC???????? What Basic are you using? No DOS basic gives any decent speed when doing things like this. Your calculation time would be shorter in C or Pascal, or especially Fortran. Just a thought. *** From: dik@cwi.nl (Dik T. Winter) Date: 4 Nov 92 14:20:40 GMT If you check sci.math about one or two weeks ago there was an article that gave a (short) formula wich was a correct approximation of pi in 42 billion digits. You could try that one. *** From: cet1@cus.cam.ac.uk (C.E. Thompson) In article <1992Oct31.201340.20090@galois.mit.edu>, jbaez@riesz.mit.edu (John C. Baez) writes: |> |> The amusing lie concerns the sum of the first 500,000 terms of the |> sum |> |> 4(1 - 1/3 + 1/5 - ...), |> |> which converges to pi. This sum gives us |> |> 3.141590653589793240462643383269502884197 |> |> while pi to 40 digits is |> |> 3.141592653589793238462643383279502884197, |> |> so while the sum does not give pi to 40 digits, it comes "close" in a |> curious way. There's a good explanation. Looking at a few more digits: sum = 3.141590 653589 793240 462643 383269 502884 197291 399375 103050 97... +2 -2 +10 -122 +2770 pi = 3.141592 653589 793238 462643 383279 502884 197169 399375 105820 97... suggesting that the tail 1/(n+1) - 1/(n+3) + 1/(n+5) - 1/(n+7) + ... ~ 1/(2n) - 1/(2n^3) + 5/(2n^5) - 61/(2n^7) + 1385/(2n^9) - ... where 1, -1, 5, -61, 1385, ... are the Euler numbers. And this is indeed the case, in the asymptotic sense (the series is not convergent, but the error is always less than the first term omited). However, I wouldn't like to show you my current proof that the Euler-Maclaurin formula reduces to this simple form for this series, as it is quite horrible. Can anyone produce a concise and/or elegant proof? *** From: RVESTERM@vma.cc.nd.edu pi is the limit as n-->oo of one-half of the sum of the sides of a regular n-gon, with distance between the center and a vertex equal to one. you can write a program in ten lines or so to print these values out. the number of digits you get is limited only by your computer. *** From: champion@cch.coventry.ac.uk (Alun) In article <1992Nov6.132725.7333@aio.jsc.nasa.gov> nas_ps@jsc.nasa.gov writes: ~Whenver I need PI in my programming, I always define PI in this way: ~ ~ PI = 4.0 * ATAN (1.0). ~ ~Now, I do not know how to get to any number of digits - I guess that will ~depend on the machine capability. ~ If you work in rads try PI = ACOS (-1.0) ***