6
$\begingroup$

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.

$\endgroup$
12
  • $\begingroup$ Have you searched for ...ehm... monkey? $\endgroup$
    – user13838
    Commented Nov 2, 2011 at 16:55
  • 2
    $\begingroup$ Does xxbonbonbonbonxx count as two or three appearances? $\endgroup$ Commented Nov 2, 2011 at 16:59
  • $\begingroup$ bonbonbon counts as two appearances $\endgroup$ Commented Nov 2, 2011 at 17:33
  • 6
    $\begingroup$ If xxbonbonbonbonxx counts for three, the answer is correct provided you replace one million by one million minus five. $\endgroup$
    – Did
    Commented Nov 2, 2011 at 17:39
  • 1
    $\begingroup$ 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. $\endgroup$
    – Did
    Commented Nov 3, 2011 at 17:25

1 Answer 1

5
$\begingroup$

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.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .