
19 Expected Value
\[ \def\defeq{\overset{\text{def}}{=}} \def\E{\text{E}} \def\mean{\textcolor{red}{1.2}} \]
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.
19.1 Definition
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.
19.2 Case Study: Radioactive Particles
Let’s apply Definition 19.1 to the Geiger counter example from Section 18.3.
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.3.
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).
19.3 When the Expected Value Does Not Exist
The expected value is not well-defined for all random variables. In Section 9.4, we saw examples of random variables whose expected value was infinite; the next example provides an example of a random variable whose expected value is not well-defined at all.
19.4 Exercises
Exercise 19.1 (Expected temperature in Iqaluit) In Example 18.5, we saw that the temperature in Iqaluit (in Celsius) could be modeled as a continuous random variable \(C\) with PDF \[ f_C(x) = \frac{1}{k} e^{-x^2/18}; -\infty < x < \infty. \]
Determine the expected temperature in Iqaluit, \(\E[C]\), in two ways:
- using symmetry
- using Definition 19.1.
Exercise 19.2 (When does the mean equal the median?) In Example 19.4, we saw that the mean is not the same as the median in general. However, here is one situation where the mean and median are equal.
Suppose the PDF \(f_X(x)\) of a continuous random variable \(X\) is symmetric. That is, suppose there exists \(m\) such that for all \(t > 0\), \[ f_X(m + t) = f_X(m - t). \tag{19.3}\]
Show that if the mean \(\E[X]\) exists, it must equal the median.
Exercise 19.3 (The Pareto distribution and incomes) In economics, the Pareto distribution is used to model incomes and study income inequality. (Jones 2015) The Pareto distribution has PDF \[ f(y) = \begin{cases} \frac{\alpha \ell^\alpha}{y^{\alpha+1}} & y \geq \ell \\ 0 & \text{otherwise} \end{cases}, \tag{19.4}\] where \(\alpha > 0\) is an “inequality” parameter and \(\ell\) is the minimum income.
- Let \(Y\) be the income of a random selected worker. Calculate \(\E[Y]\), the average income of a worker. For what values of \(\alpha\) is this finite?
- What percentage of total income is earned by the top 1% of workers? (Hint: You may assume that the number of workers is \(N\); however, all \(N\)s and \(\ell\)s should cancel out in the end so that you end up with an answer that only depends on \(\alpha\).)
Note: In the United States, \(\alpha\) is approximately \(5/3\).
Exercise 19.4 (Lorenz curve and Gini coefficient) This question continues Exercise 19.3. Suppose that incomes are distributed according to a Pareto distribution (Equation 19.4), where \(\alpha\) is chosen so that \(\E[Y] < \infty\).
- The Lorenz curve \(L(p)\) is defined to be the fraction of total income earned by the lowest proportion \(p\) of workers. Calculate \(L(p)\) in terms of \(\alpha\). (Hint: Although in principle \(L(p)\) could depend on the minimum income \(\ell\), it does not.) Graph the curve for different values of \(\alpha\). What do the limits \(\alpha = 1\) and \(\alpha = \infty\) correspond to?
- Note that the Lorenz curve \(L(p) = p\) corresponds to perfect income equality. Therefore, income inequality in a population can be measured by the area between this line and the Lorenz curve. The Gini coefficient is defined as the area between these two curves, normalized so that the maximum is \(1\): \[ G = \frac{\text{area between Lorenz curve and line of perfect income equality}}{\text{total area under line of perfect income inequality}}. \tag{19.5}\] Calculate the Gini coefficient as a function of \(\alpha\). In the United States, \(\alpha\) is approximately \(5/3\). What is the Gini coefficient for the U.S.?