Wolfram Computation Meets Knowledge

Pi or Pie?! Celebrating Pi Day of the Century
(And How to Get Your Very Own Piece of Pi)

Pictures from Pi Day now added »

This coming Saturday is “Pi Day of the Century”. The date 3/14/15 in month/day/year format is like the first digits of And at 9:26:53.589… it’s a “super pi moment”.

3/14/15 9:26:53.589... a "super pi moment" indeed

Between Mathematica and , I’m pretty sure our company has delivered more π to the world than any other organization in history. So of course we have to do something special for Pi Day of the Century.

Pi Day of the Century with Wolfram: 3.14.15 9:26:53

A Corporate Confusion

One of my main roles as CEO is to come up with ideas—and I’ve spent decades building an organization that’s good at turning those ideas into reality. Well, a number of weeks ago I was in a meeting about upcoming corporate events, and someone noted that Pi Day (3/14) would happen during the big annual SXSW (South by Southwest) event in Austin, Texas. So I said (or at least I thought I said), “We should have a big pi to celebrate Pi Day.”

I didn’t give it another thought, but a couple of weeks later we had another meeting about upcoming events. One agenda item was Pi Day. And the person who runs our Events group started talking about the difficulty of finding a bakery in Austin to make something suitably big. “What are you talking about?” I asked. And then I realized: “You’ve got the wrong kind of pi!”

I guess in our world pi confusions are strangely common. Siri’s voice-to-text system sends Wolfram|Alpha lots of “pie” every day that we have to specially interpret as “pi”. And then there’s the Raspberry Pi, that has the Wolfram Language included. And for me there’s the additional confusion that my personal fileserver happens to have been named “pi” for many years.

After the pi(e) mistake in our meeting we came up with all kinds of wild ideas to celebrate Pi Day. We’d already rented a small park in the area of SXSW, and we wanted to make the most interesting “pi countdown” we could. We resolved to get a large number of edible pie “pixels”, and use them to create a π shape inside a pie shape. Of course, there’ll be the obligatory pi selfie station, with a “Stonehenge” pi. And a pi(e)-decorated Wolfie mascot for additional selfies. And of course we’ll be doing things with Raspberry Pis too.

A Piece of Pi for Everyone

I’m sure we’ll have plenty of good “pi fun” at SXSW. But we also want to provide pi fun for other people around the world. We were wondering, “What can one do with pi?” Well, in some sense, you can do anything with pi. Because, apart from being the digits of pi, its infinite digit sequence is—so far as we can tell—completely random. So for example any run of digits will eventually appear in it.

How about giving people a personal connection to that piece of math? Pi Day is about a date that appears as the first digits of pi. But any date appears somewhere in pi. So, we thought: Why not give people a way to find out where their birthday (or other significant date) appears in pi, and use that to make personalized pi T-shirts and posters?

In the Wolfram Language, it’s easy to find out where your birthday appears in π. It’s pretty certain that any mm/dd/yy will appear somewhere in the first 10 million digits. On my desktop computer (a Mac Pro), it takes 6.28 seconds (2π?!) to compute that many digits of π.

Here’s the Wolfram Language code to get the result and turn it into a string (dropping the decimal point at position 2):

PiString = StringDrop[ToString[N[Pi, 10^7]], {2}];

Now it’s easy to find any “birthday string”:

First[StringPosition[PiString, "82959"]]

So, for example, my birthday string first appears in π starting at digit position 151,653.

What’s a good way to display this? It depends how “pi lucky” you are. For those born on 4/15/92, their birthdate already appears at position 3. (Only about a certain fraction of positions correspond to a possible date string.) People born on November 23, 1960 have the birthday string that’s farthest out, appearing only at position 9,982,546. And in fact most people have birthdays that are pretty “far out” in π (the average is 306,150 positions).

Our long-time art director had the idea of using a spiral that goes in and out to display the beginnings and ends of such long digit sequences. And almost immediately, he’d written the code to do this (one of the great things about the Wolfram Language is that non-engineers can write their own code…).

Different ways to display birthdates found in pi, depending on the position at which they begin

Next came deploying that code to a website. And thanks to the Wolfram Programming Cloud, this was basically just one line of code! So now you can go to MyPiDay.com

Find your birthdate in pi at MyPiDay.com (mine's August 29, 1959)

…and get your own piece of π!

Here's mine...

And then you can share the image, or get a poster or T-shirt of it:

You can get a personalized shirt or poster of your very own MyPiDay result

The Science of Pi

With all this discussion about pi, I can’t resist saying just a little about the science of pi. But first, just why is pi so famous? Yes, it’s the ratio of circumference to diameter of a circle. And that means that π appears in zillions of scientific formulas. But it’s not the whole story. (And for example most people have never even heard of the analog of π for an ellipse—a so-called complete elliptic integral of the second kind.)

The bigger story is that π appears in a remarkable range of mathematical settings—including many that don’t seem to have anything to do with circles. Like sums of negative powers, or limits of iterations, or the probability that a randomly chosen fraction will not be in lowest terms.

If one’s just looking at digit sequences, pi’s 3.1415926… doesn’t seem like anything special. But let’s say one just starts constructing formulas at random and then doing traditional mathematical operations on them, like summing series, doing integrals, finding limits, and so on. One will get lots of answers that are 0, or 1/2, or square root of 2. And there’ll be plenty of cases where there’s no closed form one can find at all. But when one can get a definite result, my experience is that it’s remarkably common to find π in it.

A few other constants show up too, like e (2.1718…), or Euler gamma (0.5772…), or Catalan’s constant (0.9159…). But π is distinctly more common.

Perhaps math could have been set up differently. But at least with math as we humans have constructed it, the number that is π is a widespread building block, and it’s natural that we gave it a name, and that it’s famous—now even to the point of having a day to celebrate it.

What about other constants? “Birthday strings” will certainly appear at different places in different constants. And just like when Wolfram|Alpha tries to find closed forms for numbers, there’s typically a tradeoff between digit position and obscurity of the constants used. So, for example, my birthday string appears at position 151,653 in π, 241,683 in e, 45,515 in square root of 2, 40,979 in ζ(3) … and 196 in the 1601th Fibonacci number.

Randomness in π

Let’s say you make a plot that goes up whenever a digit of π is 5 or above, and down otherwise:

For each consecutive digit of pi, this plot line goes up if the digit is 5-9 and down if it's 0-4

It looks just like a random walk. And in fact, all statistical and cryptographic tests of randomness that have been tried on the digits (except tests that effectively just ask “are these the digits of pi?”) say that they look random too.

Why does that happen? There are fairly simple procedures that generate digits of pi. But the remarkable thing is that even though these procedures are simple, the output they produce is complicated enough to seem completely random. In the past, there wasn’t really a context for thinking about this kind of behavior. But it’s exactly what I’ve spent many years studying in all kinds of systems—and wrote about in A New Kind of Science. And in a sense the fact that one can “find any birthday in pi” is directly connected to concepts like my general Principle of Computational Equivalence.

SETI among the Digits

Of course, just because we’ve never seen any regularity in the digits of pi, it doesn’t mean that no such regularity exists. And in fact it could still be that if we did a big search, we might find somewhere far out in the digits of pi some strange regularity lurking.

What would it mean? There’s a science fiction answer at the end of Carl Sagan’s book version of Contact. In the book, the search for extraterrestrial intelligence succeeds in making contact with an interstellar civilization that has created some amazing artifacts—and that then explains that what they in turn find remarkable is that encoded in the distant digits of pi, they’ve found intelligent messages, like an encoded picture of a circle.

At first one might think that finding “intelligence” in the digits of pi is absurd. After all, there’s just a definite simple algorithm that generates these digits. But at least if my suspicions are correct, exactly the same is actually true of our whole universe, so that every detail of its history is in principle computable much like the digits of pi.

Now we know that within our universe we have ourselves as an example of intelligence. SETI is about trying to find other examples. The goal is fairly well defined when the search is for “human-like intelligence”. But—as my Principle of Computational Equivalence suggests—I think that beyond that it’s essentially impossible to make a sharp distinction between what should be considered “intelligent” and what is “merely computational”.

If the century-old mathematical suspicion is correct that the digits of pi are “normal”, it means that every possible sequence eventually occurs among the digits, including all the works of Shakespeare, or any other artifact of any possible civilization. But could there be some other structure—perhaps even superimposed on normality—that for example shows evidence of the generation of intelligence-like complexity?

While it may be conceptually simple, it’s certainly more bizarre to contemplate the possibility of a human-like intelligent civilization lurking in the digits of pi, than in the physical universe as explored by SETI. But if one generalizes what one counts as intelligence, the situation is a lot less clear.

Of course, if we see a complex signal from a pulsar magnetosphere we say it’s “just physics”, not the result of the evolution of a “magnetohydrodynamic civilization”. And similarly if we see some complex structure in the digits of pi, we’re likely to say it’s “just mathematics”, not the result of some “number theoretic civilization”.

One can generalize from the digit sequence of pi to representations of any mathematical constant that is easy to specify with traditional mathematical operations. Sometimes there are simple regularities in those representations. But often there is apparent randomness. And the project of searching for structure is quite analogous to SETI in the physical universe. (One difference, however, is that π as a number to study is selected as a result of the structure of our physical universe, our brains, and our mathematical development. The universe presumably has no such selection, save implicitly from the fact the we exist in it.)

I’ve done a certain amount of searching for regularities in representations of numbers like π. I’ve never found anything significant. But there’s nothing to say that any regularities have to be at all easy to find. And there’s certainly a possibility that it could take a SETI-like effort to reveal them.


But for now, let’s celebrate the Pi Day of our century, and have fun doing things like finding birthday strings in the digits of pi. Of course, someone like me can’t help but wonder what success there will have been by the next Pi Day of the Century, in 2115, in either SETI or “SETI among the digits”…

This Just In…

Pictures from the Pi Day event:

Pi Day with Wolfram photos

Comments

Join the discussion

!Please enter your comment (at least 5 characters).

!Please enter your name.

!Please enter a valid email address.

41 comments

  1. Thank you for the inspiration to play around with Pi.
    I was pleased to learn that the first 8 digits of Pi can be found, not just at the beginning of Pi, but also at the 50,366,473rd position in the sequence; viz.
    StringPosition[PiString, “31415926”];
    {{1, 8}, {50366473, 50366480}}
    Sadly, the first nine digits were beyond the 10^8 digits in my string.

    The first 8 digits of E are found at position 73154828 of Pi.

    I’ve not found any good lines from Shakespearean in there yet either.
    “We’ve got to get a bigger Mac.”

    Thanks for the entertainment.

    Reply
  2. Hi!

    I found a serious bug on the Find Your Pi Day site.

    I entered “9-2-65” as input because I was interested, what happens, if there’s a match in the beginning, will this spiral displayed or nor – I asked.

    Anyway, as a result, I got 3.14169•2•65 which is totally incorrect. Note digit “6” at position 4. It should be 5. So your code rounds pi instead of chunking!

    Of course at position 14,458 noone will notice the difference, but it’s still an important bug. I would like to order a T-shirt and I would like to make sure that I get a correct one. Now, I’ve got probability of 50% that the result is correct.

    Apart from this, I find this whole thing a great idea.

    Please correct this bug as soon as possible. Pi day is coming!

    Thanks,
    Balázs

    Reply
  3. There is an error in the display of the digits of pi. When 92653 is entered as a date (september 26, 1953), the display correctly shows that this string starts at the 6th digit of pi. However, the digit preceding the 9 is shown as a 6 and it should be 5 (3.141592653).

    Very cool program, though!

    Reply
  4. my BD is 11261960 in the mmddyyyy notation.
    I cannot find it – I am getting error: “somthing wrong with your number… I also tried 112660 or even 11266 with the same error.

    Interesting enough if I use ddmmyyyy (26111960), then it works!

    Reply
    • The neat thing about the Mypiday site, and how easy it was to create, is that it used a general function for computing the birthday string, not something that had to be specialized just for this purpose. It’s impressive how many date styles it catches, but for some nonstandard or mixed alphanumeric ways of entering the date, the interpreter simply needs a little more help. Thanks for your suggestion, we may make some customizations to the site over time to accept more formats.

      Reply
  5. Looks like you’ve got a rounding error in your tool.
    According to http://mypiday.com/results/?date=9-26-53&ck=444086cf you are celebrating pi day one year too early :)

    Anyway nice tool to play with.

    Reply
  6. Thank you for your interesting article and the birth date Pi digit locator – a great combination of science and creativity.

    I like that Pi Day is Albert Einstein’s birthday. Using your tool I can see that his exact birth date is located at pi digit 80,442. So who was born at the location starting pi digit 1 (14th March 1915)? Alexander Brott (a Canadian conductor and composer) and Kenneth Rowntree (a painter). I wonder if either was born at 9:26am

    Happy Pi Day!

    Reply
  7. Hello,
    Thank’s for this post!
    May I suggest a Pi Fool’s day of the century on (d/m/y format) 31/4/15 ?
    – Jean-Marc

    Reply
  8. It would be great if you could offer this in different formats. Right now it’s setup only for US (month-day-year). I would like an option to have day-month-year (anywhere else in the world) or year-month-day (how it should be). Thanks!

    Reply
  9. Found a bug in the mypiday site — if you enter a date like “may241994” it interprets it as may 1, 1994, which is obviously wrong. Shouldn’t be hard to fix!

    Reply
  10. I thought pi never repeats when I enter 12 12 12 it shows 12.12.12

    Reply
    • Thanks for your comment. The digits of pi never settle down into a forever repeating sequence. That doesn’t mean that there can’t be a brief — or even not so brief — sequence of digits that repeat for a small — or even not so small — amount of time, like the 3, and only 3, copies of “12” starting at digit 241988.

      Reply
  11. Hi there,

    an interesting and fascinating feature of PI results from the formula:

    ( PI power 4 + PI power 5 ) take the 6th root out of that and you end up with
    e = 2.71828… up to at least 8-9 digits after the decimal point!

    Fascinating!

    Reply
  12. Glitch: if you try 8/4/62, the digit immediately before the 8 is displayed as 4, but it is a 3 in all other cases.

    Reply
  13. HAHAHAHA – Your machine took 2Pi seconds!!!??? That’s amazing!

    Reply
  14. I have tried all forms of writing my date that I can think of but it seems like Im not part of pi . I was born in 1988 10:29

    Reply
  15. Hi
    This only works for dates in the mmddyy format; English format dates (ddmmyy) get transposed…

    Reply
  16. Hello,

    I tried a random date- December the 14th,2014(14122014 in dd/mm/yyyy format),but for the program that was a wrong date. Try this and see if it’s still wrong!

    Reply
  17. wow.It’s so amazing . I find pi day 80.05.05 *
    Great.Thanks

    Reply
  18. OK, if this program is correct then here’s something very freaky:
    My birth date is 27 Oct 1970 (27.10.70), which according to Find Your Pi Day appears at position 271, 070
    What are the odds of that?!

    Reply
    • I think the answer is 1 in (366*25 + 365*(100 – 25)), because the leap year cycle is periodic and there are up to 25 leap years every century. This works out to 1 in 36,525. Note that this doesn’t take into account years prior to year 1, but that’s well before the Gregorian calendar was developed anyway.

      This of course all becomes much harder to solve if we include 4-digit years, but mypiday.com does not, so I think this answer is reasonable.

      Reply
  19. 31415. immediately left is 5 immediately right is 1413.

    Reply
  20. İt would be great if you do same things for e number

    Reply
  21. Thanks for the great example. However, citing your paper
    Here’s the Wolfram Language code to get the result and turn it into a string
    PiString = StringDrop[ToString[N[Pi, 10^7]], {2}];
    I may notice this is not the code at all. You provide just a primitive syntaxis to extract the results of the internal evaluations. At the same time, the real code been employed for the evaluation of Pi number is not opened. I might guess it would more be fair to share the computational details (e.g., the formula or iterative algorithm used, memory distribution, parallel computing employed if any, as well as the language which was really used).
    Even with a help of a relatively powerless CAS Maxima, I can easily deduce the first 2*10^6 digits of Pi at about 15 seconds at a quite slow nettop produced in 2013.

    Reply
  22. Thanks for your comment. At this moment, the site is fully functional and you can get your My Pi Day results. If you have any further issues please let us know.

    Reply