4

I'm failing to see the mistake in my reasoning for this problem. Here is the problem:

Problem

A man can only type two letters: M and O. He types M with probability $.4$ and types O with probability $.6$. What's the expected number of letters he'll type before getting MOO?

To me, this problem was essentially equivalent to a problem asking expected number of coinflips before a certain sequence is reached.

Thus, I used a similar approach. Here was my solution(that's wrong). It's mostly just repeated use of Law of Total Expectation.

My (Apparently Incorrect) Solution

$$\mathbb{E}[MOO] = 1 + .4(\mathbb{E}[MOO|M]) + .6(\mathbb{E}[MOO])$$ We now try and calculate $\mathbb{E}[MOO|M]$. Note that if we fail here, that means we don't get an O, but that doesn't reset our progress, and we already have the M in place.

$$\mathbb{E}[MOO|M] = 1 + .6(\mathbb{E}[MOO|MO]) + .4(\mathbb{E}[MOO|M])$$

Now, calculating $\mathbb{E}[MOO|MO]$

$$\mathbb{E}[MOO|MO] = 1 + .6(0) + .4(\mathbb{E}[MOO|M])$$ Plugging all of this back in to the original equation, we end up getting that $\mathbb{E}[MOO|M] = \frac{40}{9}$ and so $\mathbb{E}[MOO] = \frac{125}{18}$.

However, the correct solution is $9$. This was their reasoning

The Correct Solution

The probability of this sequence occurring in a row is $18/125$(by multiplying the probabilities together). Then suppose the man types $l$ letters. There's $l - 2$ spots for our sequence to start. The expected number of times our sequence shows up is $\frac{18}{125}(l-2)$. Then we have $$\frac{18}{125}(l-2) = 1 \implies l= 9$$

More Comments

This argument is also convincing. However, using this argument for the problem of finding the expected number of coin tosses until getting HHH, we get $$\frac{1}{8}(l - 2) = 1 \implies l = 10$$ But that's clearly wrong.

Are these two problems not identical? Am I missing something?

Any help would be much appreciated.

Thanks!

Goku241
  • 138

1 Answers1

2

I disagree with the official solution. Further, I think that the original poster's first approach is both workable and elegant. However, the math needs to be nailed down.


Assume that the character string M - O - O has not yet been typed.

Let

  • Situation $~S_0~$ denote the situation where neither of the last two characters typed was an M. Included in situation $~S_0~$ is the situation where there was only one character typed, which was an O, and the situation where no characters have yet been typed.

  • Situation $~S_1~$ denote the situation where the last character typed was an M.

  • Situation $~S_2~$ denote the situation where the last two characters typed were M - O.

For $~k \in \{0,1,2\},~$ let $~E(k)~$ denote the expected number of characters that will be typed before M - O - O appears, from this point forward, assuming that you are currently in situation $~S_k.$

So, the problem reduces to computing $~E(0).$

Then

  • $E(0) = .4[ ~1 + E(1) ~] + .6[ ~1 + E(0) ~] \implies $
    $.4E(0) = .4E(1) + 1 \implies E(0) - 5/2 = E(1).$

  • $E(1) = .4[ ~1 + E(1) ~] + .6[ ~1 + E(2) ~] \implies $
    $.6[ ~E(0) - 5/2 ~] = .6E(1) = 1 + .6E(2) \implies $
    $.6E(0) - 3/2 = 1 + .6E(2) \implies $
    $.6E(0) - 5/2 = .6E(2) \implies $
    $E(0) - 25/6 = E(2).$

  • $E(2) = .4[ ~1 + E(1) ~] + .6[1] = .4E(1) + 1 \implies $
    $E(0) - 25/6 = E(2) = 1 + .4[ ~E(0) - 5/2 ~] \implies $
    $.6E(0) = 25/6 \implies $
    $E(0) = 125/18.$

user2661923
  • 42,303
  • 3
  • 21
  • 46
  • 1
    Could you find any flaw in the reasoning in the official solution? I think your solution and my original solution are the exact same btw, I also got 125/18. – Goku241 Jul 14 '24 at 07:14
  • @Goku241 I didn't see you posting the explicit solution of $~125/18.~$ Further, the official solution is attempting to directly relate the expected number of times that the M - O - O string shows in an $~l$-length character string, with the expected number of characters until the M - O - O string first shows. I don't see the relation between the two, so I am unable to even comprehend the analysis in the official solution. – user2661923 Jul 14 '24 at 07:17
  • To whoever down-voted my answer : if you have found an analytical flaw in my answer, please advise. – user2661923 Jul 14 '24 at 07:18
  • @Goku241 Also, $~\displaystyle \frac{18}{125} \times (9 - 2) \neq 1. ~$ Assuming that I am right about the official analysis being invalid, then this algebraic mistake doesn't really matter. – user2661923 Jul 14 '24 at 07:22
  • Is the expected number of characters until MOO shows not equivalent to the problem of finding the number of characters until MOO shows for the first time?

    They're just saying that in an $l$ long sequence, it'll show up(on expectation) this many times($\frac{18}{125}(l-2)$) and so they're solving for the first $l$ such that the number of time s it shows up is greater than or equal to $1$. They just rounded up.

    – Goku241 Jul 14 '24 at 07:26
  • @Goku241 I repeat: I see no way of relating how many times the M - O - O sequence is expected to show to how many characters will be typed before the first occurrence of the M - O - O sequence. – user2661923 Jul 14 '24 at 07:29
  • @Goku241 Also, I will make the same comment to you that I made to whoever down-voted my analysis: if you can find a flaw in my analysis, please advise. – user2661923 Jul 14 '24 at 07:30
  • I didn't downvote, but I don't really understand what the difference between E(0), E(1) and E(2) is – ConnFus Jul 14 '24 at 08:20
  • @ConnFus $~E(k)~$ is the expected number of characters that will be typed, from this point forward, until the first occurrence of the string M - O - O, assuming that you are currently in situation $~S_k ~: ~k \in {0,1,2}.$ – user2661923 Jul 14 '24 at 08:22
  • 1
    @ConnFus For example, the equation $E(0) = .4[ ~1 + E(1) ~] + .6[ ~1 + E(0) ~] ~$ assumes that you are in situation $~S_0.~$ Then, $~2/5~$ of the time, you will type an M, which will add 1 to the characters typed and put you in situation $~S_1,~$ and $~3/5~$ of the time, you will type an O, which will add 1 to the characters typed and leave you in situation $~S_0.$ – user2661923 Jul 14 '24 at 08:26
  • @ConnFus I just noticed that I didn't nail down the specification for $~E(k)~$ directly in my posted answer. I have edited my answer accordingly. – user2661923 Jul 14 '24 at 08:31