This is a thousand monkeys working at a thousand typewriters. Soon, they’ll have written the greatest novel known to mankind. [Reading one of the typewriters] “It was the best of times, it was the blurst of times“?! You stupid monkey! [Monkey screeches] Oh, shut up. —Montgomery Burns
This Simpsons episode inspired programmer Jesse Anderson to see if it could actually work. As he explains:
Instead of having real monkeys typing on keyboards, I have virtual, computerized monkeys that output random gibberish. This is supposed to mimic a monkey randomly mashing the keys on a keyboard. The computer program I wrote compares that monkey’s gibberish to every work of Shakespeare to see if it actually matches a small portion of what Shakespeare wrote. If it does match, the portion of gibberish that matched Shakespeare is marked with green in the images below to show it was found by a monkey. The table below shows the exact number of characters and percentage the monkeys have found in Shakespeare. The parts of Shakespeare that have not been found are colored white. This process is repeated over and over until the monkeys have created every work of Shakespeare through random gibberish.
More at Jesse Anderson’s blog