Of course, we've all heard the colloquialism "If a bunch of monkeys pound on a typewriter, eventually one of them will write Hamlet."

I have a (not very mathematically intelligent) friend who presented it as if it were a mathematical fact, which got me thinking... Is this really true?  Of course, I've learned that dealing with infinity can be tricky, but my intuition says that time is countably infinite while the number of works the monkeys could produce is uncountably infinite.  Therefore, it isn't necessarily given that the monkeys would write Hamlet.

Could someone who's better at this kind of math than me tell me if this is correct?  Or is there more to it than I'm thinking?

I found online the claim (which we may as well accept for this purpose) that there are $32241$ words in Hamlet.  Figuring $5$ characters and one space per word, this is $193446$ characters.  If the character set is $60$ including capitals and punctuation, a random string of $193446$ characters has a chance of $1$ in $60^{193446}$ (roughly $1$ in $10^{344000}$) of being Hamlet.  While very small, this is greater than zero.  So if you try enough times, and infinity times is certainly enough, you will probably produce Hamlet.  But don't hold your breath.  It doesn't even take an infinite number of monkeys or an infinite number of tries.  Only a product of $10^{344001}$ makes it very likely.  True, this is a very large number, but most numbers are larger.