I found online the claim (which we may as well accept for this purpose) that there are 32241$32241$ words in Hamlet. Figuring 5$5$ characters and one space per word, this is 193446$193446$ characters. If the character set is 60$60$ including capitals and punctuation, a random string of 193446$193446$ characters has a chance of 1$1$ in 60^193446 $60^{193446}$ (roughly 1$1$ in 10^344000$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$10^{344001}$ makes it very likely. True, this is a very large number, but most numbers are larger.