0

This is quite a frequently asked question here on Stack Exchange, yet I have went through the past posts and still have some doubt in my mind. As I don't have the reputation to comment under the post (and those post are not active anymore), I decided to create a new question.

From the post - Expected number of tosses to get 3 consecutive heads, what's wrong with my solution?

It is suggested that the correct equations are as follow:

= Expected number of tosses to reach $i$ consecutive heads.

1 = 1 + 1/2 ∗ 1

2 = 1 + 1 + 1/2 ∗ 2

3 = 2 + 1 + 1/2 ∗ 3

The result will be X1 = 2, X2 = 6, X3 = 14.

While all the explanation seems making sense to me, I am confused of one thing. When there is 50% chance of "resetting" because of getting a tail, we multiply the expected value by 50%, but there isn't such adjustment for the 50% of getting a head? Or am I having some flaw in my thinking process.

Lets say X2, shouldn't it be 50% being X1 + 1, and 50% being X2 (the reset process).

Hence the equation should be (X1 + 1)/2 + X2 / 2?

Edit: sorry for the confusing terms. I meant to use $X_i$ to represent the expected value for having $i$ consecutive heads. i.e. $X_3$ = expected number of toss to get 3 consecutive head (which is the require answer for this question)

And my thought process goes like this: $X_3$ will be $X_2 + 1$ if it lands a head(50%) and $X_3$ will be $X_3$ (reset) if it lands tail(50%). So I thought the equation will be $X_3 = (X_2 + 1)/2 + X_3 / 2$, which is wrong but I am not sure which part goes wrong here.

dust
  • 121
  • The definition of the $x_i$ is not clear. If you really meant "expected number of tosses until you get the $i^{th}$ Head", then $x_n=2n$ for all $n$. – lulu Jul 07 '20 at 14:49
  • Sorry for the confusion. I have just edited my post, hope it will be clearer. – dust Jul 07 '20 at 15:04
  • Well, you could then write $x_1=\frac 12\times (1)+\frac 12\times (x_1+1)=1+\frac 12\times x_1$ if you want. And so on. – lulu Jul 07 '20 at 15:11

1 Answers1

1

To do it your way:

For $i\in \{1,2,3\}$ let $X_i$ be the expected number of tosses needed to see $i$ consecutive Heads. The desired answer is $X_3$.

We get $$X_1=\frac 12\times 1+\frac 12\times (X_1+1)=1+\frac 12\times X_1$$ $$X_2=X_1+\frac 12\times 1+\frac 12\times (X_2+1)=X_1+1+\frac 12\times X_2$$ $$X_3=X_2+\frac 12\times 1 +\frac 12\times (X_3+1)=X_2+1+\frac 12\times X_3$$

As you have written. In each case, we just consider the expected time to get to one fewer $H$ and then consider the possible outcomes of the next toss.

An alternate method:

for $i\in \{0,1,2\}$ let $E_i$ be the expected number of tosses required to reach $HHH$ given that your last $i$ tosses (and no more) were $H's$. The desired answer is $E_0$.

Then $$E_2=\frac 12\times 1 +\frac 12\times (E_0+1)$$ $$E_1=\frac 12\times (E_2+1)+ \frac 12\times (E_0+1)$$ $$E_0=\frac 12\times (E_1+1)+\frac 12\times (E_0+1)$$

This is easily solved and yields $$E_0=14$$

lulu
  • 70,402
  • I think it is just the same system but in a reverse way. $E_2 = X_1$, $E_1 = X_2$, $E_0 = X_3$.

    I think I understand the first part of the three equation, could you explain more on the later part (why all 3 equation is adding $E_0 + 1 x 1/2$)

    – dust Jul 07 '20 at 15:10
  • No. My variables are different. Now that you have clarified what you meant by $x_i$, I will edit to explain the official solution. – lulu Jul 07 '20 at 15:12
  • Ah I think I understand the problem of mine. So basically in using my way, for each $X_i$, we should just be accounting for the change in expected value in the coming toss, which is 1 for head and $X_i + 1$ for tail, and then add it back to the expected value of the previous stage $X_{i-1}$ – dust Jul 07 '20 at 15:30
  • The logic is this: To get $i$ consecutive Heads we must first get $i-1$, which we expect to take $X_{i-1}$ tosses. Once we have achieved that, then we toss again. If we get $H$, we're done! If we get $T$ then we have to start over. – lulu Jul 07 '20 at 17:02