Jump to content
Science Forums

Recommended Posts

Posted

Someone once said that if you had enough chimpanzees with enough typewriters, eventually one of them would compose the works of Shakespeare, or something to that effect.  Has anyone ever tried to calculate how many and over how much time?  Has anyone ever programmed a computer  with a random letter, space , and punctuation generator to see how many words, sentences, or paragraphs could be generated over time?  It might be a waste of time, but I would be interested to learn of any results of such endeavors .

Posted

As Sanctus notes, the math of the “infinite monkeys typing the works of Shakespeare” scenario is pretty easy:

[math]p = 1 - \left( 1 - \frac1{c^a} \right)^b[/math]

where:

[math]p[/math] is the probability of randomly generating a desired text of length [math]a[/math] (in the scenario, the works of Shakespeare, which is on the order of 5,000,000);

[math]b[/math] is the number of attempts (by a monkey, computer, or whatever) made;

[math]c[/math] is the number of available characters (excluding capitalization and punctuation other than spaces, 26 for the modern English alphabet).

 

Because the exponents are large, it’s a bit tricky to actually calculate precise results (the trick is to use logarithms), but that’s not very important for the scenario, because it’s quickly clear that [math]p[/math], for all the monkeys the universe can ever have before it ceases to be capable of having monkeys, is so tiny it’s practically zero. We can safely say monkeys will never type even a single work of Shakespeare.

 

Has anyone ever programmed a computer with a random letter, space , and punctuation generator to see how many words, sentences, or paragraphs could be generated over time?

Sure. I have. Likely thousands of others have, just because it’s easy to do, and programmers tend to have a perverse urge to check mathematical predictions with numeric simulations in the hope that the math is wrong. It isn’t – generating random strings doesn’t produce the work of Shakespeare, or anything else much nice or useful.

 

Some folk, in an act usually described as performance art, even set up a keyboard and screen to have a few monkeys try it, with the following hilarious results (from the previously linked Wikipedia article):

“Not only did the [six] monkeys produce [in one month] nothing but five total pages largely consisting of the letter S, the lead male began by bashing the keyboard with a stone, and the monkeys continued by urinating and defecating on it”

It might be a waste of time, but I would be interested to learn of any results of such endeavors .

While simulating monkeys on typewriters may be a waste of time, I think the idea of randomly generating useful things deserves serious study, and has gotten a lot of it. This is especially true when we consider that things other than 16th Century literature can be represented by strings of characters. Every possible computer program can be. So imaging that a computer program for an AI that could solve all the world’s problems exists. If so, one could, in principle, randomly guess it, like a monkey accidentally typing Shakespeare.

 

Simple math tells us it’s practically impossible to accomplish this with pure luck, but genetic algorithms – ones that guess pieces of a program, then assess their fitness, recombining them to get closer and closer to a defined criteria – is one way of using randomness. If a very large quantum computer – one with as many qbits as a conventional computer has bits – is possible, then it might be possible to have it simultaneously make every possible guess at a useful program, and return to us in the classical world the one the desired one.

 

You can rephrase such a quantum computer scenario as “If Schrodinger’s cat could type, could it produce the works of Shakespeare?”

Posted

Phillip, you sure? Because once they figure out how to type say "in the midst" and they get 10 bananas they are happy with it. No need for more.

 

You need Gorillas for that.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...