?

Log in

No account? Create an account
 
 
02 Oktober 2004 @ 18:26
Monkey, monkey, monkey, monkey, William Shakespeare  

O, for a muse of bananas!

There are a lot of versions of the Infinite-Monkey Theorem out there. The Jargon File's entry says, in part:

“If you put an infinite number of monkeys at typewriters, eventually one will bash out the script for Hamlet.” (One may also hypothesize a small number of monkeys and a very long period of time.) This theorem asserts nothing about the intelligence of the one random monkey that eventually comes up with the script.

[...]

This theorem has been traced to the mathematician Émile Borel in 1913, and was first popularized by the astronomer Sir Arthur Eddington.

The theorem obviously abstracts away from certain known properties of monkeys and typewriters, like the fact that monkeys don't know that you're supposed to strike only one key at a time (unless one of them's the shift key), and so the typewriters would all be terminally jammed up after the first few letters. (Don't try to tell me Borel was using a Selectric in 1913.) Or, if one could somehow get around that obstacle, there's still the fact that, long before the monkeys produced anything worth reading, the typewriters' manufacturer would have stopped producing the requisite style of ribbon, or even gone out of business entirely.

As you may be thinking, that's not the point. The theorem isn't really about monkeys and typewriters; it's about patterns and probabilities. On the other hand, some people seem to have missed the point quite spectacularly (although not so spectacularly as to waste a vintage Underwood), as the Jargon File further reports:

In mid-2002, researchers at Plymouth University in England actually put a working computer in a cage with six crested macaques. The monkeys proceeded to bash the machine with a rock, urinate on it, and type the letter S a lot (later, the letters A, J, L, and M also crept in). The results were published in a limited-edition book, Notes Towards the Complete Works of Shakespeare.

More recently, as has been noted in two recent Language Log posts ("Monkey Shakespeare," by Bill Poser, and "A Random Monkey Begins Julius Caesar," by Geoff Pullum), some rather brighter researchers have hit upon the notion that the monkeys could be replaced by computers, too. The Monkey Shakespeare Simulator uses a Java applet to produce pseudo-simian pseudo-random strings of characters and compare them to the complete works of the Unmortal Bard. (The version of the theorem being tested here is, "If you have enough monkeys banging randomly on typewriters, they will eventually type the works of William Shakespeare"—hey, why stop at Hamlet?) Every time a simulated monkey types a string of characters corresponding to the beginning of any of Shakespeare's plays (they say they want the works, but they don't seem to be grepping the sonnets), the program lets you know. As of this writing, the best effort yet has been the first twenty characters of Coriolanus, namely "1. Citizen. Before w"—that's some seriously deathless prose, there.

Note that the applet only looks for text at the beginning of a play; if a virtual monkey goes and pounds out this:

The next thing when she waking lookes vpon,
(Be it on Lyon, Beare, or Wolfe, or Bull,
On medling Monkey, or on busie Ape)
Shee shall pursue it, with the soule of loue.

...it will count for naught, unless the busie Ape in question has the great good fortune to have typed the first act and a half of A Midsummer Night's Dream immediately before it.

Geoff Pullum points out that, abstracting away from most of the things that need to be abstracted away from, "it's not a speculation that one day we'll get the whole of the Immortal Bard's works out of an untiring team of monkeys working away on keyboards; it's definitely true — unless astronomy imposes its cosmic time limit on everything and the earth is destroyed or the universe shuts down before we get there." Of course, the reason it's definitely true is that, with an infinite amount of time to work in, the monkeys always get another chance; if, this time through, they happen to get everything right except that they type "letters congriung to that effect" in Hamlet IV.iii, well, they'll have a chance to put the u and the i in the right order in another few millennia when it comes round again. (This is not quite a fair complaint, mathematically speaking, because infinite time is clearly not enough all by itself: if you gave the monkeys typewriters that were missing the letter S, then you could prove that they would never even write Shakespeare's name, no matter how many chances you give them.) The fact is, this is one of the worst valid procedures you could come up with for producing the complete works of William Shakespeare. Wouldn't it make more sense to let the monkeys go, wait for them to evolve into something with the capacity for language, and then see whether one of 'em might eventually write the plays on purpose? Before you scoff, keep in mind that this approach (or something very like it) has actually worked once; the infinite-typewriter technique, though demonstrably sound in theory, has never pulled it off in practice.

Also, I think the whole faithful-reproduction-of-the-Bard angle has been overemphasized. There are a hell of a lot of other quite remarkable things that your infinite-monkey setup will produce. For example, there's roughly a fifty-fifty chance that, before coming up with Shakespeare's version of Hamlet, the monkeys will produce one that is nearly identical to it, but with the names Rosencrantz and Guildenstern reversed. They will also—probably ages and ages before they get around to the 'real' Hamlet—come up with an alternative script in which the hesitant title character is replaced by the decisive Moor of Venice, who kills Claudius at the first opportunity, so that the whole thing ends happily after a single brief act. (The Comedy of Othello, Prince of Denmark is easier for the monkeys to type accurately because it is considerably shorter; the fact that it doesn't already exist is of no concern.) Then, too, the monkeys will also happily give you things like the full text of an article that will appear in Linguistic Inquiry seventeen years later, complete with appropriate bibliographic references to other works that will be published in the interim. They might even churn out the lyrics to Chris Yacich's classic song "I Like Bananas (Because They Have No Bones)," or the complete works of William Shatner. Eventually, the monkeys will type the exact text of this very blog entry itself! (But I did it first, or at least I think I did.)

The tricky part, of course, is combing through all the b'in-p1:s]Ij"PpXeygefFPXD)gg8Ns garbage, and non-rhyming limericks, and EBCDIC-encoded cake recipes that reverse the proportions of flour and baking powder, and garbled instructions for the care and feeding of Nubian dairy goats, to find the good stuff. The one great advantage of using the works of Shakespeare is that at least we know what we're looking for.

 
 
Nuværende humør: amusedamused
Nuværende musik: O, o, o, o that Shakespeherian rag!
 
 
 
Tishiewahooweena on 3. Oktober, 2004 01:27 (UTC)
Infinite time does not produce infinite possiblities; proper conditions must exist. I do not think the pattern of keyboard banging is compatible with the patterns of Hamlet. Therefore, I think they'd definitely evolve before they accidentally typed out Hamlet.

Now, if we taught them to actually type, such that they had their hands in the typing position and they learned to imitate typing, the way kids do, then I could get behind that mathematical possiblity.

The most important consideration, however: would the keyboards be poo-proofed?
w1ldc47w1ldc47 on 3. Oktober, 2004 02:13 (UTC)
Infinite time does not produce infinite possiblities; proper conditions must exist.
But proper conditions *do* exist. They have all the letters they need.

I do not think the pattern of keyboard banging is compatible with the patterns of Hamlet. Therefore, I think they'd definitely evolve before they accidentally typed out Hamlet.
But you've missed the point. When a pattern is random it has the capacity to temporarily match *any* pattern, provided you give it enough time. That's what Q. Pheevr is saying. Sure, they'd probably evolve before the succeeded in randomly generating Hamlet, but that's not allowing them infinite time. A long long long long long time, to be sure, but not infinite. And in this case that's a crucial difference.
Tishiewahooweena on 3. Oktober, 2004 05:38 (UTC)
What I'm saying is that I don't think monkey-keyboard-banging is random at all.
鉄観音isolt on 3. Oktober, 2004 13:08 (UTC)
The theorem obviously abstracts away from certain known properties of monkeys and typewriters, like the fact that monkeys don't know that you're supposed to strike only one key at a time (unless one of them's the shift key), and so the typewriters would all be terminally jammed up after the first few letters. (Don't try to tell me Borel was using a Selectric in 1913.) Or, if one could somehow get around that obstacle, there's still the fact that, long before the monkeys produced anything worth reading, the typewriters' manufacturer would have stopped producing the requisite style of ribbon, or even gone out of business entirely.

How about some nice computers with word processing software? Assuming a constant source of electricity....
Q. Pheevrq_pheevr on 3. Oktober, 2004 14:13 (UTC)

If we're interested in what actual monkeys will type, then the Plymouth approach seems to be the best: get a computer with an uninterruptible power supply, a nice, stable operating system, and a poo-proof, pee-proof, rock-proof case, and let the macaques at it. This probably won't get us any blank verse, but it may give us some insights into monkey cognition. (For example, did the Plymouth macaques like S for its position, or for the shape of the letter? We could try to control for this by giving them an unlabelled keyboard like the ones they teach touch-typing on.)

If what we're really interested in is something more abstract, then the Java applet affords us an approximation of a perfectly random monkey. At any given moment, the applet has a one-in-eighty chance of choosing the character that happens to be the next one in the Shakespearian oeuvre, and so, given infinite opportunity, it will eventually get lucky. This is true even though the overall profile of randomly selected characters is very different from that of the collected works of Bill S. We could load the dice by assigning weighted probabilities to individual letters based on their frequency in the plays (so that the dice would come up e a lot more often than X, for instance), and that would mean that, on average, we'd have a slightly better chance of picking the right letter at any given try. But we don't have to do this to guarantee success; we just have to be very, very patient either way. So, turning back to actual monkeys, as long as their typing preferences don't categorically rule out anything that we need for success (as they would if, for example, monkeys never ever hit two adjacent keys in a row, which would prevent them from typing such essential words as were and as), they will also eventually give us the Bard, although they might well be even slower than the unweighted random number generator.