Log In  


Cart #pixled_peczu_manymonkeys-0 | 2024-07-27 | Code ▽ | Embed ▽ | No License
2

I made a thing.

You can't do anything in it but its fun to watch.

Maybe it will write the complete works of Shakespeare, but who knows?

2


The chances of it typing out Hamlet is 1 in 27^130,000 (that's literally infinity according to the google calculator) because Hamlet has about 130,000 words and there seems to be 27 available characters in this program (including spaces.)


@cypress good thing that theory involves infinite monkeys, infinite typewriters, and infinite timeframe


@VgBlade,

In other words, it's impossible, because you can't gather infinite monkeys or build infinite typewriters, and you don't have infinite time.

It's somewhat amusing to see if an actual word to two manages to show up, though.


@JadeLombax, I think you're right for the wrong reasons.
The 1 in 27^130000 is an approximation that makes sense but is based on the false assumption that the random generator is perfect.
You don't need infinite time to fail after just one or two random letters.

The reason I think you're correct and the probability of writing hamlet is a flat zero, is that pico-8's rng is based on a 32bits seed.
So regardless of the original seed, even if we tried again and again, we'd still get a cyclic string of reapeated length 2^32.
If the string doesn't contain Hamlet, or a shifted version of it, then your chances of getting it is simply zero.
If you want to be 100% sure, just generate the whole string to file with printh, and you'll get a nice 4GB text file.
Search the file for "to be or not to be" with grep and after finding no match, do a last visual test as the phrase could be starting at the end of the file and finishing at the start.
Once that's checked; you can know for sure that the probability was actually zero all along...

Except I'm making the assumption that the computer that runs pico-8 works perfectly... If cosmic rays can flip bits in the computer's memory and that results in the complete works of Shakeseare, that means that the probability is not zero, just way lower than AlrtCypress estimate.


@RealShadowCaster,

I don't deny that a functionally recognizable version of Shakespeare instead of a perfect one would improve the odds, but making it even a trillion times less unlikely would be only a drop in the bucket. The numbers involved are still unfathomable.



[Please log in to post a comment]