# The odds

KellyJay
Science 02 Apr '11 19:55
1. KellyJay
02 Apr '11 19:55
I'm asking because I saw a number being given for the odds in typing out the
name "Shakespeare" thinking about all the things required for the uppercase
letter "S" then forcing all the other letters to be lowercase. Is this guys numbers
correct? I'm only interested in the odds for the name, I know more than a few
people here are much better with numbers than I am.

Thank you if for you help if you deside to. I'm not going to argue any poings in
this thread I just want to look at the odds and how we come up with them.
Kelly

http://www.probabilitytheory.info/content/item/7-monkeys-typing-shakespeare-or-even-just-the-word-hamlet

"If there are 50 keys on the typewriter, the probability of the monkey getting Shakespeare correct is raised to the power of the number of characters, letters and spaces, in Shakespeare plus the adjustments of the typewriter needed for capitals and punctuation. On this basis the chance of the monkey typing the word 'Hamlet' correctly is one in 15,625,000,000,"
2. 02 Apr '11 20:123 edits
Originally posted by KellyJay
I'm asking because I saw a number being given for the odds in typing out the
name "Shakespeare" thinking about all the things required for the uppercase
letter "S" then forcing all the other letters to be lowercase. Is this guys numbers
correct?
As your quote says, it could be as simple as 'number of keys' to the power 'number of characters' except for the complication of the capital letter.

However, the word Shakespeare could be typed by typing a string of 12 key strokes:
SHIFT, S, h, a, k, e, s, p, e, a, r, e.
so, on a 50 key typewriter the probability is lower than or equal to:1 in 50 to the power 12.

If there are two SHIFT keys, then you can divide that by 2. (the 50 to the power 12 part)
If there is a CAPS LOCK function, then you can reduce it even further (I won't bother to calculate it, but since it is another possible way of typing it, the probability of getting the desired result is higher.

For 'Hamlet' I get an upper bound of 15,625,000,000 so it appears he assumed only one SHIFT key and ignored caps lock functionality. So my monkeys with a more advanced keyboard than his (two SHIFT KEYS), can finish their work in less than half the time!

And don't get me started on the 'Backspace' key.
3. KellyJay
02 Apr '11 22:04
As your quote says, it could be as simple as 'number of keys' to the power 'number of characters' except for the complication of the capital letter.

However, the word Shakespeare could be typed by typing a string of 12 key strokes:
SHIFT, S, h, a, k, e, s, p, e, a, r, e.
so, on a 50 key typewriter the probability is lower than or equal to:1 in 50 to ...[text shortened]... r work in less than half the time!

And don't get me started on the 'Backspace' key.
As always you’re a gentleman and scholar thank you for your effort.

I think with each letter typed it is possible that another key stroke could cause the
wrong or right case, how to work that in for each letter seems hard to do.
Kelly
4. KellyJay
02 Apr '11 22:20
As your quote says, it could be as simple as 'number of keys' to the power 'number of characters' except for the complication of the capital letter.

However, the word Shakespeare could be typed by typing a string of 12 key strokes:
SHIFT, S, h, a, k, e, s, p, e, a, r, e.
so, on a 50 key typewriter the probability is lower than or equal to:1 in 50 to ...[text shortened]... r work in less than half the time!

And don't get me started on the 'Backspace' key.
"If there is a CAPS LOCK function..."
Would not reduce but increase the odds against it, since you'd have to hit it once
to get an uppoer case letter than hit it again to remove it.
Kelly
5. 03 Apr '11 10:49
As your quote says, it could be as simple as 'number of keys' to the power 'number of characters' except for the complication of the capital letter.

However, the word Shakespeare could be typed by typing a string of 12 key strokes:
SHIFT, S, h, a, k, e, s, p, e, a, r, e.
so, on a 50 key typewriter the probability is lower than or equal to:1 in 50 to ...[text shortened]... r work in less than half the time!

And don't get me started on the 'Backspace' key.
An additional complication is that the probability of typing Shift + s is also dependent on the behaviour of the monkey - does he only press one button at a time or is he mashing the keyboard?

In other words, you can't really calculate this probability without having some more specific information about the monkey.
6. 03 Apr '11 13:252 edits
Originally posted by KellyJay
I think with each letter typed it is possible that another key stroke could cause the
wrong or right case, how to work that in for each letter seems hard to do.
Kelly
Having thought about what KazetNagorra said regarding the SHIFT having to be held down at the same time as another key, I see that that is more complicated than I realized.
However, if we assume for simplicities sake that the monkeys only hit one key at a time, then the shift key becomes worthless, and only the CAPS LOCK key matters.
Now the formula for correct typing is:
CAPS LOCK, S, CAPS LOCK, h, a, k, e, s, p, e, a, r, e.
or
1 in 50 to the power 13. (assuming 50 keys other than SHIFT keys).
You are incorrect about extra CAPS LOCK presses affecting the case later on reducing the chance of a correct output, as that calculation is already part of the above.
ie suppose the monkey has already typed "Shake". Now the probability of him typing the correct next letter (an 's'ðŸ˜‰ is 1 in 50. If he presses the CAPSLOCK, then that is just one of the other 49 keys he could have pressed and is considered an incorrect guess. There is no need to worry about the implication that any further key presses are now Capitals as it is already considered a failed run.
The same would actually apply to any other special key. If the electronic typewriter had a key that turned off its power thus stopping all further input, it would not affect the probability. Even a key that killed the monkey would have no effect.

If you throw a die 6 times, the probability that you will get 6 sixes in a row is not affected if we add the rule that throwing a 1 means you have to stop.
7. 03 Apr '11 14:55
Having thought about what KazetNagorra said regarding the SHIFT having to be held down at the same time as another key, I see that that is more complicated than I realized.
However, if we assume for simplicities sake that the monkeys only hit one key at a time, then the shift key becomes worthless, and only the CAPS LOCK key matters.
Now the formula for ...[text shortened]... sixes in a row is not affected if we add the rule that throwing a 1 means you have to stop.
However, the monkey might also press caps lock twice in a row. So the monkey may hit caps lock 2n (where n is a positive integer or zero) times before entering the correct letter. So the probability of getting the correct letter (assuming 50 buttons of which 1 caps lock) is actually 1/50 + (1/50)^3 + (1/50)^5 + ... which is approximately 0.02008 (slightly more than 1/50).
8. Palynka
Upward Spiral
03 Apr '11 15:29
It's just a metaphor for explaining probabilities, you guys are aware of this, right?

A lot of focus on the particular shape of the typewriter, the number of shift keys and talking about the behaviour of the monkey is missing the point, IMO.
9. 03 Apr '11 15:32
Originally posted by Palynka
It's just a metaphor for explaining probabilities, you guys are aware of this, right?

A lot of focus on the particular shape of the typewriter, the number of shift keys and talking about the behaviour of the monkey is missing the point, IMO.
We're just being geeks.
10. Palynka
Upward Spiral
03 Apr '11 15:33
Originally posted by KazetNagorra
We're just being geeks.
Right, carry on then! ðŸ™‚
11. 03 Apr '11 18:092 edits
Originally posted by KazetNagorra
However, the monkey might also press caps lock twice in a row. So the monkey may hit caps lock 2n (where n is a positive integer or zero) times before entering the correct letter. So the probability of getting the correct letter (assuming 50 buttons of which 1 caps lock) is actually 1/50 + (1/50)^3 + (1/50)^5 + ... which is approximately 0.02008 (slightly more than 1/50).
My calculation was an upper bound. As I said, don't get me started on that back space key!

And if I mention that F2 does an automatic spell check, it might introduce an interesting analogy to Natural Selection.
12. 03 Apr '11 18:19
Originally posted by Palynka
It's just a metaphor for explaining probabilities, you guys are aware of this, right?

A lot of focus on the particular shape of the typewriter, the number of shift keys and talking about the behaviour of the monkey is missing the point, IMO.
The important question Kelly was asking, was whether or not such complications reduce or increase the probability. The answer is : it depends on the complication.

The important things to know are:
1. What is the probability of a monkey making a correct action.
2. How many correct actions in sequence are required to achieve the result.
3. All actions that do not stop the result from being obtained can be ignored.
4. All actions that do stop the result from being obtained must be considered in 1.
13. Palynka
Upward Spiral
03 Apr '11 20:201 edit
The important question Kelly was asking, was whether or not such complications reduce or increase the probability. The answer is : it depends on the complication.

The important things to know are:
1. What is the probability of a monkey making a correct action.
2. How many correct actions in sequence are required to achieve the result.
3. All actions ...[text shortened]... be ignored.
4. All actions that do stop the result from being obtained must be considered in 1.
I just think those considerations make the example pointless and may end up confusing Kelly more than help him understand probabilities. But I agree with just about everything you guys said so fair.
14. 03 Apr '11 20:44
Originally posted by KazetNagorra
We're just being geeks.
I thought this was the forum to go to, to feed our inner geek. ðŸ™‚

Kelly needs some ammo to take back to Spirituality. I think he got it.
15. KellyJay