Equation for the expected value of a discrete random variable

expected valueprobability theoryrandom variables

I'm reading the book Introduction to Stochastic Processes, p.24. In proving the expected value for 'any non-negative random variable $X$', the author provides the following equation for the expected value of a discrete random variable $X$ with values in $E$:

$$
\begin{align}
E[X] &= \sum_{a \in E}aP\{X=a\} \\
&= \sum_{a \in E} \int_0^a dt P\{X=a\} \\
&= \int_0^{\infty} dt \sum_{a>t} P\{X=a\} \\
&= \int_0^{\infty} P\{X > t\} dt \\
\end{align}
$$

The part I'm stuck on is the equivalency of the second and third expressions, and in particular the notation for the third:

$$
\sum_{a \in E} \int_0^a dt P\{X=a\}
= \int_0^{\infty} dt \sum_{a>t} P\{X=a\}
$$

I'm reading the third expression as the product of a definite integral with value $= \infty$ and a sum over some subset of $E$ that is unknown since the value of $t$ is not specified. But that makes no sense. Can someone explain how this equation works?

Best Answer

The text is skipping some intermediate steps: $$ \begin{align} \sum_{a \in E} \int_{t=0}^{t=a} dt P\{X=a\} &\stackrel{(1)}=\sum_{a\in E}\int_0^\infty I(t<a)P\{X=a\}dt\\ &\stackrel{(2)}=\int_0^\infty\sum_{a\in E} I(t<a)P\{X=a\}dt\\ &\stackrel{(3)}= \int_0^{\infty} \sum_{a>t} P\{X=a\}dt\\ \end{align} $$ In step (1) we convert the integral from $0$ to $a$ into an integral from $0$ to $\infty$ by introducing the indicator function $I(t<a)$. In step (2) we interchange the integration and summation (which is legal because everything is non-negative). In step (3) we absorb the indicator function into the summation.

Note on the RHS of (3) the entity $\sum_{a>t} P\{X=a\}$ is the integrand, i.e., it's the function of $t$ that we are integrating from $t=0$ to $t=\infty$. Your confusion is due to the text's unfortunate habit of placing the $dt$ to the left of the summation.

Related Question