← MATH 162 MathScape 0 MATH162

Mean and Expected Value

4 min read

Jump to a section
Reference: Stewart §8.5

Textbook Reference

Primary source OpenStax Calculus Volume 2, Section 3.7: “Probability”
Direct link https://openstax.org/books/calculus-volume-2/pages/3-7-probability
Textbook used in class Stewart, Calculus, Section 8.5: “Probability”

Opening Scenario

A random variable $X$ follows some distribution. After many trials, what value does $X$ average? This is the expected value or mean $\mu$. For a discrete set of values, $\mu = \sum x_i P(X = x_i)$ -- a weighted average of values weighted by probability. For a continuous random variable, replace the sum with an integral: $\mu = \int_{-\infty}^{\infty} x f(x)\,dx$.

The median is a different measure: the value $m$ such that half the probability is below $m$ and half is above. Both the mean and median describe the “center” of the distribution but can differ when the distribution is skewed.


Quick Reference

Mean (expected value): $$\mu = \int_{-\infty}^{\infty} x\,f(x)\,dx.$$

If $f$ is zero outside $[a,b]$: $\mu = \int_a^b x\,f(x)\,dx$.

Median $m$: the value satisfying $$\int_{-\infty}^m f(x)\,dx = \frac{1}{2},$$ i.e., half the total probability falls below $m$.


Key Concepts

1. Mean as a Weighted Average

For a discrete distribution with values $x_1, x_2, \ldots$ and probabilities $p_1, p_2, \ldots$, the mean is $\sum x_i p_i$. For a continuous distribution, each value $x$ gets weight $f(x)\,dx$ (probability of landing near $x$). Summing: $$\mu = \int x\cdot f(x)\,dx.$$

This is the continuous analog of the center of mass formula -- compare with $\bar{x} = \int x\,\rho(x)\,dx / \int \rho(x)\,dx$, except that normalization ($\int f = 1$) is already built into the pdf.

2. The Median

The median $m$ splits the distribution in half: $$\int_{-\infty}^m f(x)\,dx = \frac{1}{2}.$$

For a symmetric distribution, the mean equals the median. For a right-skewed distribution, the mean is pulled above the median (toward the heavy right tail). For a left-skewed distribution, the mean is below the median.

3. Mean vs. Median: Which to Use?

The mean is the balance point of the distribution (center of mass). The median is the point where half the probability lies on each side. For symmetric distributions, both coincide. For skewed distributions (e.g., income, house prices), the median is often reported because a few very large values inflate the mean.


Worked Example

The pdf for a random variable is $f(x) = 2x$ for $0 \leq x \leq 1$ (zero elsewhere). Find the mean $\mu$ and the median $m$.

Mean: $$\mu = \int_0^1 x \cdot 2x\,dx = 2\int_0^1 x^2\,dx = 2\left[\frac{x^3}{3}\right]_0^1 = \frac{2}{3}.$$

Median: Solve $\int_0^m 2x\,dx = \frac{1}{2}$. $$[x^2]_0^m = \frac{1}{2} \Rightarrow m^2 = \frac{1}{2} \Rightarrow m = \frac{1}{\sqrt{2}} = \frac{\sqrt{2}}{2} \approx 0.707.$$

Check: $\mu = 2/3 \approx 0.667 < m \approx 0.707$. For $f(x) = 2x$, the distribution is left-skewed in the sense that it concentrates probability near $x = 1$ (since $f(1) = 2 > f(0) = 0$). The median exceeds the mean, consistent with a right-skewed distribution.

Boxed answers: $\mu = \dfrac{2}{3}$; $m = \dfrac{\sqrt{2}}{2}$.


Common Errors Summary

Error Example Correction
Using $\mu = \int f(x)\,dx$ (without the $x$ factor) Computing the normalization integral instead of the mean Mean is $\mu = \int x f(x)\,dx$; the $x$ factor is essential
Finding the wrong median value Solving $f(m) = 1/2$ for $m$ The median satisfies $\int_{-\infty}^m f(x)\,dx = 1/2$, not $f(m) = 1/2$
Assuming mean equals median Claiming $\mu = m$ for a non-symmetric distribution Mean and median coincide only for symmetric distributions; check whether the pdf is symmetric about its center

Common Misconceptions

Common misconception

the mean of a continuous random variable equals $f(\mu_{\text{guess}})$ or the arithmetic average of the endpoints of the support.

This is the average-rate-as-arithmetic-mean error. The mean is $\mu = \int x f(x)\,dx$, a weighted average of values where each $x$ is weighted by the density $f(x)$ at that point. For $f(x) = 2x$ on $[0,1]$, the arithmetic midpoint of the support is $0.5$, but $\mu = \int_0^1 x\cdot 2x\,dx = 2/3 \approx 0.667$. The density $f(x) = 2x$ increases toward $1$, so the distribution concentrates weight near the right end, pulling the mean above the midpoint.

Common misconception

the median $m$ is found by solving $f(m) = 1/2$.

This is the height-vs-slope error. The median is not the point where the density value equals $1/2$; it is the point where the cumulative probability reaches $1/2$, that is, $\int_{-\infty}^m f(x)\,dx = 1/2$. The density value $f(m)$ describes concentration, not probability. For $f(x) = 2x$ on $[0,1]$, solving $f(m) = 1/2$ gives $m = 1/4$, but the true median satisfies $\int_0^m 2x\,dx = m^2 = 1/2$, giving $m = 1/\sqrt{2} \approx 0.707$.


Leveled Practice

Level 1 -- Find the Mean

Problem 1. For $f(x) = 3x^2$ on $[0,1]$, find $\mu$.

Show answer

$\mu = \displaystyle\int_0^1 x \cdot 3x^2\,dx = 3\int_0^1 x^3\,dx = 3\cdot\frac{1}{4} = \frac{3}{4}$.


Level 2 -- Find Both Mean and Median

Problem 2. For $f(x) = 2e^{-2x}$ on $[0,\infty)$, find $\mu$ and $m$.

Show answer

Mean: $\mu = \displaystyle\int_0^{\infty} x \cdot 2e^{-2x}\,dx$.

Integrate by parts: $u = x$, $dv = 2e^{-2x}\,dx$, $v = -e^{-2x}$.

$\mu = \left[-xe^{-2x}\right]_0^{\infty} + \displaystyle\int_0^{\infty}e^{-2x}\,dx = 0 + \left[-\frac{e^{-2x}}{2}\right]_0^{\infty} = \frac{1}{2}$.

Median: Solve $\displaystyle\int_0^m 2e^{-2x}\,dx = \frac{1}{2}$.

$\left[-e^{-2x}\right]_0^m = \frac{1}{2} \Rightarrow 1 - e^{-2m} = \frac{1}{2} \Rightarrow e^{-2m} = \frac{1}{2} \Rightarrow m = \frac{\ln 2}{2}$.

Boxed answers: $\mu = \frac{1}{2}$; $m = \frac{\ln 2}{2} \approx 0.347$.

Note $m < \mu$: the exponential distribution is right-skewed (long right tail), so the median is below the mean.


Mastery Checklist


Mental Model

The mean is the balance point of the probability distribution. Think of the area under the pdf as a thin sheet of metal with varying thickness. Slide a fulcrum along the $x$-axis until the sheet balances: that point is $\mu$. The median is the point where a vertical line cuts the sheet into two pieces of equal area. For a symmetric sheet, both points coincide. For an asymmetric sheet (skewed), the balance point and the equal-area cut are at different locations.


Connections

Looking back

Looking ahead


Back to Probability Density Functions | Next: Normal Distribution