1. Nov 19, 2006

### LittleTexan

Hello,

I have this question that is bugging me to death. Ok here it is:

If a coin was flipped a maxium number times of five. What is the expected value for the number of flips required to get either 3 heads or 3 tails.

I know the probability of head or tails is 0.5 and I am not sure where to go from this.

Thanks

2. Nov 19, 2006

### Office_Shredder

Staff Emeritus
Look at the probability of getting 3 heads or 3 tails if you flip the coin once, twice, three times, four times, five times.

3. Nov 20, 2006

### driscoll79

Okay, I think I can help you with this one, but I'll leave the solving up to you. Think about it your p.d.f. of this function - it's binary, isn't it? In other words, if you define "success" to be getting HEADS on a given flip, then "failure" is not getting HEADS, right? So:

$$P("success") = p = \frac{1}{2}$$ and $$P("failure") = 1 - p = 1 - \frac{1}{2} = \frac{1}{2}$$.

Now, since x has a binary pdf, we know that:

$$P(X=x) = f(x) = \left(\begin{array}{c}n\\x\end{array}\right)p^x(1-p)^{n-x}$$

It should be pretty straightforward from there... n is obviously the number of trials that you're doing, which I think you said was 5. x is the number of desired outcomes that you're looking for (so in your case, x=3).

Now, if you're looking for expected value of x, then you should know that's just:

$$\sum_{all x} x f(x)$$

You can figure that one out...