Search the complete library

What do you want to learn or calculate?

Quick linksAll calculatorsMath subjectsPractice questionsFormula library
← Probability formulas

Expected value and variance

Find the long-run center and squared spread of a discrete random variable.

Probability · Random variables
$$E[X]=\sum_x xP(X=x),\qquad\operatorname{Var}(X)=E[X^2]-E[X]^2$$

Expected value and variance is one of 1 random variables formula in the probability section of this library, and it is used at ap · university level.

Why expected value and variance works

The expected value weights every possible outcome by how often it occurs, so it is the long-run average rather than the most likely single result. The variance shortcut works because expanding the average squared distance from the mean cancels down to the mean of the squares minus the square of the mean.

What each symbol means

$x$ ranges over possible values.

Expected value and variance: when it holds

Probabilities must be nonnegative and sum to $1$; the required sums must converge.

When it stops applying

The probabilities have to sum to 1 and the sums have to settle on a finite total. In the St Petersburg game, where the payout doubles with each coin flip, every term contributes the same amount and the expected value is infinite, so no finite fair price exists.

Expected value and variance: a worked example

For a fair die, $E[X]=(1+2+3+4+5+6)/6=3.5$.

The mistake to avoid

What people do: Averaging the possible values without weighting them by their probabilities.

Why it goes wrong: A lottery ticket paying 1000000 with a one-in-a-million chance and nothing otherwise has an expected value of 1. Averaging the two outcomes gives 500000 and describes no reality at all.

Do this instead: Multiply each value by its own probability before adding, and check that the probabilities you used sum to exactly 1.

Expected value and variance: step by step

  1. Name the unknown, and the unit the answer has to come out in.
  2. Match the symbols to your values. $x$ ranges over possible values.
  3. Check the conditions before substituting. Probabilities must be nonnegative and sum to $1$; the required sums must converge.
  4. Substitute, keep exact values to the last line, then test the sign, size, and unit against a rough estimate — the check that catches most probability slips.

Where this formula fits

Subject
Probability formulas — 17 entries in this library
Topic
Random variables
Level
AP · University

Formulas are easiest to keep when they sit inside a method rather than on a list. Use the links below to see where expected value and variance comes from, to check a calculation against a tool, and to practise it until you can recall it without looking.

Questions about expected value and variance

Can an expected value be negative?

Yes, and every casino game gives the player one. American roulette on a single colour returns about -0.0526 per unit staked, which is the house edge stated as an average loss.

Why use the mean of the squares minus the square of the mean?

It is an algebraic shortcut that avoids computing every deviation separately. Both versions give the same answer, but this one needs only two running totals.

Is the expected value the most likely outcome?

No, and it need not even be possible. A fair die has an expected value of 3.5, a number that can never come up on any single roll.

What does an expected value of zero mean?

It marks a fair game, where the long-run average gain is nothing. Individual plays still win and lose; only the average across many repetitions settles at zero.

Stuck on a problem?

Work a expected value and variance problem step by step

Type your own problem, or upload a photo of it. You get the method, the answer, and a check you can repeat yourself.