Statistics & Probability · Grade 11

Random Variables and Expected Value

Quick answer

A random variable assigns a number to every outcome of a chance process, such as the number of heads in three coin flips. Listing each value with its probability gives a probability distribution, which can be graphed like any data set. Its mean, the expected value, is found by weighting each value by its probability, and it is the average the results settle toward over many repetitions.

What you'll learn

  • Define a random variable and build its probability distribution
  • Calculate an expected value and interpret it as a long-run mean
  • Build distributions from theoretical and from empirical probabilities

A number for every outcome

Flip three coins. The outcomes are sequences like HHT or TTT, eight of them, all equally likely. Often the question is not which sequence came up but a number built from it: how many heads?

A random variable is that kind of rule. It assigns a number to every outcome of a chance process. Here XX is the number of heads:

OutcomesXX
TTT00
HTT, THT, TTH11
HHT, HTH, THH22
HHH33

The probability distribution

List each value of XX with its probability and the result is a probability distribution:

xx00112233
P(X=x)P(X = x)18\tfrac{1}{8}38\tfrac{3}{8}38\tfrac{3}{8}18\tfrac{1}{8}

The probabilities add to 11, because every outcome lands on exactly one value.

A distribution can be graphed the same way as data. Take a five-question multiple-choice quiz with four choices per question, answered by pure guessing. There are 45=1,0244^5 = 1{,}024 equally likely ways to fill in the answers, and each has some number correct:

Correct answers when guessing on 5 four-choice questions A histogram over the values 0 through 5. Of the 1,024 equally likely answer sheets, 243 get none right, 405 get one, 270 get two, 90 get three, 15 get four and 1 gets all five. 0 1 2 3 4 5 200 400
Correct answers when guessing on 5 four-choice questions

Each bar divided by 1,0241{,}024 is a probability. Getting exactly one right is the most likely result, at 4051024≈0.40\tfrac{405}{1024} \approx 0.40, and a perfect paper turns up once in 1,0241{,}024 guesses.

Those counts come from combinations: kk correct answers can fall on (5k)\binom{5}{k} sets of questions, and each of the other questions has 33 wrong choices, so the count is (5k) 35−k\binom{5}{k}\,3^{5-k}.

Expected value

The expected value of a random variable weights each value by its probability and adds:

E[X]=∑x⋅P(X=x)E[X] = \sum x \cdot P(X = x)

For three coins:

E[X]=0⋅18+1⋅38+2⋅38+3⋅18=128=1.5E[X] = 0\cdot\tfrac{1}{8} + 1\cdot\tfrac{3}{8} + 2\cdot\tfrac{3}{8} + 3\cdot\tfrac{1}{8} = \tfrac{12}{8} = 1.5

Why the expected value is a long-run average

No one ever flips three coins and gets 1.51.5 heads. So what does 1.51.5 mean?

Repeat the three flips many times. In the long run, each value turns up in about the share of trials its probability predicts: no heads about 18\tfrac{1}{8} of the time, one head about 38\tfrac{3}{8} of the time, and so on. The average of all the results is then about

0⋅18+1⋅38+2⋅38+3⋅180\cdot\tfrac{1}{8} + 1\cdot\tfrac{3}{8} + 2\cdot\tfrac{3}{8} + 3\cdot\tfrac{1}{8}

which is the expected value. The expected value is the mean of the distribution: the number the average of many results settles toward. It is computed exactly the way a mean is computed from a frequency table, with probabilities in place of frequencies.

Expected scores under different grading

The same guessing quiz, scored three ways, gives three expected scores per question:

ScoringExpected points per guessed question
+1+1 right, 00 wrong14(1)=0.25\tfrac{1}{4}(1) = 0.25
+1+1 right, −14-\tfrac{1}{4} wrong14(1)+34(−14)=0.0625\tfrac{1}{4}(1) + \tfrac{3}{4}\left(-\tfrac{1}{4}\right) = 0.0625
+1+1 right, −13-\tfrac{1}{3} wrong14(1)+34(−13)=0\tfrac{1}{4}(1) + \tfrac{3}{4}\left(-\tfrac{1}{3}\right) = 0

With the one-third penalty, blind guessing gains nothing on average. That penalty was chosen for exactly that reason. Scoring rules are designed around expected values.

Probabilities from data

Some distributions come from observation instead of theory. Suppose a survey of 200200 households records how many televisions each one has:

Televisions0011223344
Households885050727244442626
Probability0.040.040.250.250.360.360.220.220.130.13

Each probability is a count divided by 200200. The expected number of televisions for a household chosen at random from this group is

0(0.04)+1(0.25)+2(0.36)+3(0.22)+4(0.13)=2.150(0.04) + 1(0.25) + 2(0.36) + 3(0.22) + 4(0.13) = 2.15

These are empirical probabilities, and they describe the households surveyed. How well they describe a whole town depends on how the sample was chosen, which is the subject of surveys and experiments.

Worked examples

Common mistakes

Practice problems

  1. For three coin flips, find P(X=2)P(X = 2), where XX is the number of heads.

    Answer

    38\tfrac{3}{8}

    Full solution

    Three of the eight outcomes, HHT, HTH and THH, have exactly two heads.

  2. Find the expected number of heads in three coin flips.

    Answer

    1.51.5

    Full solution

    0⋅18+1⋅38+2⋅38+3⋅18=128=1.50 \cdot \tfrac{1}{8} + 1 \cdot \tfrac{3}{8} + 2 \cdot \tfrac{3}{8} + 3 \cdot \tfrac{1}{8} = \tfrac{12}{8} = 1.5.

  3. Find the expected sum of two dice.

    Answer

    77

    Full solution

    Each die averages 3.53.5 in the long run, so two dice average 77.

  4. When guessing on all five four-choice questions, find the probability of getting at least 33 right.

    Answer

    1061024≈0.104\tfrac{106}{1024} \approx 0.104

    Full solution

    90+15+1=10690 + 15 + 1 = 106 of the 1,0241{,}024 answer sheets have three or more correct.

  5. Find the expected total score for guessing on all five questions when a wrong answer costs 14\tfrac{1}{4} point.

    Answer

    0.31250.3125 points

    Full solution

    Each question is worth 14(1)+34(−14)=0.0625\tfrac{1}{4}(1) + \tfrac{3}{4}\left(-\tfrac{1}{4}\right) = 0.0625 on average, and 5×0.0625=0.31255 \times 0.0625 = 0.3125.

  6. From the television survey, find the probability that a randomly chosen surveyed household has at least 33 televisions.

    Answer

    0.350.35

    Full solution

    44+26200=70200=0.35\tfrac{44 + 26}{200} = \tfrac{70}{200} = 0.35.

  7. A game pays 1010 points with probability 0.20.2, 55 points with probability 0.30.3, and nothing otherwise. Find the expected payout.

    Answer

    3.53.5 points

    Full solution

    10(0.2)+5(0.3)+0(0.5)=2+1.5=3.510(0.2) + 5(0.3) + 0(0.5) = 2 + 1.5 = 3.5.

  8. Build the probability distribution for the number of sixes in one roll of a die, and find its expected value.

    Answer

    P(0)=56P(0) = \tfrac{5}{6}, P(1)=16P(1) = \tfrac{1}{6}; expected value 16\tfrac{1}{6}.

    Full solution

    One roll gives either no six or one six. E=0⋅56+1⋅16=16E = 0 \cdot \tfrac{5}{6} + 1 \cdot \tfrac{1}{6} = \tfrac{1}{6}.

  9. Explain what an expected value of 1.251.25 correct answers means, since no one can get 1.251.25 answers right.

    Answer

    It is the long-run average: over many students guessing, the average number correct settles near 1.251.25.

    Full solution

    Each guesser gets a whole number right. But across many guessers the results spread out according to the distribution, and their average approaches 1.251.25 — the mean of the distribution.

  10. For the television survey, Sam finds the expected number of televisions by averaging 00, 11, 22, 33 and 44, getting 22. Find his error.

    Hint

    Are all five values equally common?

    Answer

    He weighted every value equally. Weighted by probability, the expected value is 2.152.15.

    Full solution

    Averaging the five values treats a household with 00 televisions as equally likely as one with 22. In the survey, 22 televisions was nine times as common as 00.

    The expected value weights each value by its probability: 0(0.04)+1(0.25)+2(0.36)+3(0.22)+4(0.13)=2.150(0.04) + 1(0.25) + 2(0.36) + 3(0.22) + 4(0.13) = 2.15.

Frequently asked questions

What is a random variable?

A rule that assigns a number to each outcome of a chance process. The number of heads in three coin flips is a random variable taking the values 0, 1, 2 and 3.

How do I calculate an expected value?

Multiply each value by its probability and add the results. For three coin flips, 0(1/8) + 1(3/8) + 2(3/8) + 3(1/8) = 1.5 heads.

Can the expected value be impossible to actually get?

Yes. Three coin flips never give 1.5 heads. The expected value is the long-run average of many repetitions, not a result any single one must produce.

What is an empirical probability distribution?

One whose probabilities come from observed data rather than theory, such as the share of surveyed households owning each number of televisions.

Is guessing on a multiple-choice test worth it?

It depends on the scoring. With no penalty, guessing adds points on average. With a penalty of one third of a point per wrong answer on four-choice questions, random guessing gains nothing on average.

What to learn next

Standards alignment

This lesson covers the following Common Core State Standards for Mathematics.

  • CCSS.MATH.CONTENT.HSS.MD.A.1Using Probability to Make Decisions(+) Define a random variable for a quantity of interest by assigning a numerical value to each event in a sample space; graph the corresponding probability distribution using the same graphical displays as for data distributions.
  • CCSS.MATH.CONTENT.HSS.MD.A.2Using Probability to Make Decisions(+) Calculate the expected value of a random variable; interpret it as the mean of the probability distribution.
  • CCSS.MATH.CONTENT.HSS.MD.A.3Using Probability to Make Decisions(+) Develop a probability distribution for a random variable defined for a sample space in which theoretical probabilities can be calculated; find the expected value.
  • CCSS.MATH.CONTENT.HSS.MD.A.4Using Probability to Make Decisions(+) Develop a probability distribution for a random variable defined for a sample space in which probabilities are assigned empirically; find the expected value.