Why Cancellation Can Be Misleading
For a random variable that takes both positive and negative values, it is tempting to add its positive contributions and subtract its negative contributions. That procedure is sound when the two sides are finite, and it can define an infinite expectation when only one side is infinite. But if both sides are infinite, writing “infinity minus infinity” does not produce a number. Pairing terms or choosing symmetric integration limits may conceal this problem without resolving it.
The key is to examine the two contributions separately. The earlier material on positive and negative parts introduced the notation below; we recall it here because it gives the precise test for whether an expectation exists.
This definition applies whether the distribution is discrete, continuous, or mixed. For a discrete variable, the nonnegative quantities are sums over its possible values; for a continuous variable, they are integrals against its distribution. In either case, the positive and negative contributions are evaluated separately before taking their difference.
When the Expectation Is Finite or Infinite
The definition leads to a useful diagnostic. If both parts have finite expectations, their difference is an ordinary finite number. If the positive part is infinite but the negative part is finite, the expectation is \(+\infty\); if the negative part is infinite but the positive part is finite, it is \(-\infty\). Only the case in which both parts are infinite is undefined.
Proof. The pointwise identity \(|X|=X^++X^-\) and additivity for nonnegative expectations give \(E[|X|]=E[X^+]+E[X^-]\), allowing either side to be infinite. Thus \(E[|X|]<\infty\) holds exactly when both \(E[X^+]\) and \(E[X^-]\) are finite. In that case their difference is a finite real number, as required. Conversely, if \(E[X]\) is finite under the stated definition, neither part can be infinite: one infinite part and one finite part give an infinite extended expectation, while two infinite parts make the expectation undefined. Therefore both parts are finite, and their sum \(E[|X|]\) is finite. The same definition shows that if exactly one part is infinite, the extended expectation is respectively \(+\infty\) or \(-\infty\). \(\square\)
The criterion is about the total size of the two contributions, not whether they seem to balance. Absolute integrability, \(E[|X|]<\infty\), guarantees a finite expectation and prevents an order of summation from affecting it. When the positive and negative contributions both diverge, no proposed balance between them is part of the expectation definition.
Worked Example: A Discrete Variable With Two Divergent Parts
Let \(X\) take values \(k\) and \(-k\), for each positive integer \(k\), with \(P(X=k)=P(X=-k)=3/(\pi^2 k^2)\). Verify that this is a probability distribution and determine whether \(E[X]\) exists.
Check the total probability. Using \(\sum_{k=1}^{\infty}1/k^2=\pi^2/6\),
Compute each part. The positive values contribute to \(X^+\), while the negative values contribute to \(X^-\):
Both harmonic series diverge, so \(E[X]\) is undefined. The equal probabilities on \(k\) and \(-k\) do not make the expectation zero: the positive and negative contributions are each infinite.
Why Rearranging a Sum Does Not Define an Expectation
For the discrete distribution just considered, the contribution from the atom \(k\) to a formal signed sum is \(3/(\pi^2 k)\), and the contribution from \(-k\) is \(-3/(\pi^2 k)\). If we list the atoms in the order \(1,-1,2,-2,\ldots\), the terms appear as \(3/\pi^2,-3/\pi^2,3/(2\pi^2),-3/(2\pi^2),\ldots\). Each consecutive pair sums to zero, and the unpaired term after an odd number of terms tends to zero. The rearranged series therefore converges to zero.
That calculation is a property of the chosen ordering, not a value for \(E[X]\). The expectation remains undefined because its positive and negative parts both diverge. In particular, a sum over the atoms may be rearranged safely when it is absolutely convergent; conditional cancellation is not a replacement for the separate nonnegative sums in the definition.
Proof. Write the atoms as \(x_j\), with probabilities \(p_j\), for \(j=1,2,\ldots\). The sum of the absolute values of their signed contributions is
For any \(\varepsilon>0\), absolute convergence gives a finite set of terms outside which the sum of absolute values is less than \(\varepsilon\). Any two orderings contain that same finite set eventually; the difference between their remaining tails is bounded in absolute value by the sum of the absolute values in those tails, which is at most \(2\varepsilon\). Since \(\varepsilon\) is arbitrary, the two sums have the same limit. Thus reordering cannot change the expectation when \(E[|X|]\) is finite. This argument does not apply to the harmonic contributions in the previous example, whose absolute sum diverges. \(\square\)
Worked Example: A Rearranged Sum That Appears to Give Zero
Return to the distribution with \(P(X=\pm k)=3/(\pi^2 k^2)\). Consider listing its signed atom contributions in the order \(+1,-1,+2,-2,\ldots\). Show what the partial sums do, then compare that result with the expectation test.
After the first positive contribution, the partial sum is \(3/\pi^2\). The negative contribution from \(-1\) brings it back to zero. At the next positive contribution it is \(3/(2\pi^2)\), and the next negative term brings it back to zero. After the positive term for \(k\), the partial sum is \(3/(\pi^2 k)\), which tends to zero as \(k\) grows. Between these terms the partial sum is exactly zero. Hence the rearranged series converges to zero.
But \(E[X^+]=E[X^-]=\infty\), as computed above. Therefore the expectation is undefined, not zero. The series has produced a value only by choosing an ordering that pairs terms; changing the order is not permitted as a way to define an expectation in this situation.
Symmetric Improper Integrals and Principal Values
A related trap occurs with improper integrals. A symmetric limit integrates from \(-A\) to \(A\) before letting \(A\) grow. That procedure can cancel contributions at matching distances from zero. An expectation, however, requires the positive and negative parts to be integrable separately. A symmetric principal value is therefore not, by itself, an expectation.
Worked Example: The Cauchy Distribution
Let \(X\) have the standard Cauchy density \(f(x)=1/(\pi(1+x^2))\). Compute the positive and negative expectation contributions, and compare them with the symmetric integral.
For the positive part,
By symmetry, the negative part has the same value:
Thus the Cauchy random variable has no expectation. Nevertheless, for each finite \(A\),
because the integrand is odd and the interval is symmetric. The limit of these symmetric integrals is the Cauchy principal value, zero; it is not \(E[X]\). In fact, using unequal cutoffs gives
If \(A/B\) tends to a positive constant \(r\) as both cutoffs tend to infinity, this expression tends to \(\log(r)/\pi\). The limiting result depends on how the two sides are truncated, reinforcing that no expectation is defined by these cancellations.
A One-Sided Infinite Expectation Is Different
An infinite expectation is not automatically undefined. The crucial distinction is whether the opposite-sign contribution is finite. The following example has both positive and negative values, but only one divergent part.
Worked Example: A Well-Defined Expectation of Positive Infinity
Define a discrete random variable by \(P(X=k)=3/(\pi^2 k^2)\) for \(k=1,2,\ldots\), \(P(X=-1)=1/4\), and \(P(X=0)=1/4\). Verify the probabilities and determine its extended expectation.
The positive masses sum to \(\frac{3}{\pi^2}\sum_{k=1}^{\infty}1/k^2=1/2\). Adding \(P(X=-1)=1/4\) and \(P(X=0)=1/4\) gives total probability one. The positive-part expectation is
The negative part is nonzero only when \(X=-1\), so \(E[X^-]=1/4\). Since exactly one part is infinite, the extended expectation is defined and \(E[X]=\infty-1/4=+\infty\). This is different from subtracting one infinite quantity from another.
A Reliable Diagnostic
Whenever positive and negative values are both present, compute or assess \(E[X^+]\) and \(E[X^-]\) separately before writing a signed sum or integral. This check is useful for heavy-tailed distributions, infinite series, and improper integrals. It also prevents a formal symmetry argument from being used outside the conditions that make it valid.
Write \(X^+=\max(X,0)\) and \(X^-=\max(-X,0)\).
Find \(E[X^+]\) and \(E[X^-]\) separately, using nonnegative sums or integrals.
Both finite gives a finite expectation; one infinite gives the corresponding signed infinity; both infinite means the expectation is undefined.
Common mistake: “The positive and negative terms have equal size, so they cancel and the expectation is zero.” This reasoning assumes a pairing or order that the expectation does not authorize. If both parts diverge, the correction is not to choose a more appealing pairing; it is to report that \(E[X]\) is undefined. Likewise, a symmetric principal value may be a meaningful limit for another purpose, but it does not change the expectation test.
Check Your Understanding
For each situation, focus on the positive and negative parts rather than on a proposed cancellation.
- If \(E[X^+]=7\) and \(E[X^-]=\infty\), is \(E[X]\) finite, infinite, or undefined?
- For the distribution \(P(X=\pm k)=3/(\pi^2 k^2)\), why does ordering the signed contributions as \(+1,-1,+2,-2,\ldots\) not establish an expectation of zero?
- A symmetric improper integral of \(x f(x)\) equals zero. What additional check is needed before concluding that \(E[X]=0\)?
- What condition on \(E[|X|]\) guarantees that a discrete sum of signed contributions is unchanged by reordering?
- Can a random variable with a well-defined extended expectation have \(E[X^+]=\infty\)? State the condition on \(E[X^-]\) that permits it.