# Does $\pi$ contain all possible number combinations?

I came across the following image: Which states:

$$\pi$$ Pi

Pi is an infinite, nonrepeating $$($$sic$$)$$ decimal - meaning that every possible number combination exists somewhere in pi. Converted into ASCII text, somewhere in that infinite string of digits is the name of every person you will ever love, the date, time and manner of your death, and the answers to all the great questions of the universe.

Is this true? Does it make any sense ?

• This is unknown. All that is known about $\pi$ is that it is transcendental. askamathematician.com/2009/11/… – picakhu Oct 18 '12 at 14:38
• This is the assertion that $\pi$ is base $8$ normal. Whether it is true is not known. But it is known that "most" numbers are normal to every base. – André Nicolas Oct 18 '12 at 14:40
• It's not just the assertion that $\pi$ is normal. It also asserts that it is normal because its expansions is infinite and nonrepeating. And that's just plain false. – Chris Eagle Oct 18 '12 at 14:41
• What is certain, is that the 94 first digits of pi do indeed contain the answer to all the great questions of the universe – mivk Oct 18 '12 at 15:36
• The assertion is strictly weaker than normality. It only says each string occurs once. This implies infinitely many occurrences but not equidistribution. – Erick Wong Oct 18 '12 at 17:44

It is not true that an infinite, non-repeating decimal must contain ‘every possible number combination’. The decimal $0.011000111100000111111\dots$ is an easy counterexample. However, if the decimal expansion of $\pi$ contains every possible finite string of digits, which seems quite likely, then the rest of the statement is indeed correct. Of course, in that case it also contains numerical equivalents of every book that will never be written, among other things.

• I'll bet this answer is in there too. – halfbit Oct 19 '12 at 2:02
• @makerofthings7: Yes, a representation of the entire internet would be in there too. Every representation, in fact. – BlueRaja - Danny Pflughoeft Oct 19 '12 at 2:34
• Why does it seem likely, that the decimal expansion of π contains every possible finite string of digits? – Alex Oct 19 '12 at 9:53
• @Alex: there's no particular reason for the digits of $\pi$ to have any special pattern to them, so mathematicians expect that the digits of $\pi$ more or less "behave randomly," and a random sequence of digits contains every possible finite string of digits with probability $1$ by Borel's normal number theorem: en.wikipedia.org/wiki/Normal_number#Properties_and_examples – Qiaochu Yuan Oct 19 '12 at 16:52
• @Mariano: Oh, there’s a book that someone ought to write: Borges in Asgard! :-) – Brian M. Scott Oct 21 '12 at 9:45

Let me summarize the things that have been said which are true and add one more thing.

1. $\pi$ is not known to have this property, but it is expected to be true.
2. This property does not follow from the fact that the decimal expansion of $\pi$ is infinite and does not repeat.

The one more thing is the following. The assertion that the answer to every question you could possibly want to ask is contained somewhere in the digits of $\pi$ may be true, but it's useless. Here is a string which may make this point clearer: just string together every possible sentence in English, first by length and then by alphabetical order. The resulting string contains the answer to every question you could possibly want to ask, but

• most of what it contains is garbage,
• you have no way of knowing what is and isn't garbage a priori, and
• the only way to refer to a part of the string that isn't garbage is to describe its position in the string, and the bits required to do this themselves constitute a (terrible) encoding of the string. So finding this location is exactly as hard as finding the string itself (that is, finding the answer to whatever question you wanted to ask).

In other words, a string which contains everything contains nothing. Useful communication is useful because of what it does not contain.

You should keep all of the above in mind and then read Jorge Luis Borges' The Library of Babel. (A library which contains every book contains no books.)

• Nice reference! That's a fun read. – Manny Reyes Oct 18 '12 at 22:47
• "So finding this location is exactly as hard as finding the string itself" - indeed, rather harder: if I know how long a message is, I have an upper bound on the inormation contained in the encoding. But I have no upper bound on the information needed to represent the index into any given normal number. – Charles Stewart Oct 19 '12 at 12:06
• What if you layout all the sentences in order of usefulness? :P – naught101 Oct 21 '12 at 5:55
• @corsiKa: what I'm saying is that the location of a message in $\pi$ is itself information, and that location doesn't come for free. Trying to communicate information by pointing to where it is in $\pi$ constitutes an extremely inefficient encryption algorithm. – Qiaochu Yuan Dec 1 '12 at 3:16
• finding this location is exactly as hard as finding the string itself That's not true: there is a number called $\hat{\pi}$ which is the index for reading the answers in $\pi$ ;-p – Ernesto Iglesias Feb 15 '17 at 14:42

It is widely believed that $\pi$ is a normal number. This (or even the weaker property of being disjunctive) implies that every possible string occurs somewhere in its expansion.

So yes, it has the story of your life -- but it also has many false stories, many subtly wrong statements, and lots of gibberish.

• And you wouldn't believe the terrible spelling. – Scott Rippey Oct 18 '12 at 19:33
• @SydKerckhove: It's normal in the sense that almost all numbers have this property. Numbers like 7 and 4/3 that lack this property are very rare indeed (though still infinite). – Charles Jan 30 '15 at 17:21
• @Charles Errr.. It's normal in the sense that the digits are distributed uniformly. – MickLH Feb 17 '17 at 22:24
• @MickLH But the reason that the property is called "normal" rather than, say, "weird" is that it occurs in a measure 1 subset of the reals. – Charles Feb 18 '17 at 1:33
• I see what you're saying! thanks for clarifying – MickLH Feb 18 '17 at 1:35

According to Mathematica, when $$\pi$$ is expressed in base 128 (whose digits can therefore be interpreted as ASCII characters),

• "NO" appears at position 702;

• "Yes" appears at position 303351.

Given (following Feynman in his Lectures on Physics) that any question $$A$$ with possible answer $$A'$$ (correct or not) can be re-expressed in the form "Is $$A'$$ a correct answer to $$A$$?", and that such questions have either "no" or "yes" answers, this proves the second sentence of the claim--and shows just how empty an assertion it is. (As others have remarked, the first sentence--depending on its interpretation--is either wrong or has unknown truth value.)

### Code

pNO = FromCharacterCode[RealDigits[\[Pi], 128, 710]];
pYes = FromCharacterCode[RealDigits[\[Pi], 128, 303400]];
{StringPosition[pNO, "NO"], StringPosition[pYes, "Yes"]}


{{{{702, 703}}, {}}, {{{303351, 303353}}, {}}}

• Please advise: where does 'pi' or 'π' occur? – QED Oct 19 '12 at 2:53
• Is it true 'that any question A with possible answer A′ (correct or not) can be re-expressed in the form "Is A′ a correct answer to A?"' Does that reduce the "all the great questions of the universe" to some inferior subset? I don't know, just asking. – LarsH Oct 19 '12 at 9:56
• @LarsH That's a good question--but it starts to push us more into philosophy than mathematics. This re-expression of every great question as a yes-no question requires that you accept that every such question does have a definite answer and that you also accept the Law of the Excluded Middle. – whuber Oct 19 '12 at 13:40
• @psoft I do not understand your question. One possible interpretation is that you are asking where the string "pi" occurs. The first occurrence, up to case, is at position 566, where "PI" is seen. In general, if $\pi$ is indeed locally normal, then we would expect to see any $k$-digit string (up to case) appear approximately within the first $128^k / 2^k$ = $2^{6k}$ positions. For $k=2$ that's $2^{12}$=$4096$ and for $k=3$ that's $2^{18}\approx 250000$. These estimates are consistent with what we have seen for "no", "pi", and "yes". Finding a given 5+ character string may be difficult! – whuber Oct 19 '12 at 13:46
• @Lars I was just riffing off Feynman, not quoting him. What he actually said is that there likely is a single equation describing all the laws of physics. As I recall, just collect all the basic equations of physical law (presumably finite in number), express them each in the form $u_i=0$, and then write $\sum_i |u_i|^2 = 0$. This trivial re-expression of things that look complicated into something superficially looking much simpler was my motivation for arguing all the great questions of life can be made into yes-no questions. – whuber Oct 19 '12 at 20:43

This is an open question. It is not yet known if $\pi$ is a normal number.

http://mathworld.wolfram.com/NormalNumber.html

• or even disjunctive. – LarsH Oct 19 '12 at 19:57

Whether or not it's true, it's absolutely useless.

Imagine finding your life story: a copiously documented and flawless recounting of every day of your life... right up until yesterday where it states that you died and abruptly reverts back to gibberish. If pi truly contains every possible string, then that story is in there, too. Now, imagine if it said you die tomorrow. Would you believe it, or keep searching for the next copy of your life story?

The problem is that there is no structure to the information. It would take a herculean effort to process all of that data to get to the "correct" section, and immense wisdom to recognize it as correct. So if you were thinking of using pi as an oracle to determine these things, you might as well count every single atom that comprises planet Earth. That should serve as a nice warm up.

• nb. if it is true, then you can justify any rambling, gibberish, or errors with the excuse, "I was just quoting pi". – Dan Burton Oct 18 '12 at 22:41
• It has the use of getting people interested in mathematics (e.g. it motivated this question). – Douglas S. Stones Oct 19 '12 at 0:27
• @DouglasS.Stones I agree, it does provoke interest in mathematics. – Chani Oct 19 '12 at 5:03
• It would also take about the same amount of information to specify the location that an arbitrary string starts in pi at as the string contains. – dan_waterworth Oct 19 '12 at 8:05
• I doubt anybody expects to get any information about their life from π. It's just an interesting way to imagine infinity. – redbmk Oct 19 '12 at 17:22

In general it it not true that an "infinite non-repeating decimal" contains any sequence in it. Consider for example the number $$0.01001000100001000001000000100000001...$$.

However, it is not known if $$\pi$$ does contain every sequence.

• It can't be known if ANY sequence contains all possible combinations of numbers, as that is infinite and unreachable. – Ben Leggiero Oct 21 '12 at 6:52
• @Supuhstar unless the sequence is specifically defined with that in mind, like by concatenating numbers consecutively: $0.12345678910111213141516...$ – Robert Mastragostino Oct 22 '12 at 16:47

This is False. Claim: Infinite and Non-Repeating, therefore must have EVERY combination.

Counterexample: 01001100011100001111... This is infinite and non-repeating yet does not have every combination.

Just because something is infinite and non-repeating doesn't mean it has every combination.

Pi may indeed have every combination but you cant use this claim to say that it does.

Challenge accepted. In the following file are the first 1,048,576 digits (1 Megabyte) of pi (including the leading 3) converted to ANSI (with assistance from the algorithm described in https://stackoverflow.com/questions/12991606/):

• @MarkHurd someone should try running it :3 – Ben Leggiero May 7 '16 at 15:16
• someone already ran it – Hernán Eche Jul 22 '16 at 18:58
• @HernánEche and? – Ben Leggiero Jul 22 '16 at 20:08
• and.. we are the running code effects, living in a matrix-like universe simulation, encoded in pi. – Hernán Eche Jul 26 '16 at 12:43
• But at which position does "every possible number combination" appear? – Mike Rosoft Jun 5 '20 at 19:04

And even if your statement is true with $\pi$, it does not make $\pi$ special. If we hit a real number at random, with probability $1$ we will hit a normal number. That is "almost all" real number is like that. The set of not-normal numbers have Lebesgue measure zero.

• How do you know that the set of non-normal numbers is Lebesgue measurable? – celtschk Jul 12 '15 at 8:29
• Please give a cite, or literature for that answer!!!!! It is a big deal to say something like that. – Ernesto Iglesias Feb 15 '17 at 14:36
• I found a cite for this result, but I can't say if it is acurete or not: math.boku.ac.at/udt/vol09/no2/06filsus.pdf – Ernesto Iglesias Feb 15 '17 at 15:05

I believe the statement could be worded more accurately. Given the reasonable assumption that PI is infinitely non repeating, it doesn't follow that it would actually incude any particular sequence.

Take this thought experiment as an analogy. Imagine you had to sit in a room for all eternity sayings words, without every ever uttering the same word twice. You would very soon find yourself saying very long words. But there's no logical reason why you should have to use up all the possible short words first. In fact you could systematically exclude the words "yes" or every word containing the letter "y", or any other arbitrary subset of the infinite set of possible words.

Same goes for digit sequences in PI. It's highly probably that any conceivable sequence can be found in PI if you calculate for long enough, but it's not guaranteed by the prescribed conditions.

Yes and no. Yes, any non-repeating infinite sequence can be translated into an ascii representation of random gibberish, which will of course randomly contain everything. No, that isn't particularly amazing or useful, because whatever message you are looking for is also mistated and refuted an infinite number of times.

(For those that say that it isn't necessarily normal, that is unnecessary as the transformation into ascii can be as complex as you like in order to get the result you desire).

• If you allow arbitrarily complex encodings, you get the same result with 0 as with pi. – dhasenan Oct 19 '12 at 18:49
• @dhasenan: that's not complex, that is just eliminating the value you are supposedly encoding and replacing it with a non-repeating infinite sequence. – jmoreno Oct 21 '12 at 22:58

That image contains a number of factual errors, but the most important one is the misleading assertion that irrationality implies disjunctiveness.

One can easily construct an non-disjunctive, irrational number. Let $r = \sum\limits_{n = 0}^\infty 2^{-n} \begin{cases} 1 & \text{if } 2 | n \\ s_n & \text{else} \end{cases}$ for any non-periodic sequence $s_n \in \{0,1\}$.

It is not known whether $\pi$ is, in fact, disjunctive (or even normal).