\[ \newcommand{\or}{\textrm{ or }} \newcommand{\and}{\textrm{ and }} \newcommand{\not}{\textrm{not }} \newcommand{\Pois}{\textrm{Poisson}} \newcommand{\E}{\textrm{E}} \newcommand{\var}{\textrm{Var}} \]
\[ \newcommand{\or}{\textrm{ or }} \newcommand{\and}{\textrm{ and }} \newcommand{\not}{\textrm{not }} \newcommand{\Pois}{\textrm{Poisson}} \newcommand{\E}{\textrm{E}} \newcommand{\var}{\textrm{Var}} \]
\[ \def\defeq{\overset{\text{def}}{=}} \def\E{\text{E}} \def\mean{\textcolor{red}{2.6}} \]
We define the expected value of a continuous random variable. To do this, we rely on intuition developed in Chapter 9, where expected value was defined for a discrete random variable.
To motivate the definition of expected value for a continuous random variable, let’s consider how we might approximate it. Consider a continuous random variable \(X\) described by the PDF in Figure 19.1. If we chop up the \(x\)-axis finely enough, then we can approximate \(X\) by a discrete random variable that only takes on a discrete set of values. For example, we can represent all values in \(\textcolor{red}{[6.72, 6.76]}\) by \(\textcolor{red}{6.72}\) and all values in \(\textcolor{orange}{[7.24, 7.28]}\) by \(\textcolor{orange}{7.24}\), and we can ensure that the probability of each discrete outcome corresponds to the probability of the interval it represents.
Let \(\varepsilon\) be the spacing between values of this discrete random variable. In Figure 19.1, \(\varepsilon = 0.4\). The expected value of this discrete random variable can now be approximated as
\[ \begin{aligned} E[X] &\approx \sum_x x \cdot P(x < X \leq x + \varepsilon) \\ &\approx \sum_x x \cdot f(x) \varepsilon. \end{aligned} \]
In the second line, we used Equation 18.2. We know that we can make these approximations more accurate by chopping up the \(x\)-axis finer and finer, making \(\varepsilon\) smaller and smaller. In Figure 19.2, we get a better approximation by decreasing \(\varepsilon\) to \(0.2\) because \(\textcolor{red}{6.72}\) now only represents the smaller interval \(\textcolor{red}{[6.72, 6.74]}\) and \(\textcolor{orange}{7.24}\) only represents \(\textcolor{orange}{[7.24, 7.26]}\).
In the limit as \(\varepsilon \to 0\), this Riemann sum becomes an integral:
\[ \sum_x x \cdot f(x) \varepsilon \to \int_{-\infty}^\infty x f(x)\,dx. \]
This is the motivation behind the definition of the expected value of a continuous random variable.
Just as the expected value of a discrete random variable was where the PMF would balance, the expected value of a continuous random variable is where the PDF would balance on a scale. In other words, it is the center of mass.
This center of mass interpretation can be used to bypass Equation 19.1 in some situations, as illustrated in the next example.
However, in most situations, the center of mass will not be obvious, and we will need to use Equation 19.1 to determine the expected value.
Let’s apply Definition 19.1 to the Geiger counter example from Section 18.4.
Calculating the integral in Example 19.2 was rather messy. The next result makes expected values like this one easier to calculate. It is the direct analog of Proposition 9.1.
Let’s apply Proposition 19.1 to determine the expected time of the first arrival.
Another way to summarize a random variable is the median.
In the next example, we see that the median is not the same as the expected value (which is also called the mean).