Showing $E(X) = \sum_{i}E(X\mid A_i)P(A_i)$

81 Views Asked by At

Following is my proof.

Suppose $X$ is a discrete-type random variable ranging in the set $S$ and $\{A_i : i=1,2,3,\dots\}$ is a finite or countably infinite partition of a sample space $\Omega$.

We have $$P(X=x) = \sum_i{P(X=x\mid A_i)P(A_i)}$$ So $$xP(X=x) = \sum_i{xP(X=x\mid A_i)P(A_i)}$$ Thus $$ \begin{aligned} E(X) &= \sum_{x\in{S}}{xP(X=x)} \\ &= \sum_{x\in{S}}{\sum_i{xP(X=x\mid A_i)P(A_i)}} \\ &= \sum_i{\sum_{x\in{S}}{xP(X=x\mid A_i)P(A_i)}} \\ &= \sum_i{P(A_i)E(X\mid A_i)} \end{aligned} $$

Is this right?