Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A coin having probability $p$ of coming up heads is continually flipped until both heads and tails have appeared. Find the expected number of flips.

Here's my guess: $$E[\text{at least one head and at least one tails]}=E[\text{number of flips until first heads, given the first flip is a tails}]*P(\text{first flip is tails})+E[\text{number of flips until first tails, given the first flip is a heads}]*P(\text{first flip is heads})=\left({1+\frac{1}{p}}\right)(1-p)+\left({1+\frac{1}{1-p}}\right)p$$

Does this look right? If so, can you help me understand why it's right? I mainly came up with this on intuition. If it's wrong, where did I go wrong?


share|cite|improve this question
You may be uncertain about arguing that if the probability of success is $a\ne 0$, then the expected number of trials until the first success is $\frac{1}{a}$. This is a standard result about the geometric distribution, with a relatively easy proof, that does not involve any guessing. The rest of your argument is a conditional expectation argument, perfectly correct. – André Nicolas Dec 5 '13 at 23:58
up vote 0 down vote accepted

Your logic is correct and I think well explained. I don't know why you don't like it.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.