# Probability of Monkey typing keyboard

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.

-
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
Does xxbonbonbonbonxx count as two or three appearances? –  Henning Makholm Nov 2 '11 at 16:59
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
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

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.