$\operatorname{E}[X] $ and $\operatorname{E}[X\mid Y]$ for transformed binomial Let $Y$ denote the number of eggs laid by a turtle. It is Poisson distributed with $\operatorname{E}(Y)= \lambda$. The probability that an egg produces a turtle that survives to adulthood is $p$ and independent for each egg. Let $X$ denote the number of such eggs that survive to adulthood. Thus, conditioned on $Y$ the law of $X$ is $\operatorname{Binomial}(p,Y)$.
(a) Determine $\operatorname{E}(X\mid Y)$ and $\operatorname{E}(X).$
(b) Determine $\operatorname{var}(\operatorname{E}(X\mid Y))$ and $\operatorname{var}(X).$
(c) Determine the covariance of $X$ and $Y$.
Solution: (Are they correct?)  
(a) $E(X|Y)=pY$
$\quad E(X)=E(E(X|Y))=E(pY)=pE(Y)=p\lambda$  
(b) $var(E(X|Y))= var(pY)=pvar(Y)=p\lambda; var(Y)=\lambda$ as this is the variance of a poisson distribution.
$\quad var(X)=var(E(X|Y))+E(var(X|Y))$
$var(E(X|Y))=p\lambda$
$E(var(X|Y)); var(X|Y)$ is the variance of a binomial distribution i.e., $pY(1-p)$ and now apply $E$ and obtain $E(pY(1-p))$; not sure what to do from here.
(c) $cov(X,Y)=E(XY)-E(X)E(Y)$
$\quad E(X)=p\lambda, E(Y)=\lambda, E(XY)$ (answered below)
Please let me know if what I have is correct, and if so, I would appreciate some help with the unfinished portion of (b).  
 A: The conditional distribution of $X$ given $Y$ is $pY$. Thus for example, supposing $Y=4$, the we have $\operatorname{E}(X\mid Y=4) = 4p,$ and we have
\begin{align}
\Pr(X=0 \mid Y=4) & = \binom 4 0 p^0 (1-p)^4 \\[4pt]
\Pr(X=1 \mid Y=4) & = \binom 4 1 p^1 (1-p)^3 \\[4pt]
\Pr(X=2 \mid Y=4) & = \binom 4 2 p^2 (1-p)^2 \\[4pt]
\Pr(Y=3 \mid Y=4) & = \binom 4 3 p^3 (1-0)^1 \\[4pt]
\Pr(X=4 \mid Y=4) & = \binom 4 4 p^4 (1-p)^0.
\end{align}
But notice that although $\Pr(X=5\mid Y=4)$ is $0$, nonethless $\Pr(X=5)$ is not $0$, since $\Pr\Big(Y=\text{(for example) }6\Big)$ is not $0$ and if $Y=6$ then $X$ the probability that $X=5$ is not $0$.
So we have $\operatorname{E}(X\mid Y) = Yp.$
And then we find $\operatorname{E}(X) = \operatorname{E}\big( \operatorname{E}(X\mid Y)\big) = \operatorname{E}(Yp) = p\operatorname{E}(Y) = p\lambda.$
Then you should also recall that
$$
\operatorname{var}(X) = \operatorname{var}(\operatorname{E}(X\mid Y)) + \operatorname{E}(\operatorname{var}(X\mid Y).
$$
The first term above is the "explained component" of the variance of $X$ and the second is the "unexplained component." The idea there is that the variability of $Y$ explains part of that of $X$ but not all of it: even with $Y$ fixed, some variability of $X$ still remains.
\begin{align}
\operatorname{E}(XY) & = \operatorname{E}(\operatorname{E}(XY\mid Y)) \\[10pt]
& = \operatorname{E}( Y \operatorname{E}(X\mid Y)) & & \text{because when one conditions on $Y$,} \\ & & & \text{then one treats $Y$ as “constant.''} \\[10pt]
& = \operatorname{E}(Y \cdot pY) \\[6pt]
& = p\operatorname{E}(Y^2) \\[6pt]
& = p(\lambda+\lambda^2)
\end{align}
and then one can use this expected value of the product in the process of finding the covariance, and then use that in finding the correlation.
