# Homework Help: Marginal probability & law of iterated expectations for three jointly distributed RVs

1. Sep 21, 2012

### slakedlime

1. The problem statement, all variables and given/known data
Consider three random variables $X, Y,$ and $Z$. Suppose that:
$Y$ takes on $k$ values $y_{1}.... y_{k}$
$X$ takes on $l$ values $x_{1}.... x_{l}$
$Z$ takes on $m$ values $z_{1}.... z_{m}$

The joint probability distribution of $X, Y,$ and $Z$ is $Pr(X=x, Y=y, Z=z)$, and the conditional probability distribution of Y given X and Z is:
$Pr(Y=y|X=x, Z=z) = \frac{Pr(Y=y, X=x, Z=z)}{Pr(X=x,Z=z)}$

(a) Explain how the marginal probability that $Y=y$ can be calculated form the joint probability distribution.
(b) Show that $E(Y) = E[E(Y|X,Z)]$

I have an intuitive grasp of how to reach the answers. However, I'd appreciate knowing if I need to show more steps/rigor and more precise notation in my proof for full credit. I just started learning about probability, summation, etc. and have trouble with notation and rigor. Thank you!

2. Relevant Formulae
Law of total expectation for two jointly distributed, discrete RVs:
$$E(Y) = \sum_{i = 1}^{k}E(Y|X=x_{i})Pr(X=x_{i})$$

3. The attempt at a solution

Part (a)

We know:
$$Pr(Y=y|X=x, Z=z) = \frac{Pr(Y=y, X=x, Z=z)}{Pr(X=x,Z=z)}$$
$$Pr(Y=y, X=x, Z=z) = Pr(Y=y|X=x, Z=z)*Pr(X=x,Z=z)$$

The marginal probability of Y is:
$$Pr(Y=y_{i}) = Ʃ[Pr(Y=y_{i}, X=x_{j}, Z=z_{h})]$$
That is, if we wanted to get the marginal probability of Y, we'd sum up all the joint probabilities for X, Y and Z [is this assumption correct?]

Using the intuition of this, we can expand the marginal probability to find a more precise answer:
$$Pr(Y=y_{i}) = \sum_{j = 1}^{l}[\sum_{h = 1}^{m} Pr(Y=y_{i} | X = x_{j}, Z = z_{h})*Pr(X=x_{j}, Z=z_{h})]$$

In the inner summation sign, holding X constant, we find the joint probability of all Y's and Z's for that fixed X. Then, using the outer summation sign, we sum up all the joint probabilities we just found for ALL values of X.

Would this be sufficient for the proof? Am I making the correct assumptions?

Part (b)
From the definition of E(Y), we know:
$$E(Y) = \sum_{i = 1}^{k}y_{i}Pr(Y=y_{i})$$

Plugging in the marginal probability of Y derived in part (a):
$$E(Y) = \sum_{i = 1}^{k}y_{i}[\sum_{j = 1}^{l}\sum_{h = 1}^{m} Pr(Y=y_{i} | X = x_{j}, Z = z_{h})*Pr(X=x_{j}, Z=z_{h})]$$

Rearranging:
$$E(Y) = \sum_{j = 1}^{l}\sum_{h = 1}^{m} [\sum_{i = 1}^{k}y_{i} Pr(Y=y_{i} | X = x_{j}, Z = z_{h})]Pr(X=x_{j}, Z=z_{h})$$

The part I just bracketed is the expectation of Y conditional on X and Z. Hence:
$$E(Y) = \sum_{j = 1}^{l}\sum_{h = 1}^{m} E(Y|X = x_{j}, Z=z_{h})Pr(X=x_{j}, Z=z_{h})$$

Comparing this against the total of total expectation for two variables, we can see:
$$E(Y) = E[E(Y|X,Z)]$$

Do I need to show any additional steps before making this conclusion?

Last edited: Sep 21, 2012