# Finding expected number coin flips to get 2 consecutive heads [duplicate]

First, I know what the right answer is, and I know how to solve it. What I'm trying to figure out is why I can't get the following process to work.

The probability that we get 2 consecutive heads with one flip is 0. The probability that we get 2 consecutive heads with 2 flips = 1/4. The probability of getting 2 consecutive heads with 3 flips = 1/6. The probability of getting 2 consecutive heads with 4 flips = 2/10 = 1/5. And the probability of getting 2 consecutive heads with 5 flips = 3/16.

Am I doing something wrong. I don't see any easy way to use these numbers to solve the original problem of finding the expected number of coin flips to get 2 consecutive heads.

• here is another variant of the question. – lulu May 11 '16 at 20:48
• It's hard to say why you can't get your process to work if you don't describe your process. What is it, and in what way is it not working? – Brian Tung May 11 '16 at 20:51
• @lulu Your first link goes to a different problem where you stop if you get either HH or TT. – user940 May 11 '16 at 20:51
• Are you asking for a computation of the expected number of flips using the probabilities that we do it in $2$, in $3$, and so on? That can be done, though it is not the simplest way. However, the probabilities are not the ones you indicate. For example, the probability that we get our first two consecutive heads using a total of $3$ tosses is $1/8$, not $1/6$. For $4$ it is also $1/8$. – André Nicolas May 11 '16 at 21:00
• @ByronSchmuland True...that's why I also posted the second link. – lulu May 11 '16 at 21:09

The problem is that your experiment is not well-defined. To solve the mentioned expectation problem, you would define the experiment as follows:

You toss a coin until you get two heads in a row and then you would stop. So there are no two consecutive heads before that.

each of the probabilities, that you have calculated in your process, is related to the following experiment:

you toss a coin n times. what is the probability of having 2 heads in a row.

By the way, according to the last experiment, you have miscalculated the probabilities in your process.

The definition of expected value in this case is:

$$E[x]=\sum_{x=2}^{\infty}xP[x]$$

and

$$P[x]=\frac{x-1}{2^x}$$

Combining these yields:

$$E[x]=\sum_{x=2}^{\infty}\frac{x^2-x}{2^x}$$

Therefore $E[x]=4$.

• Your formula $P[x]=\dfrac{x-1}{2^x}$ is wrong. For instance, $P=\frac18$, not $\frac14$. Did you miss the requirement that the two Heads be consecutive? – TonyK May 11 '16 at 21:52