An event has probabilitypof success andq(=1-p) of failure. Independent trials are carried out until at least one success and one failure has occurred. Find the probability thatrtrials are necessary $\displaystyle (r\geq2)$ and show that this probability equals $\displaystyle (\frac{1}{2})^{r-1}$ when $\displaystyle p=\frac{1}{2}$.

A couple decide that they will continue to have children until they have both a boy and girl or they have four children. Assuming boys and girls are equally likely to be born, what will be the expected size of the completed family.

$\displaystyle P(p)=p+pq+pq^2+pq^3+...+pq^{r-1}$

$\displaystyle P(q)=q+qp+qp^2+qp^3+...+qp^{r-1}$

Sum of the general term =$\displaystyle P(p)+P(q)=pq(p^{r-2}+q^{r-2})$

when $\displaystyle p=\frac{1}{2} \rightarrow q=\frac{1}{2}$

$\displaystyle \frac{1}{4}[(\frac{1}{2})^{r-2}+(\frac{1}{2})^{r-2}]$

$\displaystyle =(\frac{1}{2})^r+(\frac{1}{2})^r$

$\displaystyle =2(\frac{1}{2})^r$

$\displaystyle =(\frac{1}{2})^{r-1}$

So I have gotten these parts right, but about the last part, how do I do it?

Because I suppose I use $\displaystyle (\frac{1}{2})^{r-1}$ to find the probability of having a boy and girl after r trials. So I find the value when r is 2, 3, and 4? and then each of those multiply by the number of children?

Thanks