# How to use law of total expectation to show $\mathbb{E}[Y\mid X,Z] = \sum_{w \in \mathcal{W}} \mathbb{E}[Y\mid X,Z,W=w]\mathbb{P}(W=w\mid X,Z)$?

I am wondering how I can show for discrete random variables $$Y, X, Z, W$$ that:

$$\mathbb{E}[Y\mid X,Z] = \sum_{w \in \mathcal{W}} \mathbb{E}[Y\mid X,Z,W=w]\mathbb{P}(W=w\mid X,Z)$$

I am trying to use the law of iterated expectations and total probability, but am unable to get the right form. Is it because I am abusing notation on the conditional? (which should be conditioned on a value)?

The notation is fine. If you understand $$E[Y] = \sum_{w \in \mathcal{W}} E[Y \mid W=w] P(W=w)$$ holds for any [discrete] random variables $$Y$$ and $$W$$, then you are done.
In the original question, conditioning just changes the probability distribution of $$Y$$ and $$W$$, and is notated using $$P(\cdot \mid X, Z)$$ and $$E[\cdot \mid X, Z]$$. You can then apply the law of total expectation.
• Thanks! For the equation $E[Y] = \sum_{w \in \mathcal{W}} E[Y \mid W=w] P(W=w)$, is there a special name for it? Or is it something independently proved? – user321627 Nov 2 '18 at 1:44
• Yes. It is the Law of Total Expectation: $$\mathsf E(Y) ~{=\mathsf E(\mathsf E(Y\mid W))\qquad\text{in general}\\= \sum_{w\in\mathcal W}\mathsf E(Y\mid W=w)\mathsf P(W=w)\qquad\text{for discrete random variables}}$$ – Graham Kemp Nov 2 '18 at 3:07