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 X takes values x1,x2,…,xn with probabilities p1,p2,…,pn, the expected value of X, written E(X) or μ, is E(X)=μ=∑i=1nxipi=x1p1+x2p2+⋯+xnpn — 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 X, written Var(X) or σx2, is Var(X)=∑i=1n(xi−μ)2pi, the probability-weighted average squared distance from the mean; its non-negative square root σx=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)]2, where E(X2)=∑i=1nxi2pi.
Worked examples.
Example 1. Three coins are tossed simultaneously; X is the number of heads. Find E(X) and Var(X).
With S the usual 8 equally likely outcomes, X∈{0,1,2,3} with p0=1/8,p1=3/8,p2=3/8,p3=1/8. Then ∑xipi=0(1/8)+1(3/8)+2(3/8)+3(1/8)=12/8, so E(X)=12/8=1.5. Also ∑xi2pi=0+3/8+12/8+9/8=24/8=3, so Var(X)=3−(1.5)2=3−2.25=0.75.
Example 2. A pair of dice is thrown; X is the sum shown. Find E(X) and Var(X).
Using the same distribution as Table 7.1 (36 equally likely pairs, X∈{2,…,12}), summing xipi over all 11 values gives ∑xipi=252/36=7, so E(X)=7. Summing xi2pi gives ∑xi2pi=1974/36≈54.83, so Var(X)=54.83−72=54.83−49=5.83 (exactly 210/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}, and each value is equally likely, P(k)=1/15. μ=E(X)=(1+2+⋯+15)/15=1515×16/2=8. Also E(X2)=(12+22+⋯+152)/15=1515×16×31/6=82.67, so Var(X)=82.67−82=82.67−64=18.67. …