Sorry if this has been asked before, but I have a query about the notion that the decimal expansion of $\pi$ contains every possible string of numbers (please note that I am only a "casual" maths enthusiast). If it does, then would the expansion not contain $\pi$ itself? (I.e. 3.1415926...31415926...) That would make $\pi$ a repeating decimal which could, in theory, be represented as an exact fraction. If we constrict the argument to say that $\pi$ only contains every finite sequence of numbers, then wouldn't that be contradictory (we would see 3, 31, 314, 3141, 31415... so why not all the way? We could always add another digit to create a longer finite string ad infinitum)?

Thank you in advance.

  • 7,564
  • 5
  • 33
  • 62
Naota Feykneme
  • 319
  • 2
  • 4
  • 9
    If the decimal expansion of $\pi$ contains every finite sequence of digits (which is considered likely, but not proven), that certainly doesn't mean that it contains every infinite sequence of digits! For instance, how could it contain both the infinite sequence $111...$ and the infinite sequence $777...$? You should be able to convince yourself that that would be absurd. – TonyK Jun 05 '15 at 21:17
  • 3
    @RossMillikan: It's not really a duplicate, because the other question is only about _finite_ strings of digits appearing in $\pi$. – TonyK Jun 05 '15 at 21:22
  • 1
    The Wikipedia article about [normal numbers](http://en.wikipedia.org/wiki/Normal_number) may be of interest to you. This part is closely related to your question: "it is widely believed that the numbers √2, π, and e are normal, but a proof remains elusive." – kasperd Jun 05 '15 at 22:49
  • Look up "pifs" it's a filesystem that stores files as the offset where they occur in full in pi - yes really. – Alec Teal Jun 06 '15 at 05:58
  • @AlecTeal, [not that it's actually usable](https://news.ycombinator.com/item?id=8018818), due to the pigeonhole principle. – Wildcard Jan 12 '17 at 22:36
  • 3
    Possible duplicate of [Does Pi contain all possible number combinations?](http://math.stackexchange.com/questions/216343/does-pi-contain-all-possible-number-combinations) – Ernesto Iglesias Feb 15 '17 at 15:16

3 Answers3


The claim is only about finite strings (and apart from this, it is only conjectured, has not been proven). In fact your what-if argument is sound and would show that $\pi$ is rational. The fact that it is not rational (in fact, transcendental) shows that it cannot contain itself in a nontrivial manner.

Regarding the second question: No, all finite strings does not imply a given infinite string. In fact, the number $$0.123456789101112131415161718192021222324\ldots $$ obtained by concatenating all natural numbers provably contains every finite string, and among these $3$, $31$, $314$, $3141$ and so on, but certainly (though perhaps not obviously) not the full expansion of $\pi$.

Hagen von Eitzen
  • 1
  • 29
  • 331
  • 611
  • 6
    "...certainly (though perhaps not obviously)...": I agree that it's not obvious! Why is it even true? I mean, I know in my heart of hearts that it's true, but I can't see how to prove it. – TonyK Jun 05 '15 at 21:12
  • It's far from obvious to me either. – user7530 Jun 05 '15 at 21:17
  • 1
    Because it contains all *finite* strings but the full expansion of pi would be *infinite*? – Roman Reiner Jun 05 '15 at 21:27
  • So, essentially, it boils down to an argument that it is impossible for one infinite, ordered set $S_1$ to be a subset of a different infinite, ordered set $S_2$ (i.e., $S_1 \not\subset S_2$ holds strictly)? – hBy2Py Jun 05 '15 at 21:37
  • @Brian: Assuming you mean what I think you mean, no, that's not the point. Why would it be impossible? For instance, if $S_1$ is the digits of $\pi$ from the $100$-th position, and $S_2$ is the digits of $\pi$ from the $50$-th position, then certainly $S_2$ contains $S_1$. – TonyK Jun 05 '15 at 21:42
  • @TonyK Ah, good point. More nuanced than that, then. – hBy2Py Jun 05 '15 at 21:42
  • 2
    @Brian The non obviousness of the fact that $\pi $ is not contained in the concatenation of all natural numbers seems quite high. – DRF Jun 06 '15 at 04:51
  • Yes I second the request for a proof that $π$ is not hiding in the Champernowne constant. I don't think it's so sneaky, but I can't see why. – user21820 Jun 06 '15 at 06:18
  • 2
    The more I thinbk of it (or the more you guys make me think of it) my claim is really far from straightforward. A proof that $\pi$ does occur would make $\pi$ base-10-normal, so finding such proof is hopeless. All we have is this: For all finite strings we can easily name a position explicitly where it occurs, for all of $\pi$ it is at least not easy. However if such a position exists (somewhere in the middle of an $n$-digit integer, say) then the first $10^{n/2}n$ or so digits of $\pi$ turn out nearly regular and this should give rise to an unusually good rational approximation ... and then?? – Hagen von Eitzen Jun 06 '15 at 06:39
  • @DRF I'm absolutely not a mathematician, so my ability to evaluate such things is limited, but it's still really interesting. – hBy2Py Jun 06 '15 at 10:35
  • @TonyK I realized just now that my formulation was even wrong. The digits of pi are a "semi-infinite" set, in the sense that it has a defined starting point but no endpoint. (The term is comparable to how the integers are "fully infinite" but the positive integers are "semi-infinite" -- not sure what the proper mathematical term is.) – hBy2Py Jun 06 '15 at 10:36
  • @brian Actually the "infinity" is the same what you are thinking of is more about the order on the set. You can easilly give the same order that the integers have to the positive integers it's just somewhat non-standard (think of defining the function $f:\mathbb{N}\to\mathbb{Z}$ by $$f(n)= \begin{cases} k &\textrm{ if } n=2k\\ -k&\textrm{ if } n=2k+1\\ 0 &\textrm{ if } n=0\\ \end{cases}$$ you can then pull back the order by defining $n\preceq m$ iff $f(n)\leq f(m)$. – DRF Jun 06 '15 at 10:57
  • 3
    @TonyK One can put together the (non-trivial) facts that the irrationality measure of $\pi$ is less than $7.6063$ (see [here](http://mathworld.wolfram.com/IrrationalityMeasure.html)) and the irrationality measure of the Champernowne constant is 10 (see [here](https://en.wikipedia.org/wiki/Champernowne_constant)). Rational translations & dilations preserve irrationality measure thus thus no relation of the form $C_{10}=k\cdot 10^{-n}+10^{-{n+1}}\pi$ exists for integers $n$ and $k$ meaning $\pi$ isn't contained in the Champernowne constant. (This is using difficult modern results though) – Milo Brandt Jan 12 '16 at 01:31
  • @Milo: Looks good to me! – TonyK Jan 12 '16 at 09:38
  • @HagenvonEitzen does saying that since digits of pi is infinite, if somewhere it starts as 31415.... then it needs to go forever which in turn prevents 32......... from occurring work? – user500668 Aug 07 '18 at 08:40

There are a number of observations that would lead to the conclusion that having every finite string as a substring is totally different from having every infinite string as a substring.

Firstly, "$100111000011111000000...$" contains (as a substring) every finite string consisting of only ones or only zeroes, but it does not contain the infinite strings consisting of only ones or only zeroes.

Secondly, concatenating all positive integers yields "$12345678910111213...$" that contains every positive integer but does not contain the infinite string "$0000...$" because every positive integer has finitely many zeroes. This is a much easier statement to verify than Hagen's claim that it does not contain $π$.

Thirdly, the number of substrings that a string contains is countable, and the number of infinite strings is uncountable, so any given string will not contain almost all infinite strings.

Fourthly, your attempt to justify your hypothesis is logically flawed in a crucial way. If an infinite string $x$ contains every finite string, it means:

  For every finite string $y$:

    For some position $p$:

      $y$ occurs in $x$ at position $p$.

It does not imply:

  For some position $p$:

    For every finite string $y$:

      $y$ occurs in $x$ at position $p$.

which is what you would need to conclude that:

  For some position $p$:

    $π$ occurs in $x$ at position $p$.

This switching of quantifiers is an extremely common logical error but it should be very obvious if you wrote it out the way I did.

  • 53,491
  • 7
  • 84
  • 231

A short an concise answer is the following:

$\pi$ is a non-repeating irrational number. If you were to find a subset that contains all the digits of $\pi$, that would mean the digit sequence UP TO THAT POINT would be identical to the sequence starting from that point onwards. Until you get to the same point inside that subset, where a further subset identical to that starts. Therefore, $\pi$ would start being repetitive from that point on, to infinity. Since $\pi$ is non-repeating, that cannot be true. Therefore there isn't such a point. (see https://i.stack.imgur.com/Xazkv.png)

If you want to do the some "experimental math" you can search through the digits of $\pi$ for sequences of $\pi$ with your browser here:

The results are for

10000 digits:

3:  975 hits
31: 91 hits
314: 16 hits
3141: 1 hits

100000 digits:

3:  10028 hits
31: 966 hits
314: 92 hits
3141: 8 hits
31415: 1 hits

1000000 digits:

3 : 100230 hits 
31: 9758 hits 
314: 971 hits 
3141: 89 hits 
31415: 8 hits 
314159 : 1 hit

So one could come up with the following "law": To find a sequence of $\pi$ with $n$ digits inside $\pi$ itself, you need about $10^n$ digits of $\pi$. So to find the $\infty$ digits of $\pi$ you would need $10^{\infty}$ digits of pi, which should convince you, that you should not try to do that with your browser.

  • 2,424
  • 17
  • 29