Here is a figure we are rather proud of: 99.995% of all ten-digit numbers appear somewhere in the first 100 billion decimals of π. Most phone numbers, written the way you dial them at home, are ten digits or fewer, so yours is very probably in there.
But where does that figure come from? We didn't just count (although we did count, and the count agrees). It falls out of some surprisingly friendly maths, and you can follow every step of it.
Step 1: pretend π is a dice
Nobody has proved that π's digits are random, but every test ever done says they behave as if they were: like rolls of a fair ten-sided dice, each digit equally likely, each roll independent of the last. (If you want the full story of what is and isn't proved, read is every number really in π?)
So let's pretend. Each new decimal of π is a roll of the dice.
Step 2: one window, one lottery ticket
Now picture a frame ten digits wide, sitting on π. Whatever is inside it is a ten-digit number. There are 10 billion possible ten-digit numbers, from 0000000000 to 9999999999, so the chance that the frame shows your number is one in 10 billion.
That is like a lottery with 10 billion possible tickets. Every time we slide the frame one digit along, we get a new draw. Our digits give us about 100 billion draws.
Step 3: the chance of never winning
With odds of one in 10 billion each time and 100 billion goes, you would expect to "win" about ten times. But winning on average isn't the same as winning at least once. What we want is the chance of losing every single time.
For one draw, the chance of losing is very close to 1: it is 1 minus one in 10 billion. For lots of draws, you multiply that chance by itself once per draw. And when you multiply a number very close to 1 by itself an enormous number of times, something lovely happens: the answer is given by the famous number e (about 2.718). The chance of never seeing your number after N digits is
e^(−N ÷ 10 billion)
(Strictly, the frames overlap, so the draws aren't perfectly independent. For most numbers that makes almost no difference.)
Step 4: plug in the numbers
Our digits give N = 100 billion, so N ÷ 10 billion = 10. The chance of a particular number being missing is e^(−10): tiny, well under one in ten thousand.
Flip it round and you get the headline: 99.995% of all ten-digit numbers are found. Multiply the tiny missing chance by all 10 billion numbers and about 454,000 are left out. When we built our table, we counted the empty lines, and the count landed right where this maths said it should.
How deep is a typical number?
The same formula tells you how far you usually have to go. Half of all ten-digit numbers have turned up by about 7 billion digits in, and by 46 billion digits, 99 out of every 100 of them have. Shorter numbers are much quicker to find, because every digit you remove makes the lottery ten times easier:
- A 4-digit PIN typically first turns up around 7,000 digits in.
- A 6-digit birthday (like 140399) around 700,000.
- An 8-digit birthday (like 14031999) around 70 million.
- A ten-digit phone number around 7 billion.
Why 2 billion digits wasn't enough
This site was inspired by a podcast conversation in which two presenters looked for their phone numbers in the first 2 billion digits and didn't find them (the story is in the idea that started this site). The maths says that's no surprise at all. With 2 billion draws, N ÷ 10 billion is only 0.2, so the chance of a number still being missing is e^(−0.2): better than four in five. Only 18% of ten-digit numbers have turned up by then, and about 8.2 billion are still missing. Searching fifty times deeper flips the odds from "probably not" to "almost certainly".
What if yours is missing?
Then you are in a very exclusive club of about 454,000 numbers. You also aren't out of luck: we look for the longest piece of your number that does appear, and show you that instead. And remember that π goes on for ever. Your number is very probably in there somewhere deeper, just past where anyone has looked.
Try it
- Find your phone number, written the way you dial it at home.
- See how far apart two numbers are using the same lottery maths.
- Read how the table was built.
Sources
- Wikipedia: e (mathematical constant), including the "compound interest" limit used above.
- Wikipedia: Normal number
- Wikipedia: Poisson distribution, the maths of rare events.
- Google Cloud: Calculating 100 trillion digits of pi on Google Cloud