A Million Virtual Monkeys Randomly Mashing Typewriters Have Almost Written Shakespeare

Illustration for article titled A Million Virtual Monkeys Randomly Mashing Typewriters Have Almost Written Shakespeare

Jesse Anderson developed a program that simulated a few million virtual monkeys randomly mashing keys on virtual typewriters in an attempt to re-create Shakespeare. Amazingly, the monkeys (monkeys!) have managed to write 99.99% of Shakespeare's poem, A Lover's Complaint.


Anderson created his virtual monkey experiment to prove the long standing saying of how an infinite number of monkeys with an infinite number of typewriters and an infinite amount of time could write Shakespeare. Of course, it's not all the monkey's wit and typing dexterity in play here. Anderson had to lend a helping hand. Here's how the virtual monkeys are designed:

Mr Anderson's virtual monkeys are small computer programs uploaded to Amazon servers. These coded apes regularly pump out random sequences of text. Each sequence is nine characters long and each is checked to see if that string of characters appears anywhere in the works of Shakespeare. If not, it is discarded. If it does match then progress has been made towards re-creating the works of the Bard.

So by introducing these constraints to the experiment, monkeys have gotten 99.99% of the way to Shakespeare. If the constraints didn't exist though, mathematicians say it would take "far, far longer than the age of the Universe" for monkeys to write Shakespeare. If it's any consolation, I think it'd take humans not named William Shakespeare that long too. Check out the full explanation of the experiment at Jesse Anderson's website here. [Jesse Anderson via BBC, Image Credit: ChipPix / Shutterstock.com]


With all due respect, because I may not fully understand this, those seem like stupid constraints. I do understand that the whole "infinite" thing is a bit of a stumbling block for a real-world test, but cutting the text typed down to 9 character blocks is a MASSIVE constraint.

I always thought the original argument was that one of those infinite monkeys would, all alone, type out all of Shakespear's works. In fact, following that argument you wouldn't even need infinite time. With infinite monkeys you have infinite possibilities and one of them would would type out all of Shakespear's works in sequence starting with the first key he struck and as soon as he's done, you could stop the test.