Math Core

Lesson 4.6 · Probability, Random Variables and Distributions

Mean and standard deviation of random variables

A probability distribution tells you everything about a random variable, but you often want a quick summary: what value do you expect on average, and how much do results typically vary? The mean and standard deviation of a random variable answer those questions, and they drive decisions about games, insurance and business plans.

The mean (expected value)

The mean of a random variable is a weighted average of its values, where each value is weighted by its probability.

Mean of a discrete random variable

μX=E(X)=∑xi pi=x1p1+x2p2+⋯+xkpk.\mu_X = E(X) = \sum x_i \, p_i = x_1 p_1 + x_2 p_2 + \dots + x_k p_k.

The mean is also called the expected value. It is the long-run average of XX over many, many repetitions of the random process.

The expected value does not have to be a possible value of XX. A family can't own 1.81.8 cars, but 1.81.8 can still be the long-run average number of cars per household.

The standard deviation

The variance of XX is the weighted average of squared deviations from the mean, and the standard deviation is its square root:

σX2=∑(xi−μX)2 pi,σX=σX2.\sigma_X^2 = \sum (x_i - \mu_X)^2 \, p_i, \qquad \sigma_X = \sqrt{\sigma_X^2}.

The standard deviation measures how much the values of XX typically vary from the mean, in the same units as XX.

Worked example: Cars per household

Let XX = the number of cars owned by a randomly selected household in a town.

xx01234
P(X=x)P(X = x)0.080.320.380.160.06

Find the mean and standard deviation of XX, and interpret the mean.

Solution. Mean:

μX=0(0.08)+1(0.32)+2(0.38)+3(0.16)+4(0.06)=0+0.32+0.76+0.48+0.24=1.80.\mu_X = 0(0.08) + 1(0.32) + 2(0.38) + 3(0.16) + 4(0.06) = 0 + 0.32 + 0.76 + 0.48 + 0.24 = 1.80.

Variance, using deviations from 1.81.8:

σX2=(0−1.8)2(0.08)+(1−1.8)2(0.32)+(2−1.8)2(0.38)+(3−1.8)2(0.16)+(4−1.8)2(0.06)=0.2592+0.2048+0.0152+0.2304+0.2904=1.00.\begin{aligned} \sigma_X^2 &= (0 - 1.8)^2(0.08) + (1 - 1.8)^2(0.32) + (2 - 1.8)^2(0.38) + (3 - 1.8)^2(0.16) + (4 - 1.8)^2(0.06) \\ &= 0.2592 + 0.2048 + 0.0152 + 0.2304 + 0.2904 \\ &= 1.00. \end{aligned}

So σX=1.00=1.00\sigma_X = \sqrt{1.00} = 1.00 car.

Interpretation. If you selected many, many households at random from this town, the average number of cars per household would be about 1.81.8. The number of cars for a randomly chosen household typically varies from the mean of 1.81.8 by about 11 car.

Tip

Your calculator can do this. On a TI-84, put the values in L1 and the probabilities in L2, then run 1-Var Stats with List: L1 and FreqList: L2. The output xˉ\bar{x} is μX\mu_X and σx\sigma x is σX\sigma_X. On the AP exam, still show the formula with at least the first few terms substituted.

Expected value and decisions

Expected value tells you whether a game or a policy pays off in the long run.

Worked example: Is the game worth playing?

A carnival game costs $5 to play. You win $20 with probability 0.10.1, win $5 with probability 0.30.3, and win nothing otherwise. Let XX = your net gain on one play. Find E(X)E(X).

Solution. Subtract the $5 cost from each prize to get net gains.

Net gain xx (dollars)150−5-5
P(X=x)P(X = x)0.10.30.6

E(X)=15(0.1)+0(0.3)+(−5)(0.6)=1.5+0−3=−1.5.E(X) = 15(0.1) + 0(0.3) + (-5)(0.6) = 1.5 + 0 - 3 = -1.5.

On average you lose $1.50 per play over many plays. The game operator makes about $1.50 per play in the long run.

Worked example: Insurance

An insurance company charges $300 per year for a policy that pays $10,000 if a certain event occurs. The event happens to 2%2\% of policyholders each year. What is the company's expected profit per policy?

Solution. Profit is 300300 if no claim and 300−10,000=−9,700300 - 10{,}000 = -9{,}700 if there is a claim.

E(profit)=300(0.98)+(−9,700)(0.02)=294−194=100.E(\text{profit}) = 300(0.98) + (-9{,}700)(0.02) = 294 - 194 = 100.

The company expects to earn about $100 per policy on average. It will lose big on some policies, but across thousands of policies, the law of large numbers makes the average profit close to $100.

Common mistake

Don't interpret the expected value as what will happen on one trial, or as the "most likely" value. It is a long-run average. Say "over many repetitions, the average … would be about …" and include context. Also remember to square the deviations and multiply by probabilities, not divide by nn or n−1n - 1 as for sample data.

Practice

Practice 1

The random variable XX has this distribution. Find μX\mu_X.

xx01234
P(X=x)P(X = x)0.100.250.300.200.15

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

Find the standard deviation of XX from the previous problem. Round to 2 decimal places.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

Flip a fair coin 3 times and let XX = number of heads, with P(X=0)=18P(X = 0) = \dfrac{1}{8}, P(X=1)=38P(X = 1) = \dfrac{3}{8}, P(X=2)=38P(X = 2) = \dfrac{3}{8} and P(X=3)=18P(X = 3) = \dfrac{1}{8}. Find E(X)E(X).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

A raffle sells 500 tickets at $2 each. One ticket wins $300 and two tickets win $50 each. Let XX = net gain (in dollars) for a person who buys one ticket. Find E(X)E(X).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

A random variable XX is the number of customers who enter a small shop in a 10-minute period, and E(X)=3.4E(X) = 3.4. Which is the best interpretation?

Practice 6

An insurance company sells a one-year policy for $450. It pays $25,000 if the policyholder has a certain type of claim, which happens with probability 0.0140.014. Find the company's expected profit per policy, in dollars.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

A random variable XX takes values 1, 2 and 3, with P(X=1)=0.2P(X = 1) = 0.2. The mean of XX is 2.32.3. Find P(X=3)P(X = 3).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.