For a pretty terrific novelization of this concept, ie., a vast library with an incomprehensible number of books with finite pages and random permutations of characters, check out the novella A Short Stay in Hell by Steven L. Peck.
Putting it another way, there is no “almost surely” because “almost surely” is a probabilistic concept, while the digits of pi are not random. They are fixed values defined by mathematics. So either the decimal expansion of pi either does contain every finite sequence of digits or it doesn’t.
Eh, why not go and read the original Borges stuff? Which is itself obviously influenced by previous philosophical ideas. However, in any case, those types of libraries contain a finite (and not even that large, as finite numbers go) number of books, while the digits of pi, of course, go on forever.
Yes. I meant “countless” in the casual sense. I should have said something like “more than 10^5000 partial versions of Hamlet”
My apologies to Andy_L and Exapno_Mapcase. I was just trying to be super-pedantic, which seems to be encouraged here.
My favorite example of something that’s more likely to be found than the complete text of Hamlet is “The complete text of Hamlet, except Hamlet is renamed Steve”.
If only because Steve requires one fewer exact string of letters than Hamlet.
I wonder how the search space for these unlikely sequences compares to ginormous numbers such as TREE(3).
It’s not even close. It’s not even close to being close. It’s not even close to the number of times I’d have to say “close” to accurately describe how close to being close it is.
If you are talking about what I think you are talking about, that is a finite number. Whereas pi has infinitely many, non-repeating, digits. So you might be searching for a while. However, for a short text like Hamlet it’s probably not an issue ![]()
But you didn’t say which way.
How many words are there in Hamlet? Less than a million? Given a random stream of digits, how long would you expect to search before hitting a given 1000000-digit string? Not that many.
Yeah. Which is bigger, because I’m not sure? TREE(3), right?
There are a lot of worms in that can. Too hijacky for this thread, but probability can certainly be defined and applied to something like the digits of pi, depending on the interpretational framework you want to adopt.
Here are a few more fun options:
Pretty sure it’s TREE(3), because TREE(3) is quite larger than Graham’s Number, and Graham’s Number itself is too small to be written in the universe with only power towers (i.e. 3^3^3^3…etc.)
Whereas the probability of any given book could probably be something like 1/30^(number of characters in the book). Which isn’t even a power tower let alone one that cannot be written in the entire universe.
The worst case is a run of, say, a million, zeros, but (probably…) that only takes 10^{10^6}+10^{10^6-1}+\cdots digits or so to randomly occur, if I am not mistaken.
Okay, I’ve thought about it some more: if it takes one million decimal digits to encode “Hamlet”, then an infinite normal string would have “Hamlet” occur on average 1/101,000,000 of the time. If you searched 101,000,000 such 101,000,000-long strings, you would have about a 36% (1/e) chance of finding it. That’s trivial compared to TREE(3).
Oh duh. That’s so obvious now.
30,557, according to Hamlet - Shakespeare's Plays Available in Streaming - Research Guides at University of Southern California .
Thanks. I did not specify exactly how the text is to be encoded as decimal digits, but even if it takes more than a million, it will not be orders of magnitude more.