Okay, I did my back-of-the envelope calculations. I think it would take a little less than 10^346,938 monkeys to be sure to type out Hamlet, giving them each the amount of time necessary to type out a Hamlet length document (about 48 monkey work hours). Overall, it would take a little less than 10^346,937 monkey work years to accomplish this, in any # of monkeys/amount of time combination that you'd like.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Calculations and reference links below:
Characters in Hamlet: 173,467*
Numbers of characters to choose from for typing monkeys: 97**
So, how do we calculate the number of ways to arrange 97 characters into a string 173,467 characters long? I think it's just 97^173,467 power.
In other words, the first time a monkey typed out a 173,467 long document, it would have a 1/(97^173,467) chance of being Hamlet. To make it so that there's only 1 in a million chance the monkeys won't type out hamlet (a functional sure thing*** that that they will type out hamlet) I think I would need (97^173,467)x999,999 monkeys to make it a functionally sure thing that one of them would type out Hamlet in the length of time it takes each of them to type out a Hamlet length document.
If I round 97 up to 100 and 999,999 to 1,000,000, that means I would need less than (100^173,467)x1,000,000 = ((10^2)^173,467)x(10^6) = (10^346,932)x(10^6)=10^346,938.
So I'd need something less than 10^346,938 monkeys to each type a hamlet length document to have functionally sure odds that one would type Hamlet.
Now if a monkey on average types one characters per second, it would take a monkey 173,467 seconds, or 48.1853, or a little less than 10^1.7 monkey work hours to type out one hamlet length document. Overall, the number of monkey work hours necessary to have functionally sure odds of typing out Hamlet are (10^346,938)x(10^1.7) or 10^346,939.7, or less than 10^346,940. There are more than 10^3 hours in a year, so it would take less than 10^346,937 monkey work years to have functionally sure odds of typing out Hamlet.
*as calculated by MS Word 2003, copied from this website: http://www-tech.mit.edu/Shakespeare/hamlet/full.html)
**I counted any character alterable by the shift key as 2 characters, and tab, spacebar, and return as one character
*** 1 in a million odds of adverse outcome is considered negligible risk according to website such as this one: http://www.hc-sc.gc.ca/ewh-semt/pubs/radiation/98ehd-dhm216/management-gestion_e.html
An illustrative quote from it:
"the concept of negligible lifetime risk at one in a million (10-6) was often applied, predominantly in the U.S. [Kelly and Cardon 1994]."
Back to work monkey boy!