Geometric distribution example (making kids until couple has a boy and a girl), need explanation So the condition is following: a man and a woman want to have kids : girl and a boy. They continue to make kids until they get both genders. What is the expected number of kids?
As I remember, the solution was following:
$$E[x] = 1 + 1/p = 3$$
Can someone explain why? How we get this expression and number of $3$?
It is very confusing for me...
Thank you. 

The given expression $$E[X]=1+\frac1p=3$$ can be explained as follows


*

*The term "$1$" stands for the first kid (if you want to have two kids you have to start by having the first kid). This kid has certainly a gender (is boy or girl) so you have the one gender after the first try! (great).

*Now, you have to keep trying until you get the second gender. Assuming equal probability of each gender (i.e. $1/2$ for a boy and the same for a girl), the number $N$ of efforts until the first success (getting the missing gender) is geometrically distributed with parameter $p=1/2$. It is well known that the expected value of $N$ is equal to $$E[N]=\frac{1}{p}=\frac{1}{\frac12}=2$$


Therefore adding the first birth and using the linearity of expectation, you derive the given expression of the expected number of tries, i.e. $$E[X]=E[1+N]=1+E[N]=1+\frac{1}{p}\overset{p=\frac12}=1+2=3$$
