Problem Statement

Let $X$ and $Y$ be random variables such that $X \sim \text{Poisson}(\lambda)$ and $Y|X \sim \text{Binomial}(x+1,p)$. Find $\text{Cov(X,Y)}$.

Attempt at a Solution

I would like to be able to write $Y$ as $X + Z$ where $Z$ is Poisson and independent of $X$, since then by this question the variance is easy to compute. To this end, write $Y|X$ as a sum of independent binomials: $ Y|X = Z_1|X + Z_2|X, $ where $Z_1|X \sim \text{Binomial}(1,p)=\text{Bernoulli}(p)$ and $Z_2 | X \sim \text{Binomial}(x,p).$ Then $Z_2 \sim \text{Poisson}(\lambda p)$, which we can obtain by directly computing the pdf: \begin{aligned} P(Z_2 = z) &= \sum_x P(Z_2=z, X=x)\\ &= \sum_x P(Z_2=z\mid X=x)P(X=x) \\ &= \sum_{x=y}^\infty \frac{e^{-\lambda} \lambda^x}{x!}\frac{x!}{z!(x-z)!}p^z(1-p)^{x-z} \\ &= \frac{(\lambda p)^z}{z!}e^{-\lambda p} \sum_{x=z}^\infty \frac{[\lambda(1-p)]^{x-z} e^{-\lambda(1-p)}}{(x-z)!} \\ &= \frac{(\lambda p)^z}{z!}e^{-\lambda p}. \end{aligned} However, I cannot get the same approach to simplify for $Z_1|X$, which instead involves the CDF of $X$. I also tried this approach on $Y|X$ directly, hoping to obtain a sum in the form of the expectation of $X$, but I can't seem to reduce it. Even if I could, I'd still need to compute $E[XY]$ for the covariance. I suspect there may be a better approach than grinding through several more sums.

  • 2
    $\begingroup$ I think you're making it too complicated introducing this variable $Z$. Just compute $\bar X = E_X E_{Y\mid X} X$, $\bar Y = E_X E_{Y\mid X} Y$, and $\mathrm{Cov}(X,Y) = E_X E_{Y\mid X} (X - \bar X)(Y - \bar Y)$. Because everything factorizes all the sums are straightforward. $\endgroup$
    – jwimberley
    Commented Jan 9, 2017 at 1:33
  • $\begingroup$ @jwimberley I'm struggling with the definition of the subscript notation. I can see that $E[Y] = E[E[Y \mid X]]$, which is known, but I can't work out what $E_X E_{Y|X} X$ means. $\endgroup$ Commented Jan 9, 2017 at 20:41
  • $\begingroup$ The notation $E_X$ means the expectation over the distribution of the random variable $X$. This is alternative notation to $E[E[\cdot \mid X]]$ used in the answer. $\endgroup$
    – jwimberley
    Commented Jan 9, 2017 at 21:35

2 Answers 2



$X$ can take on integer values in $[0,\infty)$. Given any value of $X$, say $X = k$, $Y$ can take on any integer value in $[0,k+1]$. Thus, for any given integer $k \in [0,\infty)$, \begin{align}P\{X = k, Y = \ell\} &= P\{X = k\}P\{Y = \ell\mid X = k\}\\ &= \begin{cases}\displaystyle e^{-\lambda}\frac{ \lambda^k}{k!} \cdot \binom{k+1}{\ell}p^{\ell}(1-p)^{k+1-\ell}, & 0 \leq \ell \leq k+1,\\ \\ 0, & \ell > k+1,\end{cases}\end{align} and you can compute $\operatorname{cov}(X,Y)$ from the joint mass function.

More simply, use the law of iterated expectation to get that \begin{align}E[XY] &= E\left[E[XY\mid X]\right]\\ &= E\left[X\cdot E[Y\mid X ]\right]\\ &= E[X (X+1)p]\end{align} where I will leave the computation of that last expectation of a function of $X$ to you. Note that $E[X]$ is known, and there is a hidden nugget in the above series of equalities that will tell you what $E[Y]$ is Put all this together with $\operatorname{cov}(X,Y) = E[XY]-E[X]E[Y]$ to find the answer that you seek.

  • $\begingroup$ I was looking for an expression like $E[E[XY \mid X]] = E[X\ E[Y\mid X]]$ but couldn't get one from the definition $E[X|Y=y]$ (which is all I have available to me in the course text). With this I can now solve the problem, but still not by directly summing over the joint mass function. Should I be able to compute that sum directly? $\endgroup$ Commented Jan 9, 2017 at 20:53
  • 1
    $\begingroup$ $E[X\mid Y]$ is a random variable; $E[X\mid Y =y]$ is a real number. See, for example this answer of mine which discusses the difference. See also this other answer of mine which writes out a step-by-step proof of why the Law of Iterated Expectation works, and suggests how you can get to the final answer using the joint mass function and not even mentioning conditional expectations. $\endgroup$ Commented Jan 9, 2017 at 21:36

Note that $E(Y)=E(E(Y|X)) = E((X+1)p) = (\lambda+1)p$. Hence: \begin{equation} \begin{aligned} Cov(X,Y) &= E\Big((X-E(X))(Y-E(Y))\Big) \\ &= E\Big((X-\lambda)(Y-(\lambda+1)p)\Big) \\ &= E\Big((X-\lambda)(E(Y|X)-(\lambda+1)p)\Big) \\ &= E\Big((X-\lambda)((X+1)p-(\lambda+1)p)\Big) \\ &= pE\Big((X-\lambda)(X-\lambda)\Big) \\ &= pVar(X) \\ &= p\lambda \end{aligned} \end{equation}


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.