The infinite monkey theorem has been cast in numerous ways over the years. Some versions have it that an infinite number of monkeys will inevitably tap out the complete works of Shakespeare; others restrain the number of simians, but extend the allowed time period; and then there’s a good proportion (including The Simpsons) who re-cast the theorem as some variation of “[X] monkeys typing over a period of [Y] will produce [INSERT LARGE/FAMOUS BODY OF WORK]“.
These latter variations on a theme often choose a million monkeys, and Hamlet seems to be a common target. Throw in a bit of “The Hitchhiker’s Guide to the Galaxy” to provide the characters and setting for an experimental version of the theory and you’ve got a comic strip.
This experiment has actually been done – albeit with virtual monkeys. Of course it could also be argued that, given a large enough pool of humans, one of them would almost certainly produce a computer simulation of this experiment. In fact, given enough humans and enough time, the creation of this whole comic was inevitable.