I'm trying to prove the following identity, stated in Bertsekas's Introduction to Probability, 2nd edition, pg. 114:
If $A_1,...,A_n$ are disjoint events that form a partition of the sample space, with P$(A_i)>0$ for all $i$, then $$\text{E}[X]=\sum_{i=1}^{n}P(A_i)E[X|A_i]$$
Things I know that may be useful:
- $\text{E}[X|A]=\sum_{x}xP_{X|A}(x)$
- $P_{X}{(x)}=\sum_{i=1}^{n}P(A_i)P_{X|A_i}(x)$, where $A_1,...,A_n$ are disjoint events that form a partition of the sample space
This is what I've gotten so far (which isn't much):
\begin{align} E[X]&=\sum_{x}xP_{X}(x)\\ &=\sum_{x}x[\sum_{i=1}^{n}P(A_i)P_{X|A_i}(x)]\\ &=\sum_{x}\sum_{i=1}^{n}P(A_i)P_{X|A_i}(x)x \end{align}
I've tried to expand the double summation but it didn't seem to lead anywhere. Can someone help? Thanks very much in advance.