# Covariance dependent Binomial variables

Suppose $Y \sim \mathrm{Bin}(n,p)$ given $\Theta=(p,q)$ and $Z \sim \mathrm{Bin}(y,q)$ given $Y=y$ and $\Theta=(p,q)$. Now I want to determine the variance of $Z-Y$, but I don't know how. I know $\operatorname{Cov}(Z,Y)=E(ZY)-E(Z)E(Y)$, but I'm stuck on the first term.

## 1 Answer

We'll use the result $\mathbb{E}[X] = \mathbb{E}[ \mathbb{E}[X\mid Y] ]$

It's easy to see that

$$\mathbb{E}[Z\mid Y] = Y q$$

Now,

\begin{align} \mathbb{E}[ZY ] &= \mathbb{E} [ \mathbb{E}[ZY \mid Y] ] \\ &= \mathbb{E}[ Y \mathbb{E}[Z\mid Y] ] \\ &= \mathbb{E}[ q Y^2 ]\\ &= npq ( np + 1 - p) \end{align}

You'll also need the second moment of $Z$, can you figure out how to calculate it now?

• Thanks! Only have one question, why it's E[Z|Y]=Yq? – Roos Jansen Oct 20 '15 at 19:49
• Just the mean of a $(Y,q)$ binomial random variable. Perhaps it's clearer if I write $\mathbb{E}[ Z ~| Y=y] = yq$, and so $\mathbb{E}[Z ~| Y]$ is a well defined random variable, the value of which is $qY$. It's generally important to remember that conditional expectations with respect to a $\sigma$-field are themselves random variables in that $\sigma$ field. – stochasticboy321 Oct 21 '15 at 0:45