Binomial Distribution - independence I have the following problem that I'm stuck on a few parts.
Suppose that p=P(male birth)=0.5 and births are independent. 
A couple wishes to have exactly two female children in their family.
They will have children until this condition is fulfilled.
Let X= the number of children until the condition is fulfilled.

a. What is the probability that the family has x male children?
b. What is the probability distribution of X?
c. What is the probability that the family has at most four children?
d. How many children would you expect this family to have?

Below is what I currently have:
$a. \binom{x+2-1}{2-1} (.5)^2 (1-.5)^x =nb(x, 2, .5)$
$b. nb(x, 2, .5)   $<--- isn't this the exact same as part a? I don't really understand what is different here
c. $\binom{3}{1}(.5)^2 (.5)^2 = .188 $ <-- the chance for four children
P(at most four children) = 1 - .188 = .812
d. Not sure, however I'd guess 4 children. Could someone explain this part to me?
 A: The problem defines $X$ as the number of children.
Then in part a) it asks about male children. Potentially confusing!
a) There are $x$ male children if there is one female among the first $x+1$ children, and a female on the $(x+1)$-th birth. So the probability that the number of male children is $x$ is equal to $\binom{x+1}{1}\frac{1}{2^{x+2}}$. 
b) This  is a little different, for it asks for the probability distribution of $X$, the number of children. The same reasoning as the one above shows that
$$\Pr(X=x)=\binom{x-1}{1}\frac{1}{2^x}.\tag{1}$$ 
c) For the probability of at most $4$ children, we want $\Pr(X=2)+\Pr(X=2)+\Pr(X=4)$.  Now we can use (1).
Alternately, we could imagine that instead of stopping when there are $2$ females, the person keeps having children until there are $4$. Then the probability for c) is the probability of $2$ or more females in $4$ births. This is a binomial distribution problem, so the probability for c) can also be written as $\frac{\binom{4}{2}+\binom{4}{3}+\binom{4}{4}}{2^4}$. 
d) One can look up the expectation of the negative binomial.  There is a potential for confusion, because negative binomial is used in two ways, number of successes until the $r$-th failure, or number of trials until the $r$-th success. 
Or else one can derive a formula for the expectation, either in general or for our particular case. Attacked directly, that involves summing an infinite series. 
Or else we can say that the expected number of children until the second female is the number of children until the first female, plus the number of births from the first female to the second. 
The  number of children up to and including the first female has geometric distribution, parameter $p=1/2$. Thus the expected number up to and including the first female is $1/p$, which is $2$. Similarly, the number of children between the first female (not inclusive) and the second (inclusive) has geometric distribution with mean $2$. 
Thus the mean number of children, as you conjectured, is $4$. 
