# Diabolical Digits

The other day, I did a mini-investigation into an interesting maths tweet from Cliff Pickover. Here’s another:

This is a beautiful and bewildering fact. It feels startling and mysterious: a DVD Easter Egg the universe has hidden away in the deepest recesses of one of its most sacred numbers. A decimal jewel, buried deep in the dark heart of mathematics, where only the hardiest of numerical explorers could ever hope to find it. How thrillingly unlikely that such a numerological alignment should occur almost eighty million digits into π’s infinite irrational tail. Surely this is a secret message from a higher power? Could such an amazing occurence really be mere coincidence…?

Well, yes it could. After all, the 1st digit after the decimal point of π is 1, but I don’t see anyone getting too excited about that. Attractive though the tweeted observation is, should we actually find it surprising? Let’s have a think.

Although it is not proven, to the best of our knowledge, the digit sequence of π is effectively indistinguishable from a sequence of randomly selected digits. In other words, the digits appear to have all of the properties that we would expect a (uniform) random sequence to have: every digit seems to turn up equally frequently, as does every possible pair of consecutive digits and every possible run of three digits, etc. Indeed there are various sites that allow you to search pi for any string of digits you like (which I had some fun with earlier today).

If the digits of π behave as if they were random, that means that if we pick an eight-digit number, like Cliff Pickover’s above, and we stick a pin into a card on which we have written the first billion digits of π (it’s a big card), the probability that the eight digits reading from our pin onwards match our chosen number should be equal to 1/108 or 1 in 100 million. This is because there are 100 million equally probable runs of 8 digits (from 00000000 to 99999999) that we could stumble across, and only one of them is the number we are looking for.

Now let’s suppose we are looking for a fact like the one in the tweet. That is, we are looking for a number N which appears in π when reading from the Nth digit onwards (counting after the decimal point). The number given in the tweet has eight digits; how likely should it be to find an eight-digit number of this kind?

The first chance for this to happen occurs at the 10000000th digit. If that one is no good (i.e. if the ten millionth to the ten million and seventh digits of π are not 10000000*) we can keep on looking until we reach our final opportunity at the 99999999th digit. That gives us ninety million possible opportunities to find such a number. Now, using the stuff about probabilities that we discussed above, the chance of finding what we are looking for at each of these ninety million opportunities is 1 in 100 million. That means that the expected number of eight-digit examples like the one in the tweet is 90 million divided by 100 million, which is equal to 0.9. In other words, we should expect there to be about one example like the one in the tweet.

Going further, we can use something called the binomial distribution to calculate the probability of finding an eight-digit example like the one in the tweet, and it is a pretty hefty 59%.** Not such a surprising result really then. There is even quite a decent chance (23%) of finding more than one eight-digit example.

Actually, what I have said is not quite right, because your ninety million chances are not quite independent. For example, if you have not found a solution at the ten millionth digit or the ten million and first digit, that gives you a tiny bit of information about how likely you are to find a solution at the ten million and second digit. However, I believe this dependence is really very weak indeed, because the previous errors could have been in any one of eight digits and only rarely could knowing that you have failed to find a solution impact negatively on your chances further down the line. I think that treating each opportunity as being independent is a pretty reasonable simplification.

All this reasoning can be extended very simply to think about how likely you are to find an example with D digits. You should get 10D – 10D-1 opportunities to find a D-digit example. The probability that you will discover what you are looking for at each opportunity is 1/10D, so you should expect to find about (10D – 10D-1)/10D = 0.9 examples for each choice of D, your number of digits, which is the same value that we calculated for numbers with eight digits.

In other words, it doesn’t matter how many digits you choose*** the expected number of examples that you find is always close to 1. There should be about one example with four digits, about one example with six digits, about one example with seventeen digits, about one example with four billion digits and so on and so on. For some numbers of digits (in about 41% of cases) you will find no examples, but for others (about 23% of cases) you will find two or more. Altogether, if you look through the first 10D digits of π, you should find about 9D/10 examples like the one in the tweet, with varying numbers of digits.

Of course, none of this takes away from the fact that the original tweet highlights an arrestingly beautiful mathematical fact. However, while we can appreciate its aesthetic qualities, we should also understand that it is not particularly surprising.

Thomas Oléron Evans, 2015

* Spoiler alert: They aren’t. The ten millionth to the ten million and seventh digits of π are actually 22150588.

** Taking p = 0.00000001 and n = 90000000 and using a Poisson approximation to the Binomial, which should be very good indeed for all the parameters considered in this article.

*** The Poisson approximation is actually valid to the nearest percent for the figures that I have quoted for D > 2 (and it is very close for D = 0 and D = 1).