The Timpson Lyceum seal

The Timpson Lyceum · Discrete Math (2025)

Probability, Expectation, and Variance - Lecture 17 (Discrete Math)

Probability, Expectation, and Variance – Lecture 17

Overview

This lecture builds the theory of real-valued random variables on top of the probability model from earlier in the course: a sample space SS of outcomes together with a probability function PP. It defines the expected value of a random variable, proves the linearity properties that make expectations easy to compute, and shows why the product rule E[XY]=E[X] E[Y]E[XY] = E[X]\,E[Y] holds only for independent variables. It then introduces variance as a measure of how spread out a distribution is and derives the shortcut formula that everyone uses in practice. Two recurring intuitions tie it together: expectation as a long-run average (and as a center of mass), and variance as average squared distance from that center.

Key Concepts

Sample space and probability function

Real random variable

Expected value

Second formula for expectation (grouping by output)

Linearity of expectation

Product rule (independence required)

Center of mass

Variance

Computational formula for variance

Worked Example

Compute the variance of a single fair die roll, S={1,…,6}S = \{1,\dots,6\}, P(s)=16P(s) = \tfrac{1}{6}, X(s)=sX(s) = s.

Use Var⁡(X)=E[X2]−(E[X])2\operatorname{Var}(X) = E[X^2] - (E[X])^2. First find E[X2]=∑sX(s)2P(s)E[X^2] = \sum_s X(s)^2 P(s), then subtract the square of the known mean E[X]=72E[X] = \tfrac{7}{2}:

E[X2]=∑s=16s2⋅16=1+4+9+16+25+366=916Var⁡(X)=E[X2]−(E[X])2=916−(72)2=916−494=3512≈2.92.\begin{aligned} E[X^2] &= \sum_{s=1}^{6} s^2 \cdot \tfrac{1}{6} = \tfrac{1 + 4 + 9 + 16 + 25 + 36}{6} = \tfrac{91}{6} \\ \operatorname{Var}(X) &= E[X^2] - \big(E[X]\big)^2 = \tfrac{91}{6} - \left(\tfrac{7}{2}\right)^2 = \tfrac{91}{6} - \tfrac{49}{4} = \tfrac{35}{12} \approx 2.92. \end{aligned}

Summary