Finding expectation through conditioning

A coin, having probability p of coming up heads is successively flipped until at least one head and one tail have been flipped.

(a)Find the expected number of flips needed.

X=1, if the first flip results in heads

X=2, if the first flip results in tails

N: the total number of flips needed

At this point I'm obviously not able to solve for E[N] because they cancel each other out. What am I doing wrong? I've seriously been looking at this problem for four hours now.

There's another way that I just thought of doing the problem..

But I don't have the solution to the problem, so I can't be sure it's correct. Although I'm not very confident it is anyway..

Re: Finding expectation through conditioning

So if your first flip is a H, then you're waiting for a T. And if your first flip is a T, then you're waiting for a H. In either case the number of additional flips needed follows a geometric distribution (but with different values for "p"). Your second approach seems correct to me.

Re: Finding expectation through conditioning

Quote:

Originally Posted by

**Random Variable** So if your first flip is a H, then you're waiting for a T. And if your first flip is a T, then you're waiting for a H. In either case the number of additional flips needed follows a geometric distribution (but with different values for "p"). Your second approach seems correct to me.

Great, that's the same line of thought I was using for the problem.