$\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 ?

A plate of momos
  • 6,906
  • 3
  • 11
  • 38
  • 7,271
  • 3
  • 15
  • 12
  • 96
    This is unknown. All that is known about $\pi$ is that it is transcendental. http://www.askamathematician.com/2009/11/since-pi-is-infinite-can-i-draw-any-random-number-sequence-and-be-certain-that-it-exists-somewhere-in-the-digits-of-pi/ – picakhu Oct 18 '12 at 14:38
  • 1
    It makes sense as a mathematical sentence. The truthness of it, in specific of the fact: "every possible number combination exists somewhere in $\pi$" is not clear as crystal to me. But perhaps an expert can say something about it. – Giovanni De Gaetano Oct 18 '12 at 14:39
  • 10
    but it is easy to construct a number containing all finite sequences of numbers : consider 0.123456789 01 02 ... 99 ... 001 002 ... 999 0001 0002 ... 9999 etc – Albert Oct 18 '12 at 14:40
  • 24
    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
  • 99
    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
  • 52
    What is certain, is that the 94 first digits of pi do indeed contain [the answer to all the great questions of the universe](http://www.google.com/search?q=the+answer+to+life%2C+the+universe+and+everything) – mivk Oct 18 '12 at 15:36
  • 26
    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
  • 2
    Even if this were true, it'd be impossible to use it to tell the future or anything -- at best, you could piece together the (undoubtedly infinite) list of possible sequences of events, but you'd still have no way of knowing which one is the right one. – Aaron Mazel-Gee Oct 18 '12 at 22:51
  • Can we, in principle, non-arbitrarily decide whether any "yes" or "no" answer to this question ends up as true or false? Could an answer to "does pi contain every finite sequence of digits in a given base?" exist? – Doug Spoonwood Oct 19 '12 at 22:03
  • See a related question you could find interesting : http://mathematica.stackexchange.com/questions/6323/finding-long-strings-of-identical-digits-in-transcendental-numbers – Artes Oct 25 '12 at 23:14
  • 3
    Note that you could also ask: "If I keep writing random characters for eternity, is it true that I will have solved all the great problems of the universe at some point?" – Martin Konicek Oct 28 '12 at 10:05
  • Related: [Since pi is infinite, do its digits contain all finite sequences of numbers?](http://www.askamathematician.com/2009/11/since-pi-is-infinite-can-i-draw-any-random-number-sequence-and-be-certain-that-it-exists-somewhere-in-the-digits-of-pi/) – kenorb May 12 '15 at 13:52
  • 3
    Regarding "and the answers to all the great questions of the universe", the answer is yes, of course, at least in base 10! Digits 92 and 93 in the decimal expansion (not counting the integer part) are "42" which, as you know, is *[The Answer to the Ultimate Question of Life, the Universe, and Everything](https://en.wikipedia.org/wiki/Phrases_from_The_Hitchhiker%27s_Guide_to_the_Galaxy#Answer_to_the_Ultimate_Question_of_Life.2C_the_Universe.2C_and_Everything_.2842.29)*: 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253***42*** – Jay Sep 03 '15 at 16:53
  • Pi is the library of babel of numbers –  Nov 12 '15 at 05:43
  • Of course it all boils down to a searching problem. – kleineg Sep 13 '17 at 14:35
  • This reminds me of the short story “La Biblioteca de Babel” by Jorge Luis Borges. – Franklin Pezzuti Dyer Sep 13 '19 at 15:48
  • Such a number is called a normal number. It is not known whether pi is normal or not(to the base 10) –  Oct 11 '20 at 12:17
  • So pi had a breakup with zero long back and they never did patch up. Just take 100 or 1000 or 10000 or any multiple of 10 except 10 :) – Pawan Saxena Mar 12 '22 at 22:28

12 Answers12


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.

Brian M. Scott
  • 588,383
  • 52
  • 703
  • 1,170
  • 760
    I'll bet this answer is in there too. – makerofthings7 Oct 19 '12 at 02:02
  • 23
    @makerofthings7: Yes, a representation of the entire internet would be in there too. Every representation, in fact. – BlueRaja - Danny Pflughoeft Oct 19 '12 at 02:34
  • 84
    Why does it seem likely, that the decimal expansion of π contains every possible finite string of digits? – Alex Oct 19 '12 at 09:53
  • 80
    @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: http://en.wikipedia.org/wiki/Normal_number#Properties_and_examples – Qiaochu Yuan Oct 19 '12 at 16:52
  • 1
    @makerofthings7: If it didn't, could anyone prove you wrong? (I'm assuming a single, agreed-upon conversion from decimal digits to characters.) – LarsH Oct 19 '12 at 19:50
  • 7
    I bet you made Borges, up there in Asgard, smile with your comment about the books that will never be written :-) – Mariano Suárez-Álvarez Oct 21 '12 at 06:02
  • 23
    @Mariano: Oh, there’s a book that someone ought to write: *Borges in Asgard*! :-) – Brian M. Scott Oct 21 '12 at 09:45
  • 1
    Not everything will be written, since the probability of occurring deminishes rapidly the deeper you go into pi. Consider repeating all the previous digits of pi. The deeper you go into pi, the more you have to repeat. Is there truly a point where all the previous digits have been repeated? – Stefan Gruenwald Aug 01 '16 at 05:07
  • 1
    @Stefan: If $\pi$ is a normal number, every finite string of digits occurs infinitely often in its decimal expansion, so yes, every finite text *will* appear. – Brian M. Scott Oct 14 '16 at 11:05
  • 2
    Philosophical question: if we are considering the set of books that will **never** be written, must it only contain books that are finite in length? :) – Erick Wong Nov 03 '16 at 02:27
  • 5
    @Erick: Well, it would contain arbitrarily good approximations to the infinite ones. And it definitely would contain books that have been written and are infinite in length as far as my reading them goes! – Brian M. Scott Nov 03 '16 at 02:33
  • 7
    It seems likely to me that the binary equivalent of the source code of Half-Life 3 is contained within pi. – Erik Dec 14 '17 at 16:01
  • The sequence you used while not-repeating contains a pattern, so I ask, regardless of pi, will an infinite sequence that is non-repeating and also without a pattern (randomly generated (as a bonus, generated from a pseudo rng)) contain every combination of numbers? – user500668 Aug 06 '18 at 16:11
  • 5
    Yay, I just gave this its $3^6$-th upvote :-) – joriki Mar 17 '20 at 20:25
  • 2
    @goodguys_activate's comment now has 666 upvotes. Upvote at your own peril. – Ray Bradbury Nov 18 '20 at 17:18
  • 1
    So does it mean that pi contains other irrational numbers like e and pi itself? – Jdeep Mar 29 '21 at 07:38
  • 1
    @Jdeep: Every tail — the string of digits starting at some point — represents an irrational number, but there are uncountably many irrational numbers and only countably many tails, so most irrational numbers are not found as strings of consecutive digits of $\pi$. – Brian M. Scott Mar 29 '21 at 17:15
  • "it also contains numerical equivalents of every book that will never be written", i'm writing a book containing enough decimals of PI plus one (ex : 3.252603), so pi does not contain my book. But if someone tells me that my book was found in pi, new chapters will be added. – Michel Apr 15 '22 at 05:17

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.)

Qiaochu Yuan
  • 359,788
  • 42
  • 777
  • 1,145
  • 21
    "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
  • 13
    What if you layout all the sentences in order of usefulness? :P – naught101 Oct 21 '12 at 05:55
  • It is _slightly_ less useless that the expansion of $\pi$, if normal, contains formal machine-checkable proofs of every theorem in your favorite axiomatic system. At least for those we can check whether what we have is right or not. (Your first and third objections still apply in full force of course). – hmakholm left over Monica Oct 25 '12 at 21:32
  • So you're saying that even though (assuming it has the property) it has every combination of communications, you wouldn't be able to simply read it and say "Oh my, look at all the communication"? You could only look for a specific communication until you found it, which you would eventually? Or am I missing your fundamental point. – corsiKa Dec 01 '12 at 02:52
  • 4
    @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 01 '12 at 03:16
  • 2
    @didibus Not really, because natural language satisfies a form of Turing-completeness: you could just say "The answer to problem X is, in binary, one one zero one ..." and proceed to give a binary encoding of a description of your "improved" language followed by an encoding of the message itself. Thus any other Turing-complete language can be delivered in English (and most other natural languages in use). – Mario Carneiro Feb 05 '14 at 14:13
  • Even if you found the most gramatically correct, meaningful and truthful message, how could you tell it from a false one? In fact for each in the former set there should be very many in the later. – moonshine Aug 05 '16 at 14:46
  • Yes, the answer to all of life's great questions are buried in the digits of Pi. And all of the WRONG answers are in there too! Just like the bible codes. – richard1941 Oct 05 '16 at 17:23
  • Just wanted to add that there exists a real online [Library of Babel] (https://libraryofbabel.info/) – Anguepa Feb 09 '17 at 22:44
  • 3
    **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
  • 1
    "Useful communication is useful because of what it does not contain." Great quote! – JobHunter69 Jan 28 '18 at 02:09
  • Great answer! I remember Chaitin mentioning a mental exercise by Borel that there exists a real number that encodes all knowledge. It's mentioned here: http://platoandthenerd.org/blog/are-real-numbers-real That number has the property of having only right answers. Problem is knowing the encoding, as you mentioned. – Acuariano Dec 11 '19 at 14:49
  • Most of the work goes into finding a reasonable hypothesis to test -Can't remember who – kleineg Apr 07 '20 at 18:13
  • the last statement is same as barber's paradox – vidyarthi Jul 08 '20 at 19:16
  • So a library needs a spam filter. Most email servers started in the library, as did AV/AS. So maybe this technology can help us clean our minds and live happier. – makerofthings7 Dec 09 '20 at 01:06

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.

  • 30,888
  • 4
  • 58
  • 139
  • 285
    And you wouldn't believe the terrible spelling. – Scott Rippey Oct 18 '12 at 19:33
  • 8
    @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
  • 1
    @Charles Errr.. It's normal in the sense that the digits are distributed uniformly. – MickLH Feb 17 '17 at 22:24
  • 5
    @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 01:33
  • I see what you're saying! thanks for clarifying – MickLH Feb 18 '17 at 01: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.)


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

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

  • 8,125
  • 1
  • 26
  • 40
  • 12
    Please advise: where does 'pi' or 'π' occur? – QED Oct 19 '12 at 02:53
  • 2
    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 09:56
  • 5
    @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](http://en.wikipedia.org/wiki/Law_of_excluded_middle). – whuber Oct 19 '12 at 13:40
  • 1
    @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
  • Yes I just meant to ask where the string "pi" appears, or "π" in Unicode (whatever), as a muse. Thanks! – QED Oct 19 '12 at 15:40
  • 1
    @whuber: I agree it's a philosophical question, though I don't think my question "starts" us going there... I'm just asking whether Feynman's claim (as described by you) is true. So if my question is philosophical, Feynman's statement is too. :-) Too often physicists and mathematicians (Sagan and Hawking are egregious examples) make dazzling statements with strong philosophical components, without doing the requisite philosophical homework. They end up making a mess, then often try to fix the mess by deciding that any reality that doesn't fit their paradigm isn't worth considering. – LarsH Oct 19 '12 at 20:17
  • 12
    @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
  • @whuber: gotcha. – LarsH Oct 19 '12 at 21:11

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


  • 2,176
  • 2
  • 13
  • 16

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.

Dan Burton
  • 801
  • 5
  • 4
  • 46
    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
  • 10
    It has the use of getting people interested in mathematics (e.g. it motivated [this question](http://math.stackexchange.com/questions/216343)). – Douglas S. Stones Oct 19 '12 at 00:27
  • 4
    @DouglasS.Stones I agree, it *does* provoke interest in mathematics. – Chani Oct 19 '12 at 05:03
  • 5
    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 08:05
  • 7
    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
  • It has use in the existence of pseudorandom number generators which centers around the important question of whether $P=BPP$ in complexity theory. – Couchy Jun 14 '16 at 03:01
  • @DanBurton haha amazing i am gonna use that whenever i say something stupid! – void Jan 09 '18 at 05:18
  • @DanBurton I am going to prove pi is normal someday just so I can use "I was quoting pi" as an excuse to things. – PyRulez Feb 15 '19 at 06:33

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.

J. W. Tanner
  • 1
  • 3
  • 35
  • 77
  • 41,457
  • 11
  • 67
  • 130
  • It can't be known if ANY sequence contains all possible combinations of numbers, as that is infinite and unreachable. – Ky. Oct 21 '12 at 06:52
  • 19
    @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.

  • 503
  • 3
  • 8

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/):


  • 1,190
  • 1
  • 10
  • 18

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.

  • 9,773
  • 4
  • 43
  • 93

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.

  • 393
  • 2
  • 6

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).

Michael Rozenberg
  • 185,235
  • 30
  • 150
  • 262