When Can Expectations Be Added or Compared?
Expectation is integration on a probability space, so its basic rules are inherited from the Lebesgue integral. There is an important distinction between nonnegative random variables, whose expectations may be \(+\infty\), and signed random variables, whose expectation is unambiguous as a finite number only when they are integrable. Linearity requires integrability; monotonicity applies to nonnegative random variables without requiring finite expectations. In both statements, almost-sure hypotheses are sufficient, but the role of null sets must be handled carefully when functions can take infinite values.
Throughout, \((\Omega,\mathcal{F},\mathbb{P})\) is a probability space, so \(\mathbb{P}(\Omega)=1\). A random variable is a measurable function on this space. A nonnegative random variable may take values in \([0,\infty]\); a signed random variable is real-valued, apart from possible infinite values on a null set when we discuss integrability. The expectation of a nonnegative random variable is its Lebesgue integral and can be infinite. For a signed random variable \(X\), define \(X^+=\max(X,0)\) and \(X^-=\max(-X,0)\). We call \(X\) integrable if \(\mathbb{E}[|X|]<\infty\), equivalently if both \(\mathbb{E}[X^+]\) and \(\mathbb{E}[X^-]\) are finite. In that case, \(\mathbb{E}[X]=\mathbb{E}[X^+]-\mathbb{E}[X^-]\) is a finite real number.
Linearity for Integrable Random Variables
Proof. First take \(a=b=1\). The pointwise inequality \(|X+Y|\le |X|+|Y|\), together with monotonicity and additivity for nonnegative integrals, gives $$ \mathbb{E}[|X+Y|]\le\mathbb{E}[|X|]+\mathbb{E}[|Y|]<\infty. $$ Thus \(X+Y\) is integrable. Write \(P=X^++Y^+\) and \(Q=X^-+Y^-\). These are nonnegative integrable random variables, and \(X+Y=P-Q\) pointwise. For finite real numbers \(P,Q\), the identity \(P-Q=(P-Q)^+-(P-Q)^-\) gives $$ (X+Y)^+ + Q=(X+Y)^-+P. $$ All four terms are nonnegative and integrable. Integrating this equality and using additivity yields $$ \mathbb{E}[(X+Y)^+]+\mathbb{E}[Q] =\mathbb{E}[(X+Y)^-]+\mathbb{E}[P]. $$ Rearranging finite real numbers, and using \(\mathbb{E}[P]=\mathbb{E}[X^+]+\mathbb{E}[Y^+]\) and \(\mathbb{E}[Q]=\mathbb{E}[X^-]+\mathbb{E}[Y^-]\), gives \(\mathbb{E}[X+Y]=\mathbb{E}[X]+\mathbb{E}[Y]\). For a real constant \(c\), \((cX)^+=cX^+\) and \((cX)^-=cX^-\) if \(c\ge0\); if \(c<0\), these two expressions are interchanged after multiplication by \(|c|\). Integrating proves \(\mathbb{E}[cX]=c\,\mathbb{E}[X]\) and \(\mathbb{E}[|cX|]=|c|\mathbb{E}[|X|]\). Applying these facts to \(aX\) and \(bY\), then using additivity, proves the asserted formula. \(\square\)
If an integrable random variable is allowed to take infinite values on a null set, the pointwise algebra in this proof must be performed using finite representatives. Indeed, \(\mathbb{E}[|X|]<\infty\) implies \(|X|<\infty\) a.e.: if \(\mathbb{P}(|X|=\infty)>0\), then \(\mathbb{E}[|X|]\ge k\,\mathbb{P}(|X|=\infty)\) for every positive integer \(k\), contradicting finiteness. The set where either \(X\) or \(Y\) is infinite is therefore a measurable null set. Set both variables to zero there. The resulting finite-valued measurable representatives have unchanged expectations, and the proof applies pointwise to them. In particular, it never uses an undefined expression of the form \(+\infty-(+\infty)\).
Worked Example: Checking Linearity on a Finite Probability Space
Let \(\Omega=\{1,2,3,4\}\), with every outcome having probability \(1/4\). Define \(X=(-2,1,3,0)\) and \(Y=(4,-1,-2,5)\), listing values in outcome order. Every real-valued function on this finite space is integrable.
Directly summing the four values with their probabilities gives $$ \mathbb{E}[X]=\frac{-2+1+3+0}{4}=\frac{2}{4}=\frac12,\qquad \mathbb{E}[Y]=\frac{4-1-2+5}{4}=\frac{6}{4}=\frac32. $$ The pointwise sum has values \(X+Y=(2,0,1,5)\), so $$ \mathbb{E}[X+Y]=\frac{2+0+1+5}{4}=\frac{8}{4}=2. $$ The linearity formula gives \(\mathbb{E}[X]+\mathbb{E}[Y]=\tfrac12+\tfrac32=2\), matching the direct computation. As a scalar check, \(2X\) has values \((-4,2,6,0)\), and \(\mathbb{E}[2X]=(-4+2+6+0)/4=1=2\mathbb{E}[X]\).
Check: Substituting the computed expectations into the formula gives \(\tfrac12+\tfrac32=2\), exactly the direct value of \(\mathbb{E}[X+Y]\).
Monotonicity for Nonnegative Random Variables
Proof. Let \(N=\{U>V\}\), which is measurable and has probability zero by the assumed almost-sure order. Define \(\widetilde U=U\) and \(\widetilde V=V\) on \(N^c\), and set both to zero on \(N\). These functions are measurable, are unchanged a.e., and satisfy \(0\le\widetilde U\le\widetilde V\) everywhere. Monotonicity of the nonnegative Lebesgue integral gives \(\mathbb{E}[\widetilde U]\le\mathbb{E}[\widetilde V]\). An integral over a null set is zero for a nonnegative measurable function, so changing either function on \(N\) does not change its integral. Therefore \(\mathbb{E}[U]\le\mathbb{E}[V]\), including when an expectation is infinite. \(\square\)
Nonnegativity makes the expectation defined even when it is infinite. It is not necessary for monotonicity if both variables are integrable: if \(X\le Y\) a.e. and both are integrable, then \(Y-X\) is integrable, is nonnegative a.e., and linearity gives \(\mathbb{E}[Y]-\mathbb{E}[X]=\mathbb{E}[Y-X]\ge0\). Thus the useful general rule is: ordered nonnegative variables have ordered extended expectations; ordered integrable signed variables have ordered finite expectations.
Worked Example: Comparing Ordered Nonnegative Variables
On \(\Omega=\{1,2,3\}\), give each outcome probability \(1/3\). Let \(U=(0,1,2)\) and \(V=(1,1,4)\). At each outcome, \(0\le U\le V\), so the monotonicity theorem applies.
The expectations are $$ \mathbb{E}[U]=\frac{0+1+2}{3}=\frac33=1,\qquad \mathbb{E}[V]=\frac{1+1+4}{3}=\frac63=2. $$ The pointwise difference is \(V-U=(1,0,2)\); its expectation is \((1+0+2)/3=1\). This independently checks that \(\mathbb{E}[V]-\mathbb{E}[U]=2-1=1=\mathbb{E}[V-U]\), as linearity predicts for these integrable variables.
Check: The order holds at all three outcomes, not merely on average, and the computed expectations satisfy \(1\le2\).
Worked Example: Almost-Sure Order and a Null-Set Modification
Take \(\Omega=[0,1]\) with the Lebesgue sigma-algebra and probability measure \(m\) restricted to \([0,1]\). Define \(U(x)=x\) for every \(x\), and let \(V(x)=x\) for \(x>0\) but \(V(0)=0\). To make the exceptional-set issue explicit, instead set \(U(0)=+\infty\), retaining \(U(x)=x\) for \(x>0\), and set \(V(x)=x\) everywhere. Then \(U\le V\) fails at \(0\), but \(U\le V\) holds a.e., since \(\{0\}\) has measure zero.
Changing \(U(0)\) to zero produces \(\widetilde U(x)=x\) on all of \([0,1]\). The expectations are unchanged by this modification, and direct integration gives $$ \mathbb{E}[U]=\mathbb{E}[\widetilde U]=\int_0^1 x\,dx=\frac12,\qquad \mathbb{E}[V]=\int_0^1 x\,dx=\frac12. $$ Thus the almost-sure comparison yields \(\mathbb{E}[U]\le\mathbb{E}[V]\), in fact equality. The infinite value at the single point does not contribute to the nonnegative integral. The representative modification also avoids treating an exceptional point as though the order held there.
Check: The functions agree a.e., and their integrals are both \(\tfrac12\). The null-set value changes neither expectation.
Why Integrability and Nonnegativity Matter
For linearity of signed expectations, integrability prevents an undefined difference between infinite positive and negative contributions. Here is a concrete failure of an unrestricted version of the rule. Let \(\Omega=\{1,2,\ldots\}\), let \(\mathcal{F}\) be all subsets, and set \(\mathbb{P}(\{n\})=1/(n(n+1))\). These probabilities sum to one because $$ \sum_{n=1}^{N}\frac{1}{n(n+1)} =\sum_{n=1}^{N}\left(\frac1n-\frac1{n+1}\right) =1-\frac{1}{N+1}\longrightarrow1. $$ Define \(X(n)=n\) and \(Y(n)=-n\). Then \(X+Y=0\) at every outcome, so \(\mathbb{E}[X+Y]=0\). But $$ \mathbb{E}[X]=\sum_{n=1}^{\infty}\frac{n}{n(n+1)} =\sum_{n=1}^{\infty}\frac1{n+1}=+\infty, \qquad \mathbb{E}[Y]=-\infty. $$ The positive harmonic series diverges, so neither variable is integrable. The expression \(\mathbb{E}[X]+\mathbb{E}[Y]=+\infty+(-\infty)\) is undefined, not zero. Linearity makes no assertion in this case.
Likewise, nonnegativity in the extended-valued monotonicity theorem ensures that each expectation is defined in \([0,\infty]\). If signed variables have both positive and negative parts with infinite integrals, their expectations are undefined, and there may be no comparison to make—even if the variables are ordered.
Check Your Understanding
For each question, identify whether the variables are integrable, nonnegative, or only ordered almost surely before applying a rule.
- If \(X,Y\) are integrable and \(a,b\in\mathbb{R}\), which hypotheses allow the formula for \(\mathbb{E}[aX+bY]\)?
- Suppose \(0\le U\le V\) a.e. and \(\mathbb{E}[V]=+\infty\). What can monotonicity conclude, and does it imply that \(\mathbb{E}[U]\) is finite?
- Give a reason that an integrable extended-valued random variable can be replaced by a finite-valued representative without changing its expectation.
- For the probability mass function \(1/(n(n+1))\), compute \(\mathbb{E}[n]\) and explain why the pair \(X(n)=n,\ Y(n)=-n\) does not contradict linearity.
- If \(X\le Y\) a.e. and both signed random variables are integrable, explain why \(\mathbb{E}[X]\le\mathbb{E}[Y]\) even though they need not be nonnegative.