I have random variables $a$ and $b$, which are such that $\mathbb{E}[a|b]=0$. I am trying to compute $E[ab]$. Is the following correct? $$\mathbb{E}[ab]=\mathbb{E}[\mathbb{E}[ab|b]]=\mathbb{E}[b\mathbb{E}[a|b]]=0$$

Where I have used the law of iterated expectations. Thank you.

  • $\begingroup$ Hi: The first equality is the law of iterated expectations. It's also called the tower property. $\endgroup$
    – mark leeds
    Apr 25, 2022 at 11:26
  • $\begingroup$ @markleeds Yes. Have I used it correctly? $\endgroup$
    – Charles
    Apr 25, 2022 at 11:28
  • $\begingroup$ You will need $E[ab]$ to exist: there will be examples where it does not even if $E[a \mid b]=0$, such as $b$ being a Cauchy random variable and independently $a=\pm1$ with equal probability $\endgroup$
    – Henry
    Apr 25, 2022 at 12:01
  • $\begingroup$ Hi Charles: You've used it correctly. Robertas explanation gives all the gory details in quite a nice way. My intuition is that, if you have a conditional expectation and then you take the expectation of that conditioned expectation, then you are kind of taking a mean over the whole conditional density ( so in a sense, averaging the condition ), so you get back the unconditioned expectation of that variable. ( the $b$ comes out ). I don't know if that makes sense to you but that's how I think of it. $\endgroup$
    – mark leeds
    Apr 26, 2022 at 14:50

1 Answer 1


Short answer: the equalities are correct (if all those expectations exist), but only the first one is the law of iterated expectations.

Long answer: I'll use notation $X$ and $Y$ for random variables and $x$ and $y$ for their values. Let's assume that $(X,Y)$ has continuous distribution (for discrete distribution the proof below is similar). Then

$$\mathbb{E}(X\cdot Y)=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty} x\cdot y\cdot f(x,y)\, dxdy = \int_{-\infty}^{\infty}\int_{-\infty}^{\infty} x\cdot y\cdot f_X(x|y)\cdot f_Y(y)\, dxdy = $$ $$=\int_{-\infty}^{\infty}y\left(\int_{-\infty}^{\infty} x\cdot f_X(x|y)\,dx\right)f_Y(y)\, dy = \int_{-\infty}^{\infty}y\cdot \mathbb{E}(X|y)\cdot f_Y(y)\, dy = \mathbb{E}(Y\cdot\mathbb{E}(X|Y))$$ Explanation for the last quality:

  1. Keep in mind that $\mathbb{E}(X|y)$ is not a random variable (it's conditional expectation of $X$ with condition $Y=y$). It depends on $y$, so it's a function of $y$.
  2. But in the last integral we have $y\cdot \mathbb{E}(X|y)$, which is another function of $y$, let's say $\varphi(y)$.
  3. $\varphi(y)$ is not a random variable, but $\varphi(Y)=Y\cdot\mathbb{E}(X|Y)$ is random variable and the expectation of that variable is $$\mathbb{E}\varphi(Y) =\int_{-\infty}^{\infty} \varphi(y)\cdot f_Y(y)\, dy = \int_{-\infty}^{\infty}y\cdot \mathbb{E}(X|y)\cdot f_Y(y)\, dy$$ So, if $\mathbb{E}(X|Y)=0$ then $$\mathbb{E}(X\cdot Y) = \mathbb{E}(Y\cdot\mathbb{E}(X|Y)) = \mathbb{E}(Y\cdot 0) = 0$$ Bonus Tip: This proof doesn't require $X$ and $Y$ to be independent.
  • $\begingroup$ The OP doesn't assume $X$ and $Y$ have densities. $\endgroup$ Apr 25, 2022 at 13:07
  • $\begingroup$ It was just an example, not a general proof. The goal was to illustrate why those equalities are correct. $\endgroup$ Apr 25, 2022 at 14:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .