How Many Zeros in a Row are Possible in Pi?

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.

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

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.

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.

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.

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

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.

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.

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.

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.

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.

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

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

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:

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

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

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!

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.

So it’s doable is what you’re saying? :wink:

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

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

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