Why Split an Expectation?
A random variable may be simple on each of several regions even when its overall formula looks complicated. A function might use one rule below a threshold and another rule above it; a model might also assign a special value to an event with positive probability. In these situations, calculate the expectation by finding each region’s contribution and adding them.
The essential bookkeeping is that the regions must be disjoint and must cover the sample space. The validity of the sum also depends on whether the random quantity is nonnegative or integrable. These conditions prevent a sum of contributions from concealing undefined cancellation.
The Partition Identity
For any real-valued random variable \(Y\), the contribution from event \(A_j\) is \(E[Y\mathbf{1}_{A_j}]\), where \(\mathbf{1}_{A_j}\) equals one on \(A_j\) and zero elsewhere. This is an expectation of the original quantity, set to zero off the specified region. It is not an average within that region.
Proof for nonnegative \(Y\). For a countable partition, define \(B_m=\bigcup_{j=1}^{m}A_j\) and \(Y_m=Y\mathbf{1}_{B_m}\). The sequence \(Y_m\) is nonnegative and increases pointwise to \(Y\), because every point belongs to one of the partition events. By the monotone convergence theorem,
The middle equality uses finite additivity of expectation for the finite sum of nonnegative random variables \(Y\mathbf{1}_{A_j}\). For a finite partition the same argument ends after its last event. Proof for integrable signed \(Y\). The variables \(Y_m=Y\mathbf{1}_{B_m}\) converge pointwise to \(Y\), and \(|Y_m|\leq |Y|\). Since \(E[|Y]|<\infty\), dominated convergence gives \(E[Y_m]\to E[Y]\). Finite additivity gives \(E[Y_m]=\sum_{j=1}^{m}E[Y\mathbf{1}_{A_j}]\). Also, $$ \sum_j\left|E[Y\mathbf{1}_{A_j}]\right| \leq \sum_j E[|Y|\mathbf{1}_{A_j}] =E[|Y|], $$ where the final equality is the nonnegative identity just proved, applied to \(|Y|\). Thus the series converges absolutely and its sum is \(E[Y]\). \(\square\)
Piecewise Functions as Region Contributions
Suppose a random variable \(X\) is divided into disjoint regions \(A_1,\ldots,A_k\), and on \(A_j\) the quantity of interest is given by a measurable rule \(g_j(X)\). The resulting random variable can be written as $$ Y=\sum_{j=1}^{k}g_j(X)\mathbf{1}_{A_j}. $$ If \(Y\) is integrable, finite additivity gives $$ E[Y]=\sum_{j=1}^{k}E[g_j(X)\mathbf{1}_{A_j}]. $$ For a countable partition the same conclusion holds if \(Y\) is integrable; if \(Y\geq0\), it holds as an identity of extended nonnegative expectations. Each term uses its own rule only on its designated region. In a density calculation, for example, that means integrating the relevant formula over the region where it applies—not over the entire support as though that rule held everywhere.
Worked Example: A Piecewise Function of a Discrete Variable
Let \(X\) have probabilities \(P(X=0)=0.1\), \(P(X=1)=0.2\), \(P(X=2)=0.3\), and \(P(X=3)=0.4\). Define \(Y=X^2\) when \(X<2\), and \(Y=2X+1\) when \(X\geq2\). Find \(E[Y]\).
The partition events are \(A_1=\{X<2\}\) and \(A_2=\{X\geq2\}\). On \(A_1\), the possible values of \(Y\) are \(0^2=0\) and \(1^2=1\). Therefore, $$ E[Y\mathbf{1}_{A_1}] =0(0.1)+1(0.2)=0.2. $$
On \(A_2\), the values are \(2(2)+1=5\) and \(2(3)+1=7\), so $$ E[Y\mathbf{1}_{A_2}] =5(0.3)+7(0.4)=1.5+2.8=4.3. $$
Adding the two disjoint contributions gives \(E[Y]=0.2+4.3=4.5\). Equivalently, summing over all four possible values gives \(0(0.1)+1(0.2)+5(0.3)+7(0.4)=4.5\), which checks the calculation.
Worked Example: Splitting a Continuous Integral at a Threshold
Let \(X\sim\operatorname{Uniform}(0,2)\), with density \(f(x)=1/2\) on \((0,2)\). Define \(Y=X\) for \(X\leq1\), and \(Y=3-X\) for \(X>1\). Find \(E[Y]\) by partitioning the sample space.
Use the disjoint events \(A_1=\{X\leq1\}\) and \(A_2=\{X>1\}\), which cover the sample space with probability one. The density calculation for the first contribution is $$ E[Y\mathbf{1}_{A_1}] =\int_0^1 x\frac12\,dx =\frac12\left[\frac{x^2}{2}\right]_0^1 =\frac14. $$
For the second region, $$ E[Y\mathbf{1}_{A_2}] =\int_1^2(3-x)\frac12\,dx =\frac12\left[3x-\frac{x^2}{2}\right]_1^2 =\frac12\left(4-\frac52\right) =\frac34. $$
The boundary point \(X=1\) has probability zero under this continuous distribution, so assigning it to either side would not change the expectation. The total is \(E[Y]=1/4+3/4=1\). The separate integrals matter: the formula \(3-x\) applies only above the threshold, not throughout the support.
Worked Example: A Mixed Distribution With an Atom
Suppose \(X\) has probability \(1/2\) at zero and has density \(f(x)=1/4\) for \(0<x<2\), with no other probability. This is a valid distribution because its atom has mass \(1/2\) and its continuous part has mass \(\int_0^2(1/4)\,dx=1/2\). Let \(Y=-2\) when \(X\leq0\), and \(Y=X^2\) when \(X>0\). Find \(E[Y]\).
The event \(A_1=\{X\leq0\}\) contains the atom at zero, so its entire contribution is $$ E[Y\mathbf{1}_{A_1}]=(-2)P(X=0)=(-2)\left(\frac12\right)=-1. $$ On \(A_2=\{X>0\}\), the rule is \(Y=X^2\), and the contribution from the continuous part is $$ E[Y\mathbf{1}_{A_2}] =\int_0^2 x^2\frac14\,dx =\frac14\left[\frac{x^3}{3}\right]_0^2 =\frac14\cdot\frac83 =\frac23. $$
The variable \(Y\) is bounded on the support of \(X\), so it is integrable. Adding the contributions gives \(E[Y]=-1+2/3=-1/3\). Treating the distribution as purely continuous would omit the atom and yield the wrong answer.
How to Use the Identity Reliably
Write down the events on which the formula changes. Check that they are measurable, disjoint, and cover all outcomes except, if relevant, a probability-zero set.
If the quantity is nonnegative, the sum identity holds even when its value is infinite. For a signed quantity, establish absolute integrability before adding infinitely many contributions or rearranging terms.
Use the appropriate probability sum, density integral, or atom contribution on each region. Include the indicator’s effect: the contribution is zero outside that region.
Sum the contributions and verify that no event was counted twice or left out. When convenient, compare with a direct calculation from the full distribution.
Common Mistakes and Why the Identity Matters
Partitioning is a calculation strategy, but it is also a way to keep an expectation argument valid. It isolates special cases, thresholds, and atoms rather than forcing one formula across regions where it does not apply. In statistical models, such decompositions are useful whenever the quantity being averaged has different behavior in distinct parts of the sample space.
- Using overlapping regions. If an outcome belongs to two events, its contribution may be counted twice. Make the events disjoint, for example by assigning a threshold point to just one side.
- Forgetting to cover the sample space. A sum over only the regions where a formula seems convenient can omit positive-probability outcomes. Define a complete partition before calculating.
- Applying one piece’s formula everywhere. In the continuous example, integrating \(3-x\) over all of \((0,2)\) would not calculate the stated \(Y\), because that rule applies only when \(X>1\).
- Ignoring atoms in a mixed distribution. A density integral describes the continuous part, not point masses. Add each atom’s probability times the value of the quantity there.
- Relying on cancellation without integrability. A signed expectation cannot in general be split into an infinite sum and rearranged merely because positive and negative contributions appear to cancel. Absolute integrability is a sufficient condition guaranteeing the signed identity and absolute convergence.
A practical check is to state what each event contributes and what happens outside it. If the regions are a partition and the expectation exists under the conditions above, their contributions add to the full expectation.
Check Your Understanding
For each question, identify the relevant regions and justify the calculation or condition.
- Suppose \(Y\geq0\) and \(\{A_j\}\) is a countable partition. Does the partition identity require \(E[Y]\) to be finite? State the identity precisely.
- A variable \(X\) has density \(1/3\) on \((0,3)\). For \(Y=X\) on \(X\leq2\) and \(Y=4-X\) on \(X>2\), write the two contribution integrals. You need not evaluate them.
- Why is the condition \(E[|Y|]<\infty\) useful when \(Y\) can be positive or negative and the partition is countable?
- A mixed distribution has an atom at zero and a density on positive values. Explain why integrating only against the density may fail to give the full expectation.
- Give an example of how overlapping events in a proposed partition could cause an expectation contribution to be counted more than once.