Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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?

Thanks

share|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
add comment

1 Answer

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|improve this answer
add comment

Your Answer

 
discard

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