We think of having a girl in the family as a success ($S$). Thus, having a boy in the family will be considered as a failure ($F$). Let $X$=the number of male children in the family. That is, $X$ is the number of failures that precede the $r$th success. Here $r=2$.
The random variable $X$ obeys the negative binomial distribution, since this question satisfies the conditions of negatve binomial distribution:
- The experiment consists of a sequence of independent trials.
- Each trial can result in either a success ($S$) or a failure ($F$).
- The probability of success is constant from trial to trial, here $P(S\ \text{on trial}\ i)=p=0.5$ for $i=1,2,3,\ldots$
- The experiment continues (trials are performed) until a total of $r$ successes have been observed, where $r=2$.
By the analysis of the pmf of negative binomial random variable, we have
\[
nb(x;r,p)=\binom{x+r-1}{r-1}p^{r}(1-p)^x
\]
(a)
The probability that the family has $x$ male children is
\[
\begin{split}
P(X=x)&=nb(x;r,p)=\binom{x+r-1}{r-1}p^{r}(1-p)^x\\
&=nb(x;2,0.5)=\binom{x+2-1}{2-1}0.5^{2}(1-0.5)^x\\
&=\binom{x+1}{1}\cdot 0.5^2\cdot 0.5^x\\
&=\frac{x+1}{2^{x+2}}
\end{split}
\]
(b)
The family has four children means that the family has two boyes and tow girls.
Hence, the probability that the family has four children is
\[
P(X=2)=\frac{2+1}{2^{2+2}}=\frac{3}{16}=0.1875
\]
(c)
The family has at most four children means that the number of boys are 0, 1 or 2. Hence, the probability of this event is
\[
\begin{split}
P(X=0\ \text{or}\ X=1\ \text{or}\ X=2)&=P(X=0)+P(X=1)+P(X=2)\\
&=\frac{0+1}{2^{0+2}}+\frac{1+1}{2^{1+2}}+\frac{2+1}{2^{2+2}}\\
&=\frac{1}{4}+\frac{2}{8}+\frac{3}{16}\\
&=0.6875
\end{split}
\]
(d)
The number of male children we expected this family to have is just the mean value of rv $X$. By the formula of mean value (see Question 2444), we have
\[
E(X)=\frac{r(1-p)}{p}=\frac{2(1-0.5)}{0.5}=2.
\]
And therefore, the number of children we would expect this family to have is equal to $E(X+2)=E(X)+2=2+2=4$.