Conditional expectation with Bernoulli distribution 
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..
 A: Your definition of $\mathbb E[Y|X]$ is not valid and $\mathbb E[Y|X]$ is a random variable (not a real number). Also it is unclear what you mean with notation $\Bbb P(X)$.
$Y$ can take other values than $0$ and $1$ so does not have Bernoulli distribution.

Under condition $X=n$ random variable $Y$ has binomial distribution with parameters $n$ and $p$.
This tells us immediately that:$$\Bbb E[Y\mid X=n]=np$$
From this we conclude that:$$\mathbb E[Y\mid X]=Xp$$
In general we have the equality:$$\mathbb EY=\mathbb E(\mathbb E[Y|X])$$and applying that here we find:$$\mathbb EY=\mathbb E[Xp]=p\mathbb EX=p\mu$$
A: $\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)$.
