# Do irrational numbers contain every finite-length string?

**URL:** <https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724>\
**Category:** Factual Questions\
**Created:** [May 4, 2007, 7:55am UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724 "2007-05-04T07:55:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Engywook](https://avatars.discourse-cdn.com/v4/letter/e/bc8723/32.png) [@Engywook](https://boards.straightdope.com/u/Engywook)\
**Post date:** [May 4, 2007, 7:55am UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/1 "2007-05-04T07:55:20Z")

</div>

I was having a friendly debate this evening as to whether any finite-length string of numbers must occur at least once in any irrational number.

Example 1:  
_π_ to any _n_ digits will eventually show up in the square root of 2, and vice versa. Same goes for _π_ and _e_, _e_ and 2^1/2, and for that matter any pair of irrational numbers (transcendental or not).

Example 2:  
The unicode for any written expression will appear at least once within any irrational number, including - if you wait long enough - the complete works of Shakespeare, the Bible, and even this short phrase closely related to my username:  
“Nothing happens more than once, but all things must happen some day.”

My thinking on this has been that every string must happen at least once, and if once, how not an infinite number of times? Now, I’ll concede that’s intuition talking, and that means I’m the one with the burden of proof here.

So I did a bit of research. Didn’t have to get any further than Wikipedia to find this (to me) startling observation:

> [@](#):
>
> it is not even known which of the digits 0,…,9 occur infinitely often in the decimal expansion of π

If that means there may be a point in π where, for example, you’ll never see a number 7 again, that’s quite a puncture in my point of view on irrational numbers. It also means I’ve got a number of sizeable holes in my understanding of number theory, but that ain’t news.

So… might there be a finite-length string of numbers that never occur in the decimal form of a given irrational number? And if all finite-length strings must occur once, can they appear a finite number of times in an irrational number?

Closing remark: to keep the discussion simple, let’s keep it in base 10 for now if nobody objects.

---

<div class="post-metadata">

**Author:** ![Baffle](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@Baffle](https://boards.straightdope.com/u/Baffle)\
**Post date:** [May 4, 2007, 8:14am UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/2 "2007-05-04T08:14:42Z")

</div>

The irrational number 0.1010010001000010000010000001000000010000000100000000010000000000100000000000100000000000001… (where every one is separated by an increasing number of zeroes) doesn’t contain the digits 2 through 9 at all.

---

<div class="post-metadata">

**Author:** ![Engywook](https://avatars.discourse-cdn.com/v4/letter/e/bc8723/32.png) [@Engywook](https://boards.straightdope.com/u/Engywook)\
**Post date:** [May 4, 2007, 8:37am UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/3 "2007-05-04T08:37:45Z")

</div>

[QUOTE=Baffle]  
The irrational number 0.1010010001000010000010000001000000010000000100000000010000000000100000000000100000000000001… (where every one is separated by an increasing number of zeroes) doesn’t contain the digits 2 through 9 at all.  
[/QUOTE]

Of course you’re right about that. :smack:

Rephrasing more restrictively:  
Might there be a finite-length string of numbers that never occur in the decimal form of _π_, _e_, or the square root of 2? And if all finite-length strings must occur once, can they appear only a finite number of times in any of these numbers?

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [May 4, 2007, 8:40am UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/4 "2007-05-04T08:40:51Z")

</div>

**Baffle** basically nailed it. Incidentally, the properties many people erroneously think hold of all irrationals (or to at least be known to hold of the special ones like e, pi, and sqrt(2)) are basically those of the [normal numbers](http://en.wikipedia.org/wiki/Normal_number), which are those such that, no matter what base you express them in, the asymptotic frequency of any given string is the same as would be expected were the digits chosen randomly; i.e., if K is normal, then, for every base b string S of length n, the number of occurrences of S in the first p digits of K’s base b expansion approaches 1/b^n as p gets large.

It’s fairly easy to prove that “almost all” real numbers are normal (which basically means that, if you pick a random real from [0, 1), then the probability it will be normal is 1; it’s not guaranteed, not at all, but it’s very, very likely), and it’s not hard to give explicit definitions of numbers that are clearly provably normal, but pretty much no “nice” numbers like e, pi, or sqrt(2) are known to be normal, even though most mathematicians suspect they are.

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [May 4, 2007, 8:43am UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/5 "2007-05-04T08:43:30Z")

</div>

And, yes, concerning our three favorite examples of irrational numbers (e, pi, sqrt(2)), for each, it might well be the case that there is some finite-length string of numbers that never occurs in them. After all, for none of them is it known that every digit occurs infinitely; and if some digit doesn’t occur infinitely, then, clearly, a long enough string composed solely of that digit doesn’t occur at all.

---

<div class="post-metadata">

**Author:** ![kellner](https://avatars.discourse-cdn.com/v4/letter/k/c2a13f/32.png) [@kellner](https://boards.straightdope.com/u/kellner)\
**Post date:** [May 4, 2007, 9:03am UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/6 "2007-05-04T09:03:18Z")

</div>

[QUOTE=Engywook]  
And if all finite-length strings must occur once, can they appear only a finite number of times in any of these numbers?  
[/QUOTE]  
If _all_ finite-length string must occur, then that won’t work. For every string there is an infinite number of longer strings that contain the first one as a substring and have to occur, too.

---

<div class="post-metadata">

**Author:** ![LSLGuy](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lslguy/32/5813_2.png) [@LSLGuy](https://boards.straightdope.com/u/LSLGuy)\
**Post date:** [May 4, 2007, 12:21pm UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/7 "2007-05-04T12:21:46Z")

</div>

Make sure you’re clear on the various sizes of infinity before you go too far into this swamp. I don’t know enough to add to the current level of discussion, but to my (rusty) math-intuition it sure smells like the different concepts now in play rely on different levels of infinity.

---

<div class="post-metadata">

**Author:** ![CalMeacham](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/calmeacham/32/35_2.png) [@CalMeacham](https://boards.straightdope.com/u/CalMeacham)\
**Post date:** [May 4, 2007, 12:31pm UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/8 "2007-05-04T12:31:05Z")

</div>

The guy who used random-number generators (W.R. Bennett. See “How Artificial is Intelligence?” in American Scientist, 1977) once said that there wasn’t enough “randomness” in quasi-random number generators to produce enough noise to produce even a meaningful portion of a work of Shakespeare. Depending on how your random numbers are produced, then, it’s not a given that random noise will produce anything specific – even the very first line from _Hamlet_, let alone the entire works of Shakespeare.

---

<div class="post-metadata">

**Author:** ![Quercus](https://avatars.discourse-cdn.com/v4/letter/q/7ab992/32.png) [@Quercus](https://boards.straightdope.com/u/Quercus)\
**Post date:** [May 4, 2007, 2:13pm UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/9 "2007-05-04T14:13:01Z")

</div>

[QUOTE=Engywook]  
And if all finite-length strings must occur once, can they appear only a finite number of times in any of these numbers?  
[/QUOTE]  
Maybe I’m misunderstanding the question, but it seems very unlikely to me that the finite-length string “7” only appears a finite number of times in the infinite decimal expansion of _e_. Though I suspect real mathematicians will have something to say about how to define ‘finite’ in this case, and also the difference between ‘very unlikely’ and ‘provably not’.

---

<div class="post-metadata">

**Author:** ![Squink](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@Squink](https://boards.straightdope.com/u/Squink)\
**Post date:** [May 4, 2007, 2:26pm UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/10 "2007-05-04T14:26:16Z")

</div>

[Pi – The Source Of All Information?](http://boards.straightdope.com/sdmb/showthread.php?s=&threadid=82654)  
[QUOTE=ricksummon]  
( **OP** )  
I’ve heard that because pi is a transcendental number, there is no discernable pattern in its digits, and that this means that ANY sequence of digits can be found somewhere in pi.  
[/QUOTE]

[QUOTE=Chronos]  
What we know: First, there’s numbers which are called “normal” which have this property. Second, there’s far more normal numbers than there are non-normal numbers, although specific examples are hard to come by. Third, it’s very widely believed (though not yet proven) that the digits of pi are normal.  
[/QUOTE]

---

<div class="post-metadata">

**Author:** ![alterego](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@alterego](https://boards.straightdope.com/u/alterego)\
**Post date:** [May 4, 2007, 5:28pm UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/11 "2007-05-04T17:28:07Z")

</div>

Since when does “belief” count for anything in mathematics? Unless you are talking about Bayesians, knowing what other people believe but cannot prove in this field is practically pointless.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [May 4, 2007, 5:34pm UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/12 "2007-05-04T17:34:43Z")

</div>

[QUOTE=alterego]  
Since when does “belief” count for anything in mathematics? Unless you are talking about Bayesians, knowing what other people believe but cannot prove in this field is practically pointless.  
[/QUOTE]

Belief goes a long way towards determining what new research gets done.

---

<div class="post-metadata">

**Author:** ![alterego](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@alterego](https://boards.straightdope.com/u/alterego)\
**Post date:** [May 4, 2007, 5:43pm UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/13 "2007-05-04T17:43:21Z")

</div>

[QUOTE=ultrafilter]  
Belief goes a long way towards determining what new research gets done.  
[/QUOTE]

But belief does not mean that I should apply any credence to the idea whatsoever. It wouldn’t be the first time mathematicians have been wrong.

> **[Google Search](https://www.google.com/search?q=godel%27s+incompleteness+theorem)**

---

<div class="post-metadata">

**Author:** ![Squink](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@Squink](https://boards.straightdope.com/u/Squink)\
**Post date:** [May 4, 2007, 6:06pm UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/14 "2007-05-04T18:06:16Z")

</div>

[QUOTE=ultrafilter]  
Belief goes a long way towards determining what new research gets done.  
[/QUOTE]  
[Hacking Away at Pi (2001):](http://www.sciencenews.org/articles/20010901/bob9.asp)

> [@](#):
>
> Pi would be considered normal to base 10 if any single digit appears one-tenth of the time, any two-digit combination one-hundredth of the time, any three-digit combination one-thousandth of the time, and so on.
> 
> Bailey and other researchers amassed statistical evidence in the 1980s supporting the notion that pi is normal. For example, one would expect the digit 7 to appear 1 million times among the first 10 million decimal digits of pi. It actually occurs 1,000,207 times—close to the expected value. Each of the other digits also turns up with approximately the same frequency, showing no significant departure from predictions.
> 
> In 1999, Yasumasa Kanada and his colleagues at the University of Tokyo computed pi to a record 206 billion decimal digits (SN: 10/16/99, p. 255). Their analysis shows that 7 appears 19,999,967,594 times among the first 200 billion decimal digits.
> 
> Last year, statistician Ted Jaditz of CNA Corp. in Alexandria, Va., systematically extended this type of frequency analysis of pi’s digits to clusters up to 16 digits long. His statistical tests show no significant deviation from what would be expected for a string of random numbers.

---

<div class="post-metadata">

**Author:** ![Engywook](https://avatars.discourse-cdn.com/v4/letter/e/bc8723/32.png) [@Engywook](https://boards.straightdope.com/u/Engywook)\
**Post date:** [May 4, 2007, 7:03pm UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/15 "2007-05-04T19:03:11Z")

</div>

[QUOTE=Squink]  
[Pi – The Source Of All Information?](http://boards.straightdope.com/sdmb/showthread.php?s=&threadid=82654)  
[/QUOTE]

Yup… there I go - answers to all my questions. Thanks! Too bad they weren’t thinking of the three-letter lower limit on SDMB searches when pi was named back in the 18th century.

Curiously enough, where I was going with this would have been encoding large datasets by pointing to a start and end point within a normal number (in theory, since you’d need to have an infinitely large hard drive to store all of it). But the point that you’d need even more data to encode the addresses of the start and end digits is well made.

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [May 4, 2007, 7:04pm UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/16 "2007-05-04T19:04:14Z")

</div>

[QUOTE=alterego]  
But belief does not mean that I should apply any credence to the idea whatsoever. It wouldn’t be the first time mathematicians have been wrong.

> **[Google Search](https://www.google.com/search?q=godel%27s+incompleteness+theorem)**

[/QUOTE]

Fair enough on belief not lending the same level of credence proof, though mathematicians are capable of holding strong beliefs with substantial evidence (possibly of the inductive kind) which falls short of proof, same as anyone else (physicists, biologists, historians, average Joes). [And, as **Squink** mentions, there is substantial inductive evidence for believing in the normality of π]. The only difference is that mathematicians place value in the distinction and strive towards complete proof as the ultimate goal, but if you think there are any situations in which evidence can have epistemic value despite falling short of full proof, then you can understand how mathematicians can make and find value in educated conjectures.

I don’t know what your invocation of Goedel’s Incompleteness Theorem is supposed to demonstrate, and I must warn that almost all invocations of it in a context like this are extremely sloppy; it seems very likely that it doesn’t say what you think it does. If it’s merely meant as an example a particular theorem where mathematicians’ beliefs turned out to be wrong, it’s far from clear that people had an expressed strong belief in its negation before it was discovered (it was a shocking result, to be sure, but probably more along the lines of most people having not thought of the possibility than most people having thought of the possibility and concluded it unlikely on the grounds of some evidence or another). Better examples could be found of inductively grounded mathematical conjecture going wrong; for example, [the Pólya conjecture](http://en.wikipedia.org/wiki/P%C3%B3lya_conjecture). Nonetheless, as I said before, if you feel there is ever any epistemic value in evidence short of full proof, then presumably the same can hold in mathematics.

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [May 4, 2007, 7:11pm UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/17 "2007-05-04T19:11:43Z")

</div>

[QUOTE=Engywook]  
Curiously enough, where I was going with this would have been encoding large datasets by pointing to a start and end point within a normal number (in theory, since you’d need to have an infinitely large hard drive to store all of it). But the point that you’d need even more data to encode the addresses of the start and end digits is well made.  
[/QUOTE]

This does often come up as a flawed method of compression, but thankfully you’ve realized the problem. You wouldn’t need an infinitely large hard drive, though; just pick a computable normal number and be off on your merry way, computing as many digits as you need whenever you need them. (You wouldn’t even need a normal number, per se, just one in which every string occurred; I imagine the expected starting points will be lower with a random normal number than with a random “Every string occurs” number, but since the method is flawed in this regard anyway…)

I had actually conjectured to myself that you were thinking about the matter because of the whole HD-DVD key kerfuffle, the sort of thing that makes people want to say “Hey, but if this string is merely the \<something\>th through \<something\>th digits of pi, then we can’t be stifled from sharing the mathematical information.”, or things like that.

---

<div class="post-metadata">

**Author:** ![Indistinguishable](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@Indistinguishable](https://boards.straightdope.com/u/Indistinguishable)\
**Post date:** [May 4, 2007, 7:15pm UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/18 "2007-05-04T19:15:16Z")

</div>

[QUOTE=Indistinguishable]  
Fair enough on belief not lending the same level of credence **as** proof, _…_  
[/QUOTE]

[QUOTE=Indistinguishable]  
If it’s merely meant as an example **of** a particular theorem _…_  
[/QUOTE]

Just fixing my (elided word) typos despite the edit window being gone…

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [May 4, 2007, 7:24pm UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/19 "2007-05-04T19:24:58Z")

</div>

OK, if you don’t like “belief”, then let’s put it this way.

Absolutely normal numbers exist.  
The quantity of absolutely normal numbers is infinitely larger than the quantity of non-(absolutely normal) numbers.  
Therefore, any number selected based on criteria not relevant to the normality of the number is overwhelmingly likely to be absolutely normal.  
pi is not known to not be absolutely normal, and has no known properties which relate to lack of absolute normality.  
The conclusion is left as an excercise for the reader.

---

<div class="post-metadata">

**Author:** ![Squink](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@Squink](https://boards.straightdope.com/u/Squink)\
**Post date:** [May 4, 2007, 8:28pm UTC](https://boards.straightdope.com/t/do-irrational-numbers-contain-every-finite-length-string/402724/20 "2007-05-04T20:28:07Z")

</div>

[QUOTE=Chronos]  
The conclusion is left as an excercise for the reader.  
[/QUOTE]  
Rhubarb Pie may be had for free each Thursday, between the hours of two and four! 😉
