# How Many Zeros in a Row are Possible in Pi?

**URL:** <https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562>\
**Category:** Factual Questions\
**Tags:** science-math\
**Created:** [September 21, 2024, 5:12pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562 "2024-09-21T17:12:42Z")\
**Posts on this page:** 20\
**Page:** 8

<div class="post-metadata">

**Author:** ![TriPolar](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tripolar/32/3008_2.png) [@TriPolar](https://boards.straightdope.com/u/TriPolar)\
**Post date:** [September 28, 2024, 5:13pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/141 "2024-09-28T17:13:05Z")

</div>

> [@Measure\_for\_Measure](#):
>
> How many digits of pi do we need? NASA typically uses 16, presumably because that’s the double precision representation.

I don’t recall pi being involved, but long ago in a CGI system there was a ‘disappearing star’ problem at great distances. Computed frame to frame stars might blink in and out. The horribly clumsy solution was to change all the floats to double precision to solve this problem. Better solution would have been based on knowing the conditions where this occurred, when an intersection between a ray and a solid that had to be rendered as a single pixel.

---

<div class="post-metadata">

**Author:** ![pulykamell](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pulykamell/32/3166_2.png) [@pulykamell](https://boards.straightdope.com/u/pulykamell)\
**Post date:** [September 28, 2024, 6:37pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/142 "2024-09-28T18:37:15Z")

</div>

> [@robby](#):
>
> You have to look a lot further than that. From the same cite I posted up in Post #11, there is a sequence of 12 zeroes starting at position 1,755,524,129,973.

To be fair, for some reason you didn’t menion that directly in your post, but mentioned 13 consecutive eights, so easy to miss.

---

<div class="post-metadata">

**Author:** ![Ynnad](https://avatars.discourse-cdn.com/v4/letter/y/4491bb/32.png) [@Ynnad](https://boards.straightdope.com/u/Ynnad)\
**Post date:** [September 28, 2024, 7:25pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/143 "2024-09-28T19:25:29Z")

</div>

> [@Jasmine](#):
>
> …I can’t possibly imagine … .

> [@robby](#):
>
> … Also, “you can’t possibly imagine”? Argument from incredulity is a fallacy in informal logic. …

I don’t find Jasmine’s statement incredulous at all. If you define imagine as "to form a mental image of something not present (Merriam Webster), then if you could imagine infinity then you probably don’t really understand infinity.

---

<div class="post-metadata">

**Author:** ![Wendell\_Wagner](https://avatars.discourse-cdn.com/v4/letter/w/8491ac/32.png) [@Wendell\_Wagner](https://boards.straightdope.com/u/Wendell_Wagner)\
**Post date:** [September 28, 2024, 7:41pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/144 "2024-09-28T19:41:21Z")

</div>

> [@robby](#):
>
> here is a sequence of 12 zeroes starting at position 1,755,524,129,973.

That’s about what you expect. There are 1,755,524,129,962 strings of length 12 in the first 1,755,524,129.973 digits of pi. You expect to find about around one of any of the 1,000,000,000,000 different strings of digits, although none of some of them and and somewhat more of some of them.

---

<div class="post-metadata">

**Author:** ![Hari\_Seldon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hari_seldon/32/5173_2.png) [@Hari\_Seldon](https://boards.straightdope.com/u/Hari_Seldon)\
**Post date:** [September 28, 2024, 10:32pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/145 "2024-09-28T22:32:20Z")

</div>

Try your imagination on a googolplex of consecutive 0s. Or on a googolplex of consecutive runs of the complete works of Shakespeare in order of when they were written. Infinity is very big. And, incidentally, nearly every mathematician accepts the idea of infinity. There are finitists that don’t but what they can prove is **severely** limited. There is at least one mathematician named Yesenin-Volpin, who claims that any number larger than, say 1,000,000,000,000 (10^12) is already incomprehensible.

Sometime, in another forum, I may describe an integer sequence whose ultimate end is a genuine surprise.

---

<div class="post-metadata">

**Author:** ![Ynnad](https://avatars.discourse-cdn.com/v4/letter/y/4491bb/32.png) [@Ynnad](https://boards.straightdope.com/u/Ynnad)\
**Post date:** [September 29, 2024, 12:27am UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/146 "2024-09-29T00:27:47Z")

</div>

> [@Hari\_Seldon](#):
>
> … Infinity is very big. …

Interesting thing about infinity is no matter how big you think it is it is bigger than that.

---

<div class="post-metadata">

**Author:** ![wolfpup](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/wolfpup/32/10618_2.png) [@wolfpup](https://boards.straightdope.com/u/wolfpup)\
**Post date:** [September 29, 2024, 12:41am UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/147 "2024-09-29T00:41:41Z")

</div>

> [@Jasmine](#):
>
> Below is the longest calculation I could find on line in a cursory search. Looking at it, nothing seems to be remotely close to repeating ten times in a row:

I would say that your example intuitively seems to counter your argument, because even this very short sequence (relatively speaking) turns up three zeroes in a row twice and, more remarkably, six 9’s in a row.

---

<div class="post-metadata">

**Author:** ![Exapno\_Mapcase](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/exapno_mapcase/32/1051_2.png) [@Exapno\_Mapcase](https://boards.straightdope.com/u/Exapno_Mapcase)\
**Post date:** [September 29, 2024, 12:59am UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/148 "2024-09-29T00:59:08Z")

</div>

I find it interesting that any finite number that has ever been discussed in a talk about **huge** numbers beyond our comprehension is basically 0% of what infinity encompasses. And I know “encompasses” is not right but I had to end that sentence with something.

---

<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:** [September 29, 2024, 1:18am UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/149 "2024-09-29T01:18:02Z")

</div>

> [@Dr.Strangelove](#):
>
> The sequence from your proposal is “random” but is highly compressible.

It’s compressible in the sense that you could encode the first million digits in much less than a million digits. But it’s incompressible in the sense that all the digits would require an infinite number of digits, and with compression would still take an infinite number of digits.

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [September 29, 2024, 1:53am UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/150 "2024-09-29T01:53:52Z")

</div>

> [@Exapno\_Mapcase](#):
>
> I find it interesting that any finite number that has ever been discussed in a talk about **huge** numbers beyond our comprehension is basically 0% of what infinity encompasses. And I know “encompasses” is not right but I had to end that sentence with something.

Sure, in the sense that any “huge” finite number is 0% of infinity. On the other hand, how are you going to define really really huge numbers without talking and thinking about infinity, large cardinals, and things like that? To obtain a huge yet well-defined number, you will need to butt against what it even means to define a number, especially an uncomputable number.

---

<div class="post-metadata">

**Author:** ![robby](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/robby/32/11048_2.png) [@robby](https://boards.straightdope.com/u/robby)\
**Post date:** [September 29, 2024, 2:49am UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/151 "2024-09-29T02:49:43Z")

</div>

> [@pulykamell](#):
>
> > [@robby](#):
> >
> > You have to look a lot further than that. From the same cite I posted up in Post #11, there is a sequence of 12 zeroes starting at position 1,755,524,129,973.
> 
> To be fair, for some reason you didn’t menion that directly in your post, but mentioned 13 consecutive eights, so easy to miss.

My previous post didn’t mention the 12 consecutive zeroes because I was answering a different question (i.e. “what is the longest string of repeated digits that has been observed to date?”)

In any event, my point was that there is a huge difference in looking at the first thousand digits of _π_ (as @Jasmine did in her post), and looking at the next couple of trillions of digits.

It’s hard to wrap one’s head around how large a number 1,755,524,129,973 is.

A thousand seconds is 16.7 hours, whereas 1,755,524,129,973 seconds is 3.3 billion years. Which is how long it would take to count to that number at a rate of one integer per second.

---

<div class="post-metadata">

**Author:** ![Measure\_for\_Measure](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/measure_for_measure/32/557_2.png) [@Measure\_for\_Measure](https://boards.straightdope.com/u/Measure_for_Measure)\
**Post date:** [September 29, 2024, 5:12am UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/152 "2024-09-29T05:12:21Z")

</div>

I understand that there is no perfect random number generator (RNG) (more properly called a pseudorandom number generator, but I’ll dispense with the pseudo-prefix). There are a battery of tests and properties that can be applied or studied. Some examples are listed in the article on the somewhat common RNG, the [Mersenne Twister](https://en.wikipedia.org/wiki/Mersenne_Twister). The standard set of tests is apparently called TestU01.

Before reading this thread it had not occurred to me that pi, the square root of two, e, or functions of the same were random number generators. (I suppose any natural number is also a random number generator in its decimal places, just a really bad one, eg 3.000000000000000000000000… no prizes for guessing the next digit. Set those aside, along with real numbers with obviously repeating digits.)

I am curious how pi, etc. compare with the Mersenne Twister when subjected to the full range of RNG tests and evaluations.

---

<div class="post-metadata">

**Author:** ![Wendell\_Wagner](https://avatars.discourse-cdn.com/v4/letter/w/8491ac/32.png) [@Wendell\_Wagner](https://boards.straightdope.com/u/Wendell_Wagner)\
**Post date:** [September 29, 2024, 6:33am UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/153 "2024-09-29T06:33:11Z")

</div>

Try saying 1,755,524,129,973 in one second.

---

<div class="post-metadata">

**Author:** ![Half\_Man\_Half\_Wit](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/half_man_half_wit/32/21766_2.png) [@Half\_Man\_Half\_Wit](https://boards.straightdope.com/u/Half_Man_Half_Wit)\
**Post date:** [September 29, 2024, 6:52am UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/154 "2024-09-29T06:52:04Z")

</div>

> [@Chronos](#):
>
> It’s compressible in the sense that you could encode the first million digits in much less than a million digits. But it’s incompressible in the sense that all the digits would require an infinite number of digits, and with compression would still take an infinite number of digits.

Typically, when one speaks about the compressibility of infinite sequences, one means the compressibility of the sequence of its finite prefixes—i.e. that for each _n_-bit initial string there exists a program that produces them that’s much shorter than _n_ bits in length. Such a number is then not [algorithmically random](https://en.wikipedia.org/wiki/Algorithmically_random_sequence?wprov=sfla1):

> Given a natural number c and a sequence w, we say that w is c-incompressible if K(w)\geq |w|-c.  
> An infinite sequence S is Martin-Löf random if and only if there is a constant c such that all of S’s finite prefixes are c-incompressible. More succinctly, K(w)\geq |w|-O(1).

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [September 29, 2024, 10:29am UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/155 "2024-09-29T10:29:59Z")

</div>

> [@Measure\_for\_Measure](#):
>
> Before reading this thread it had not occurred to me that pi, the square root of two, e, or functions of the same were random number generators. (

Since you can compute the digits, they are not in the least bit random.

> [@Measure\_for\_Measure](#):
>
> I am curious how pi, etc. compare with the Mersenne Twister when subjected to the full range of RNG tests and evaluations.

There is a note where someone ran the suite of Diehard tests on a few billion digits of \pi, e, \sqrt{2} et al. and they basically passed all the tests. This is something you can easily try yourself!

---

<div class="post-metadata">

**Author:** ![robby](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/robby/32/11048_2.png) [@robby](https://boards.straightdope.com/u/robby)\
**Post date:** [September 29, 2024, 3:22pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/156 "2024-09-29T15:22:39Z")

</div>

> [@robby](#):
>
> A thousand seconds is 16.7 hours, whereas 1,755,524,129,973 seconds is 3.3 billion years…

Whoops, it looks like I was off by a factor of 60 in both my calculations above. Let me try again:

I should have written: “A thousand seconds is 16.7 _ **minutes** _, whereas 1,755,524,129,973 seconds is 55,629 years.”

I’m surprised I didn’t notice my mistake sooner, especially the first one. So much for wrapping my head around large numbers.

---

<div class="post-metadata">

**Author:** ![pulykamell](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pulykamell/32/3166_2.png) [@pulykamell](https://boards.straightdope.com/u/pulykamell)\
**Post date:** [September 29, 2024, 3:26pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/157 "2024-09-29T15:26:17Z")

</div>

So it’s doable is what you’re saying? 😉

---

<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:** [September 29, 2024, 3:54pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/158 "2024-09-29T15:54:49Z")

</div>

> [@DPRK](#):
>
> There is a note where someone ran the suite of Diehard tests on a few billion digits of \pi, e, \sqrt{2} et al. and they basically passed all the tests. This is something you can easily try yourself!

At the same time, however, you could also devise another test for randomness, that each of those numbers would fail (though that test might or might not catch any other given number).

---

<div class="post-metadata">

**Author:** ![Measure\_for\_Measure](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/measure_for_measure/32/557_2.png) [@Measure\_for\_Measure](https://boards.straightdope.com/u/Measure_for_Measure)\
**Post date:** [September 29, 2024, 6:26pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/159 "2024-09-29T18:26:02Z")

</div>

> [@DPRK](#):
>
> Since you can compute the digits, they are not in the least bit random.

Neither is the Mersenne Twister, nor the KISS PRNG, or any other PRNG. (I probably should have kept the prefix since the concept is central to what we’re discussing.)

I see that the late and great George Marsaglia, author of the Diehard test collection, ran them on pi, etc: [in _On the Randomness of Pi and Other Decimal Expressions_](http://yaroslavvb.com/papers/marsaglia-on.pdf). Abstract:

> Tests of randomness much more rigorous than the usual frequency-of-digit counts are applied to the decimal expansions of π, e and √2, using the Diehard Battery of Tests adapted to base 10 rather than the original base 2. The first 10^9 digits of π, e and √2 seem to pass the Diehard tests very well. But so do the decimal expansions of most rationals k/p with large primes p. Over the entire set of tests, only the digits of √2 give a questionable result: the monkey test on 5-letter words. Its significance is discussed in the text.  
> Three specific k/p are used for comparison. The cycles in their decimal expansions are developed in reverse order by the multiply-with-carry (MWC) method. They do well in the Diehard tests, as do many fast and simple MWC RNGs that produce base-b ‘digits’ of the expansions of k/p for b = 2^32 or b = 2^32 −1. Choices of primes p for such MWC RNGs are discussed, along with comments on their implementation.

What is the monkey test?

> Among the many hundreds of p-values reported in the appendix, there was only one case that might raise an eyebrow—the monkey test for 5-letter words on the digits of √2. In this test, we imagine the (√2) monkey is randomly striking a keyboard with ten keys and find, after a string of 10 million keystrokes, how many times each 5-letter word (5-digit number) appears.

This is probably a false positive result. It appears that Marsaglia didn’t run further testing on square root 2 in order to highlight the possibility of false positives (as well as hidden regularities).

---

<div class="post-metadata">

**Author:** ![Ynnad](https://avatars.discourse-cdn.com/v4/letter/y/4491bb/32.png) [@Ynnad](https://boards.straightdope.com/u/Ynnad)\
**Post date:** [September 29, 2024, 6:44pm UTC](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562/160 "2024-09-29T18:44:02Z")

</div>

> [@Measure\_for\_Measure](#):
>
> What is the monkey test?

Every time I here about this I always first think about that time about 22 years ago when someone tried this with actual monkeys. According to Wikipedia -

“Not only did the monkeys produce nothing but five total pages largely consisting of the letter ‘S’, the lead male began striking the keyboard with a stone, and other monkeys followed by urinating and defecating on the machine.”

[Previous page](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562.md?page=7)

[Next page](https://boards.straightdope.com/t/how-many-zeros-in-a-row-are-possible-in-pi/1007562.md?page=9)
