If $\mathcal{A}$ is a union of disjoint sets $\mathcal{A}_i$, is $E(X|\mathcal{A}) = \sum_{i=1}^k E(X|\mathcal{A}_i)$? Suppose $X$ is a random variable. Let $\mathcal{A}$ be a set that is made up of disjoint subsets $\mathcal{A}_1, \ldots, \mathcal{A}_k$, i.e.
$$\bigcup_{i=1}^k \mathcal{A}_i = \mathcal{A}, \quad \mathcal{A}_i \cap \mathcal{A}_j = \emptyset \ \text{ for }\  \forall i, j: i \neq j.$$ I'm interested in the conditional expectation $E(X|\mathcal{A})$. How can I write it in terms of $E(X|\mathcal{A}_i)$ for $i = 1, \ldots, k$?
Is it $$E(X|\mathcal{A}) = E(X|\mathcal{A}_1) + \ldots + E(X|\mathcal{A}_k)?$$
 A: Assuming that $\mathbb{P}(\mathcal{A})>0$ you can use the rule:
$$\boxed{\mathbb{E}(X|\mathcal{A}) = \frac{\sum_i \mathbb{E}(X|\mathcal{A}_i) \cdot p(\mathcal{A}_i)}{\sum_i p(\mathcal{A}_i)} }$$
Derivation: Application of the law of iterated expectation gives the general rule:
$$\begin{align}
\mathbb{E}(X|\mathcal{A}) 
&= \mathbb{E}(\mathbb{E}(X|\mathcal{A}_i)|\mathcal{A} ) \\[14pt]
&= \sum_i \mathbb{E}(X|\mathcal{A}_i) \cdot \mathbb{P}(\mathcal{A}_i|\mathcal{A}) \\[6pt]
&= \sum_i \mathbb{E}(X|\mathcal{A}_i) \cdot \frac{p(\mathcal{A}_i)}{\sum_i p(\mathcal{A}_i)} \\[6pt]
&= \frac{\sum_i \mathbb{E}(X|\mathcal{A}_i) \cdot p(\mathcal{A}_i)}{\sum_i p(\mathcal{A}_i)}. \\[6pt]
\end{align}$$
You can also derive this result this way:
$$\begin{align}
\mathbb{E}(X|\mathcal{A}) 
&= \sum_{x \in \mathscr{X}} x \cdot p(X=x|\mathcal{A}) \\[6pt]
&= \sum_{x \in \mathscr{X}} x \cdot \frac{p(X=x,\mathcal{A})}{p(\mathcal{A})} \\[6pt]
&= \sum_{x \in \mathscr{X}} x \cdot \frac{\sum_i p(X=x,\mathcal{A}_i)}{\sum_i p(\mathcal{A}_i)} \\[6pt]
&= \sum_{x \in \mathscr{X}} x \cdot \frac{\sum_i p(X=x|\mathcal{A}_i) p(\mathcal{A}_i)}{\sum_i p(\mathcal{A}_i)} \\[6pt]
&= \frac{\sum_i [\sum_{x \in \mathscr{X}} x \cdot p(X=x|\mathcal{A}_i)] \cdot p(\mathcal{A}_i)}{\sum_i p(\mathcal{A}_i)} \\[6pt]
&= \frac{\sum_i \mathbb{E}(X|\mathcal{A}_i) \cdot p(\mathcal{A}_i)}{\sum_i p(\mathcal{A}_i)}. \\[6pt]
\end{align}$$
