To Monkey, or not to Monkey...

What was this story… ah yes:
If you give 1 000 000 monkeys typewriters and leave them to hit the buttons for a while they will write A LOT of meaningless bullshit…:smack:(You bet). But in some point the mighty “PROBABILITY THEORY” will grant you the best drama humankind will ever see…:eek: (Greater than Shakespeare’s work)
My Q:
What are the chances to witness such a miracle and can you give me a number:dubious:. Ah… one more: HOW MANY BANANAS DO I NEED TO KEEP MY WRITERS ALIVE AS LONG AS POSSABLE?

Somebody should really ask the Mythbusters this one.

The probability monkey typewriter thing is a statistical exercise, but is actually impossible.

100% of monkeys would destroy the typewriters (or at least the ribbons) before anything coherent was typed.

Plus, changing the paper after each sheet…

This isn’t the kind of question that should be taken seriously - like how many angels can dance on the head of a pin.

I remember a website simulating thousands of monkeys (by random number generators), but I can’t find it now. I think the longest matching string they had managed to generate back then was somewhere around 20-25 characters long, which took billions over billions of simulated monkey years to reach. Of course, that’s trivial to calculate by probability too. It was still a fun simulation though, futile as it was.

Actually, a more formal version of this concept is the “problem of the printed line”, which was explained very nicely by George Gamow in “One Two Three… Infinity”. The parameters are as follows: Suppose you create a printing machine consisting of 65 wheels (corresponding to the standard number of characters in a printed line), each of which has 50 characters on the rim (26 letters, 10 numerals, and 14 special characters). Now set it in operation, with the wheels acting like those on an odometer – each time the first one makes a full rotation, the next moves ahead one unit. Eventually, this machine will print out every line of text that can be written. How long will it take?

Gamow shows the calculation, and the answer. The total number of permutations is 10 to the 110th power. To make this clearer, he says: Suppose every atom in the known universe is a printing machine that has been printing lines at the speed of atomic vibrations (10 to the 15th power lines per second) since the Big Bang. By now, they would have printed about one-thirtieth of one percent of the total number of lines.

lets simplify this:

Lets make simple typewriters for the monkeys with just the characters they’d need.

26 letters (all caps), space, period, apostrophe and carriage return. so 30 buttons.

Romeo and Juliet, one of the shorter plays, has 159172 characters in the script.

the exact statistical answer (in seconds assuming 1 keystroke per second average)
is

30^159172

m

where m = number of monkeys.

m would have to an obscene number (words like billions, trillions, etc don’t even come close, probably something between googol and googolplex.) of monkeys if you want this to happen in your lifetime.

Assuming you don’t have the Heart of Gold handy - impossible is most accurate here.

This question gives me the opportunity to link to the first thread I ever started on the SDMB: “Monkeys and the Complete Works of Shakespeare”. This was a story about a research team at Plymouth University who left a computer with a group of monkeys at a zoo, and the results of that experiment.

The Yahoo article which I’d linked to has expired, but I’m glad to see that the project’s website is still up and running: Notes Towards the Complete Works of Shakespeare. It makes for some interesting reading.

As I recall, the original hypothetical stipulated an infinite number of monkeys over an infinite span of time. Therefore, you would need an infinite supply of bananas. Which is where the scenario becomes utterly absurd.

The other exploration of this idea is the Library of Borges.

Imagine a library that contains every possible book. Suppose we have, as suggested earlier, 65 characters per line, 50 possible characters, 50 lines per page, and 200 pages per book. Note that is might seem to limit you to books of 200 pages, but that’s not true. Longer works are simply part of a multi-volume set.

So the first book consists entirely of spaces. The second book is all spaces except the first character, which is an “a”. The third book is all spaces except the second character, which is an “a”. The fourth book is all spaces except the third character, which is an “a”. Continue until you’ve got a set with “a” in every possible space. Then continue with all spaces, except every possible permutation of two a’s. Then three, then four, then five, until finally you reach a book that is all a’s. That’s your first building in the library. Now continue until you’ve got every possible permutation of spaces and b’s, spaces and c’s, spaces and d’s, and so on. Then we get to have some fun…a’s combined with every possible permutation of b’s. Then a’s with c’s, a’s with d’s and so on. Keep going and you’ll have a godzillion books, and you still haven’t got past simple books that have only two possible characters.

Now add in three characters, and the set of books with three possible characters is gigantically huge compared to the set of books with two characters. Then four, then five.

And we haven’t even reached the space of works which have all 50 allowed characters.

As you can see from this thought experiment, just about every book in the library is nonsensical. If you picked a random book from the shelves, the chances of finding a book that contains anything sensical so close to zero that we might as well forget it.

And note that picking a book at random from the library shelves is logically equivalent to generating a random string of characters to fill the book. So yes, somewhere in the library there is a work of staggering genius that puts Shakespeare to shame. Thousands and millions of them, in fact. But you’re never going to find one. In fact, the odds are astronomically (actually astronomically is a misnomer since the numbers we’re talking about are much larger than the numbers astronomers use) higher that even if you found such a work, you’d find the last page blank. Or a copy where the word “fnord” is inserted into every sentence. And so on. There’s only one perfect copy of that work of genius, but thousands and millions and billions and trillions of copies with mistakes, typos, missing pages, and on and on.

So of course, the real answer is much much much much longer than the entire age of the universe, even if the entire universe were monkeys banging on typwriters. Even to get a couple of sensical children’s books, much less the complete works of Shakespeare.

Approximate age of universe: 13.73 billion or 13,730,000,000 years.

Seconds in year: 31,557,600

Approximate age of universe: 433,285,848,000,000,000 or 4.33285848e17 seconds

Ok then. A 16 character string of characters can be arranged in 26^16 or 4.36087429e22 possible combinations. So if a single monkey could type 16 characters per second, and all monkeys never typed the same pattern twice, you would need more than 100,000 monkeys working since the big bang to type out all 16 character combinations.

So the universe is pretty young: you’re going to need a lot of monkeys.

One of the things a monkey would do would be to bang the keyboard with its fist. If you bang a typewriter keyboard with your fist, the typebars will rise toward the platen and all get jammed together. It’s unlikely a monkey would unjam them.

I actually did a scaled down version of this experiment a few years ago, when I had procession of a couple of Spider monkeys and two Royal typewriters. After a couple of weeks the first monkey only managed to type out a lot of incoherent trash (i.e. a couple of Jacqueline Susanne novels, as I recall). The second monkey managed to faithfully knock out quite a few of Shakespeare’s works, but I sent him back to the vivisection lab along with the first monkey when I noticed he put a colon after “not to be” in Hamlet’s “to be or not to be (X) that is the question” , instead of the obviously correct semicolon. Stupid monkeys. :mad: