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

a)find the expected number of flips needed.

b)Repeata)in the case where flipping is continued until a total of at least two heads and one tail have been flipped.

c)Repeata)in the case where flipping is continued until a total of at least two heads and two tail have been flipped.

a)I would think it would if $\displaystyle p<1-p$ then the expected number of flips would be $\displaystyle \frac{1}{p}$, and if $\displaystyle p>1-p$ then $\displaystyle \frac{1}{1-p}$.

b)$\displaystyle P(H\geq 2|T=1) = \frac{(1-P(H<2))}{T=1}$

$\displaystyle P(H<2) = P(H=0)+P(H=1)$ assuming there are n flips then you would have:

$\displaystyle 1-\left[ \binom{n}{0}p^0(1-p)^n+\binom{n}{1}p^1(1-p)^{n-1} \right]$

combining it all together you would get :

$\displaystyle \frac{ 1-\left[ (1-p)^n+np(1-p)^{n-1} \right]}{1-p}$

c)This one I'm not sure, but I think it would be something like:

$\displaystyle \left(\frac{1}{p}\right)^{n+1}\times \left(\frac{1}{1-p}\right)^2+\left(\frac{1}{p}\right)^n \times \left(\frac{1}{1-p}\right) \times\left(\frac{1}{p}\right)^m \times \left(\frac{1}{1-p}\right)$ where $\displaystyle n,m\geq 1$

$\displaystyle = \left(\frac{1}{p}\right)^{n+1}\times \left(\frac{1}{1-p}\right)^2+\left(\frac{1}{p}\right)^{n+m} \times \left(\frac{1}{1-p}\right)^2 $ where $\displaystyle n,m\geq 1$

$\displaystyle = \left(\frac{1}{1-p}\right)^2\times \left[\left(\frac{1}{p}\right)^{n+1}+\left(\frac{1}{p}\r ight)^{n+m} \right] $ where $\displaystyle n,m\geq 1$

at which point I'm stuck.