Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

Random variables and expected value, refreshed

~8 min

A sample statistic, such as a sample mean or a sample proportion, is itself a random variable. Its value depends on which sample happened to be drawn. Chapters 08 onward lean on that idea constantly. So it is worth refreshing what a random variable and its expected value actually are. This happens before this course builds statistics out of them. Probability's own chapters on random variables come later, in that course's own sequence. So this refresher stands on its own. It does not pull review questions from material not yet written there.

E[X] is the same balance-point idea from earlier in this chapter. Probability just stands in for the weight now. A likely outcome pulls the average hard toward itself. A rare outcome barely moves it, even a huge one.

A random variable X assigns a number to every outcome of a random process. Its probability distribution must assign a nonnegative probability to every value. Those probabilities must sum to exactly 1. The expected value E[X] = \sum_x x \cdot P(X=x) is the long-run average value of X, over many repeats. It is a weighted mean of the possible outcomes, weighted by how likely each one is.

Is this a valid probability distribution?

Adjust each outcome's probability. A random variable's distribution needs every value nonnegative AND summing to exactly 1.

Loading interactive…

Worked example

Expected value of a simple bet

  1. 1

    A game costs nothing to play: you win $10 with probability 0.3, or lose $5 (net) with probability 0.7. Find the expected value.

  2. 2

    Weight each outcome by its probability and add: 10(0.3) + (-5)(0.7).

  3. 3
    \boxed{E[X] = 3 - 3.5 = -0.5}

Loading interactive…

Worked example

A sample mean is a random variable

  1. 1

    Three different samples of the same population produce sample means 68, 71, and 74. Why does it make sense to call "the sample mean" a random variable rather than a single fixed number?

  2. 2

    Each sample is itself a random outcome. The mean computed from it changes, depending on which sample happened to be drawn. That is exactly the definition of a random variable: a number assigned to the outcome of a random process.

  3. 3
    \boxed{\text{The sample mean varies sample to sample, so it has its own distribution -- the sampling distribution, chapter 08}}

Loading interactive…

Where this goes next

Sampling distributions, chapter 08

Later in this course, you will see many "average sample statistic" claims. One example: a sample mean is centered at the population mean. Another: a sample proportion is centered at the true proportion. Each of these is really a statement about E[X]. Here X is the random variable "the statistic computed from a random sample." This section's refresher is the whole reason that claim can be proven, rather than just asserted.

Check your understanding (counts toward your progress)

Which of these is a valid probability distribution for a random variable with 3 outcomes?

Correct! 🎉 Not quite.

Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.

Sums to 1.5, not 1.

Sums to 1.1, not 1.

Contains a negative probability, which is never allowed.

Why

0.3 + 0.3 + 0.4 = 1 and every value is nonnegative — the two requirements for a valid distribution.

A random variable takes value 4 with probability 0.25, value 10 with probability 0.5, and value x with probability 0.25. If E[X] = 7, find x.

Correct! 🎉 Not quite.

Right on try — credit. Right — the answer had already been shown, so no credit this time. Next try is worth Answer shown after three tries — this one no longer earns credit. You chose to see the answer — this one earns no credit.

Why

0.25(4) + 0.5(10) + 0.25x = 7 → 1 + 5 + 0.25x = 7 → 0.25x = 1 → x = 4.

Correct answer

Also accepted:

Why

Explain why calling a sample mean a 'random variable' makes sense, using the language of this section.

Feeling good about this section?

Take the section quiz

Every answer gets a full explanation at the end.

Graph settings

Calculator

Sign in to save highlights

Insert an equation

  • No matches.