Skip to content

Mathematics · Ch 14 — Probability Distributions

Expected value and Variance of a random variable

14.3.3

Expected value and Variance of a random variable

Beyond the full probability distribution, it is often enough to summarise a random variable by a single representative number computed from that distribution. The most important such summary is the mean (or expected value): if XX takes values x1,x2,…,xnx_1, x_2, \ldots, x_n with probabilities p1,p2,…,pnp_1, p_2, \ldots, p_n, the expected value of XX, written E(X)E(X) or μ\mu, is E(X)=μ=∑i=1nxipi=x1p1+x2p2+⋯+xnpnE(X) = \mu = \sum_{i=1}^n x_i p_i = x_1p_1 + x_2p_2 + \cdots + x_np_n — the sum of every possible value weighted by its probability. It roughly locates the 'middle' or long-run average value of the random variable.

The natural companion measure is spread: the variance of XX, written Var(X)Var(X) or σx2\sigma_x^2, is Var(X)=∑i=1n(xi−μ)2piVar(X) = \sum_{i=1}^n (x_i - \mu)^2 p_i, the probability-weighted average squared distance from the mean; its non-negative square root σx=Var(X)\sigma_x = \sqrt{Var(X)} is the standard deviation. In practice the defining formula is rarely the easiest to compute with, so a simplified (shortcut) form is used instead: Var(X)=∑i=1nxi2pi−(∑i=1nxipi)2=E(X2)−[E(X)]2Var(X) = \sum_{i=1}^n x_i^2 p_i - \left(\sum_{i=1}^n x_i p_i\right)^2 = E(X^2) - [E(X)]^2, where E(X2)=∑i=1nxi2piE(X^2) = \sum_{i=1}^n x_i^2 p_i.

Worked examples.

Example 1. Three coins are tossed simultaneously; XX is the number of heads. Find E(X)E(X) and Var(X)Var(X).

With SS the usual 8 equally likely outcomes, X∈{0,1,2,3}X \in \{0,1,2,3\} with p0=1/8,p1=3/8,p2=3/8,p3=1/8p_0=1/8, p_1=3/8, p_2=3/8, p_3=1/8. Then ∑xipi=0(1/8)+1(3/8)+2(3/8)+3(1/8)=12/8\sum x_ip_i = 0(1/8)+1(3/8)+2(3/8)+3(1/8) = 12/8, so E(X)=12/8=1.5E(X) = 12/8 = 1.5. Also ∑xi2pi=0+3/8+12/8+9/8=24/8=3\sum x_i^2 p_i = 0+3/8+12/8+9/8 = 24/8 = 3, so Var(X)=3−(1.5)2=3−2.25=0.75Var(X) = 3 - (1.5)^2 = 3 - 2.25 = 0.75.

Example 2. A pair of dice is thrown; XX is the sum shown. Find E(X)E(X) and Var(X)Var(X).

Using the same distribution as Table 7.1 (36 equally likely pairs, X∈{2,…,12}X \in \{2,\ldots,12\}), summing xipix_ip_i over all 11 values gives ∑xipi=252/36=7\sum x_ip_i = 252/36 = 7, so E(X)=7E(X) = 7. Summing xi2pix_i^2p_i gives ∑xi2pi=1974/36≈54.83\sum x_i^2p_i = 1974/36 \approx 54.83, so Var(X)=54.83−72=54.83−49=5.83Var(X) = 54.83 - 7^2 = 54.83 - 49 = 5.83 (exactly 210/36=35/6210/36 = 35/6).

Example 3. Find the mean and variance of a number selected at random from 1 to 15.

Here S={1,2,…,15}S=\{1,2,\ldots,15\}, and each value is equally likely, P(k)=1/15P(k)=1/15. μ=E(X)=(1+2+⋯+15)/15=15×16/215=8\mu = E(X) = (1+2+\cdots+15)/15 = \dfrac{15\times16/2}{15} = 8. Also E(X2)=(12+22+⋯+152)/15=15×16×31/615=82.67E(X^2) = (1^2+2^2+\cdots+15^2)/15 = \dfrac{15\times16\times31/6}{15} = 82.67, so Var(X)=82.67−82=82.67−64=18.67Var(X) = 82.67 - 8^2 = 82.67-64 = 18.67. …