Suppose the number of children in a family is a random variable $X$ with expectation $\mu$, and given $X = n$ for $n\ge1$, each of the $n$ children in the family is a girl with probability $p$ and a boy with probability $1 − p$. Let $Y$ be the number of girls in this family. Compute $\mathbb{E}[Y|X]$ and $\mathbb{E}[Y]$.
I would say that $Y$ is a Bernoulli random variable with probability $p$, i.e. if we say that $Z=1$ is "child is a girl" and $Z=0$ is "child is a boy", we have $\mathbb{P}(Z=1)=p$ and $\mathbb{P}(Z=0)=1-p$. Then we know $\mathbb{E}[Y]=p$, is it so trivial?
Then $\mathbb{E}[Y|X]$ is defined as $\mathbb{E}[Y|X]=\frac1{\mathbb{P}(X)}\int_X Yd\mathbb{P}$, but $X$ is just the number of the children, so $\mathbb{P}(X)=1$? What about the integral of $Y$? Sorry but i got confused in this problem..
$\mathbb{E}[Y|X]=\frac1{\mathbb{P}(X)}\int_X Yd\mathbb{P}$ does not make sense. $X$ is random variable and the formula is valid only when $X$ is an event.
$E(Y|X=n)=\sum\limits_{k=0}^{n} kP(Y=k|X=n)$. And $P(Y=k|X=n)=\binom {n} {k}p^{k}(1-p)^{k}$ [The probability that $k$ of the $n$ children are girls]. I will let you finish the computation.
Also, $P(Y=k)= \sum\limits_{k=n}^{\infty}P(Y=k|X=n) P(x=n)$ and $EY=\sum kP(Y=k)$.