information:highlighting
Infinite expected values

Expected values as defined above are automatically finite numbers. However, in many cases it is fundamental to be able to consider expected values of ±∞. This is intuitive, for example, in the case of the St. Petersburg paradox, in which one considers a random variable with possible outcomes x = 2, with associated probabilities p = 2, for i ranging over all positive integers. According to the summation formula in the case of random variables with countably many outcomes, one has E = ∑ i = 1 ∞ x i p i = 2 ⋅ 1 2 + 4 ⋅ 1 4 + 8 ⋅ 1 8 + 16 ⋅ 1 16 + ⋯ = 1 + 1 + 1 + 1 + ⋯. {\displaystyle \operatorname {E} =\sum _{i=1}^{\infty }x_{i}\,p_{i}=2\cdot {\frac {1}{2}}+4\cdot {\frac {1}{4}}+8\cdot {\frac {1}{8}}+16\cdot {\frac {1}{16}}+\cdots =1+1+1+1+\cdots.} It is natural to say that the expected value equals +∞.

There is a rigorous mathematical theory underlying such ideas, which is often taken as part of the definition of the Lebesgue integral. The first fundamental observation is that, whichever of the above definitions are followed, any nonnegative random variable whatsoever can be given an unambiguous expected value; whenever absolute convergence fails, then the expected value can be defined as +∞. The second fundamental observation is that any random variable can be written as the difference of two nonnegative random variables. Given a random variable X, one defines the positive and negative parts by X = max(X, 0) and X = −min(X, 0). These are nonnegative random variables, and it can be directly checked that X = X − X. Since E and E are both then defined as either nonnegative numbers or +∞, it is then natural to define: E = { E − E if E < ∞ and E < ∞; + ∞ if E = ∞ and E < ∞; − ∞ if E < ∞ and E = ∞; undefined if E = ∞ and E = ∞. {\displaystyle \operatorname {E} ={\begin{cases}\operatorname {E} -\operatorname {E} &{\text{if }}\operatorname {E} <\infty {\text{ and }}\operatorname {E} <\infty ;\\+\infty &{\text{if }}\operatorname {E} =\infty {\text{ and }}\operatorname {E} <\infty ;\\-\infty &{\text{if }}\operatorname {E} <\infty {\text{ and }}\operatorname {E} =\infty ;\\{\text{undefined}}&{\text{if }}\operatorname {E} =\infty {\text{ and }}\operatorname {E} =\infty.\end{cases}}}

According to this definition, E exists and is finite if and only if E and E are both finite. Due to the formula | X | = X + X, this is the case if and only if E| X | is finite, and this is equivalent to the absolute convergence conditions in the definitions above. As such, the present considerations do not define finite expected values in any cases not previously considered; they are only useful for infinite expectations.