Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

A monkey types at a 26-letter keyboard with one key corresponding to each of the lower-case English letters. Each keystroke is chosen independently and uniformly at random from the 26 possibilities. If the monkey types 1 million letters, what is the expected number of times the sequence "bonbon" appears?

P.S bonbonbon counts as two appearances.

My approach is

Let the indicator $I_B$ be the event that "bonbon" appears, then $P(I_B) = 1/26^6$

Then $E(X) = E(I_{B_1} + I_{B_2} + \dotsb + I_{B_\text{1 million}}) = 1\text{ million} \times 1/26^6$

Is my approach right? Somehow I feel I have done something wrong here.

share|improve this question
    
Have you searched for ...ehm... monkey? –  user13838 Nov 2 '11 at 16:55
    
+1 for making me smile –  dungeon Hunter Nov 2 '11 at 16:58
2  
Does xxbonbonbonbonxx count as two or three appearances? –  Henning Makholm Nov 2 '11 at 16:59
6  
If xxbonbonbonbonxx counts for three, the answer is correct provided you replace one million by one million minus five. –  Did Nov 2 '11 at 17:39
1  
Because the word bonbon has length six hence it cannot begin at position 999,996 or later on and be completely written at position 1,000,000. –  Did Nov 3 '11 at 17:25
show 8 more comments

1 Answer 1

up vote 5 down vote accepted

If xxbonbonbonbonxx counts for three, the answer is correct provided one replaces one million by one million minus five. Why minus five? Because the word bonbon has length six hence it cannot begin at position 999,996 or later on and be completely written at position 1,000,000.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.