#
Question

Consider three random variables X, Y, and Z. Suppose that Y takes on k values y_1, ..., y_k, that X takes on l values x_1, ..., x_l and that Z takes on m values z_1, ..., z_m. The joint probability distribution of X, Y, 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) = Pr(Y = y, X = x, Z = z)/Pr(X = x, Z = z). Explain how the marginal probability that Y = y can be calculated from the joint probability distribution. Show that E(Y) = E[E(Y|X, Z)].