Millions of Monkeys - a Q of chance

I’d prefer to ignore your “second”. too heavy.

But, your first is another thing.

I guess I often hear “a million monkeys for a million years”. But that’s a lot different than “infinite monkeys” for “infinite time” as you know.

My intuition says that an infinite number of monkeys would produce the complete works of Shakespeare in any finite amount of time – every instant you’d get the complete works.

a million monkeys in a million years wouldn’t come close, with high probability.

[C. Montgomery Burns]

“It was the best of times, it was the *‘blurst’ * of times”?!?

[/C. Montgomery Burns]

Oh, and who could forget the classic Scott Adams cartoon:

Dilbert: What do you think of my poem?

Dogbert: You know how they say that a million monkeys randomly hitting typewriter keys for a million years could produce the complete works of Shakespeare?

Dilbert: Yes …

Dogbert: Six monkeys, ten minutes.

:smiley:

I think it was Isaac Asimov who wrote a story about a couple of omnipotent beings who set up the experiment. They got a million monkeys with typewriters, and set them to work. They needed soem sort of timing device, so they set up a block of granite 100 miles on a side (or something), and arranged for a tiny bird to fly up once a century to sharpen his beak on it for a minute.

When the block was half its origininal size, they had a workable copy of Hamlet, and they were just about ready to declare the experiment over when they discovered a typo…

Also, in The Hitchhiker’s Guide to the Galaxy, when using the Infinite Improbability Drive, Arthur Dent answered the door, and then told Ford Prefect that “There are an infinite number of monkeys out there, and they want to talk to you about this script for Hamlet they’ve got…”

Call me kooky, but isn’t it so that an infinite number of monkeys would take no time at all to generate any text you are interested in? An infinite number of monkeys would be certain to produce all possible texts immediately, no? In fact, you’d not only get the complete works of Shakespeare as fast as the monkeys could type them, you’d get an infinite number of copies of the works of Shakespeare as fast as the monkeys could type them.

No. You’d be extremely likely to get an infinite number of copies (in fact, the probability is 1), but that doesn’t mean that it’s guaranteed to happen. It’s logically possible that the monkeys would never get it exactly right.

I’m sort of with you there, but I have a slight problem with infinity. If there are also an infinite number of ways to get Hamlet wrong (the Piglet, Elvis and all dead in act II versions for a start) do the infinities cancel out? A sort of renormalisation of monkey-Shakespeare-generation.

Infinity and randomness are very tricky things to think about. If we limit the experiment to the expected age of the Universe and an imaginable number of monkeys say 1000,000,000, I’m too lazy to do the maths but I’m pretty sure you wouldn’t get much more than a miss-spelled sonnet.

Another wrinkle occurs to me is the letters of the alphabet won’t be equally represented in Bill’s works, so a typical random sample would not produce any matches. In order to get the extra t’s e’s s’s and so on you need a rather unlikely skewed sample (like throwing a string of sixs) not a problem with infinite resources but with the mere entire extent and age of the Universe available I can’t see it happening.

To follow on with what others have said, let me add my bit. I actually thought about this a few months back and came up with some numbers. First, get rid of the monkeys. What started me thinking about this was a university (?) in England that set a bunch of monkeys at a bunch of computer screens in a small scale version of the infinite monkeys-infinite typewriters thing. The experimenters quickly found out that monkeys are not random. From what I recall, they ignored the keyboard a lot and when they did interact they pushed the same key a lot and then crapped on it. (Sounds like some of my recent days at work.)

So, let’s reframe the problem. Take a lot of computers and have them randomly generate letters in the English language to see if they can come up with Shakespeare. Actually any of Shakespeare’s plays are way too long, as the OP indicated. Let’s narrow it down to the famous line from Hamlet’s soliloquy. And, let’s only use capital letters and a space, and no punctuation.

TO BE OR NOT TO BE THAT IS THE QUESTION – this has 39 letters or spaces.

Given a selection of 27 choices (26 letters and a space), 39 characters has:

27[sup]39[/sup] – 1 = 6.66 x 10[sup]55[/sup] permutations.

If we had a trillion (10[sup]12[/sup]) computers working for the estimated age of the universe (15 billion years), they would have to spit out 1.4 x 10[sup]25[/sup] solutions per second to get all of the possible 39 letter combinations. One of those would be the correct part of Hamlet. That’s a lot of solutions per second, and this is only to get a small part of a single paragraph.

Statistically figuring you can’t tell when in the 15 billion years the right answer would spit out. This also does not allow for multiple gatherings of the same sequence, something statistics would allow. Of course there would be also be every other 39 letter combination of Shakespeare, and everyone else. There would also be lots of garbage to sift through.

So, could an infinite number of computers randomly printing out letters produce Shakespeare? It depends on how big your infinity is? For my reasonable budget sized concept of infinity, I’d say the answer is “No”.

This totally flies in the face of the whole CONCEPT of infinity, though.

If you have an infinite number of computers, and each one takes, say, one second to produce a random 39-letter string, every second you will (probably) get every single combination possible.

On the other hand, if you have one computer and run it for an infinite time, you will (probably) get every single combination possible.

Does this not fit with your concept of infinity either?

I agree that the “infinite monkeys” and “infinite amount of time” is redundant. You only need one or the other.

Yes, yes, but all that is theoretical. We need some practical application of typists here:

OK, 39 characters, 27 letters (including the <space> which is arbitrarily defined as the 27th letter).

Here goes:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAF
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAG
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAI
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJ
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAK
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAL
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAO
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQ
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAR
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAS
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAT
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAV
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAW
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAX
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZ
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA_
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA

OK, so who wants to take over here? Next!

On a slightly more serious note, you gentlemen are all on the verge of discovering transfinite numbers. While this is cool, I must put out that, unfortunately for your prospects of fame and fortune, they were already discovered some time back by Georg Cantor.

Before you go to much further with speculation about the size of infinity and what it means, I strongly recommend googling ‘transfinite numbers’ to get a background on which to base to your speculations.

Here’s one to start with from Ask Dr. Math.

A genuinely infinite number of monkeys will produce every possible finite sequence of characters instantaneously. They will never produce more than an infinitesimal fraction of all possible infinite sequences of characters. Since every real work of literature is finite, this is probably of no concern …

Satagrahi, both of your posts are great! I couldn’t remember the phrase “transfinite” but remembered the concept. Somewhere else on the Boards someone (possibly you?) gave a link to a web page regarding Large Numbers, most of which are larger than the number of atoms in the observable universe (NoAitOU). It was fascinating reading but I think I erased it from my favorites list and so can’t link it. I did remember the gist of it and how, to a degree, among mathematicians, infinity comes in different sizes. (My apologies to any mathematicians if I simplified it too much, or got it wrong totally.)

Garfield226, the above paragraph, and being an engineer, are possible reasons why I didn’t want to use an infinite infinite (e.g. uncountable) but instead chose to quantify it so large that for practical, or impractical, purposes, the numbers are virtually infinite (transfinite?). When any number gets above the NoAitOU, or time gets beyond the estimated Life of the Universe, my mind says “Stop, that’s big enough.”

And SCSimmons, you are so correct, in the abstract, I need to stop thinking about it all.

This begs to be made into a sig. May I?

This one is easy. If I take the text of, say, Hamlet, and feed it into PKZip, I’ll get out something which is significantly smaller than Hamlet. Therefore, the text of Hamlet is not random.

Now, exactly how nonrandom it is is debateable, since presumably a very sophisticated compression engine, programmed with the rules of English grammar, meter, and stylistic composition, could compress Hamlet (or other English compositions) more efficiently than PKZip. But it’s definitely not random.

I would answer this from a different (but related) direction: there are correlations present. For example, the probability that a particular letter is “e” depends on whether or not the preceeding two letters are “th” or “xy”. (And these are exactly the correlations taken advantage of by the Lempel-Ziv algorithm used by PKZip. Hence Chronos’s post.)

And now, I will apologize in advance for wasting all of your time with the following nitpick.

That Lempel-Ziv greatly shortens a long string is not sufficient to infer nonrandonmess. To make a declaration like “Therefore, the text of Hamlet is not random,” you must factor in your prior beliefs regarding the randomness/nonrandomness of the string. The fact that a (long) random string has a low probability of being well compressed is not enough.

Yeah, but long before you finish you will print out all nine billion names of God, the stars will go out, and the Universe will end.

Sturmhauke, please be my guest. I’d be honored. (Anything for someone who can get inside a Klein bottle.)

BrotherCadfael Oooo, I hadn’t thought about that. :eek: That changes everything. (I’ve always loved that story.)

Well, you can’t make a Hamlet without breaking some eggs.

In order to save the Hamlet, it was necessary to destroy it.