Review Question Help; Discrete Math Let p be a real number with 0 < p < 1. When and have a
child, this child is a boy with probability p and a girl with probability 1 − p, independent
of the gender of previous children. Lindsay and Simon stop having children as soon as they
have a child that has the same gender as their first child. 
I just don't know how to solve it
Any help is appreciated. Thanks
 A: We  use a conditional expectation argument. Given the first is a boy, ($1$ child already) the expected  number of additional  trials (children, they are a trial) until another boy comes is $\frac{1}{p}$.  Here we used a standard fact about the expectation of a geometrically distributed random variable with parameter $p$
.And given that the first child is a girl, the expected number of additional trials until a girl comes is $\frac{1}{1-p}$. Thus the total expected number of children is
$$p\left(1+\frac{1}{p}\right)+(1-p)\left(1+\frac{1}{1-p}\right).$$
This simplifies to $3$.
A: The possibilities are $BG^kB$ and $GB^kG$ and the chances of neither occurring are zero. Also, these possibilities are mutually exclusive.
The probability of the first is $p^2(1-p)^k$ and the probability of the second is $(1-p)^2 p^k$.
Then the expected value is $\sum_{k=0}^\infty (k+2) (p^2(1-p)^k+(1-p)^2 p^k)$.
For $|x|<1$, you have $\sum_{k=0}^\infty x^k = {1 \over 1-x}$, and differentiating both sides will give an expression for $\sum_{k=1}^\infty k x^{k-1}$.
Note that $\sum_{k=0}^\infty (2) (p^2(1-p)^k+(1-p)^2 p^k)$ can be computed purely by the fact that the various events are mutually exclusive and that
they essentially cover the whole space (it is possible that poor Lindsay will have an infinite number of children).
