1. ## Expected family size

An event has probability p of success and q(=1-p) of failure. Independent trials are carried out until at least one success and one failure has occurred. Find the probability that r trials 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

2. There are only three possibilities.
Define the random variable X=number of children.

$\displaystyle P(X=2)=P(\{{\rm boy, girl\} \quad or \quad\{ girl,boy}\})=2pq$

Next obtain $\displaystyle P(X=3)$ and $\displaystyle P(X=4)$.

3. Originally Posted by matheagle
There are only three possibilities.
Define the random variable X=number of children.

$\displaystyle P(X=2)=P(\{{\rm boy, girl\} \quad or \quad\{ girl,boy}\})=2pq$

Next obtain $\displaystyle P(X=3)$ and $\displaystyle P(X=4)$.
X? so X is the number of children or in other words r in $\displaystyle (\frac{1}{2})^{r-1}$?
thanks