Expected value and variance calculator

Enter your values. The answer and the full worked solution update as you type.

Result

E[X] = μ1.7
Variance0.81
Standard deviation0.9
E[X²]3.7
xP(x)x·P(x)x²·P(x)
00.100
10.30.30.3
20.40.81.6
30.20.61.8

Find the expected value, variance and standard deviation of a discrete random variable. Enter the possible values and their probabilities; fractions such as 1/6 are allowed. The calculator checks that the probabilities add up to 1 and shows the table of x·P(x) and x²·P(x) used in the calculation.

Step-by-step solution

Check the probabilities

Σp = 0.1 + 0.3 + 0.4 + 0.2 = 1 ✓

Expected value

E[X] = Σ x·P(x) = 0·0.1 + 1·0.3 + 2·0.4 + 3·0.2 = 1.7

Variance and standard deviation

E[X²] = Σ x²·P(x) = 3.7
Var(X) = E[X²] − (E[X])² = 3.7 − 1.7² = 0.81
σ = √0.81 = 0.9

Key formulas

Expected value
E[X] = Σ xi·pi
Variance
Var(X) = Σ pi(xi − E[X])² = E[X²] − E[X]²
Probabilities
Σ pi = 1

How to calculate an expected value

  1. List every possible value x and its probability P(x). The probabilities must add up to 1.
  2. Expected value: E[X] = Σ x·P(x).
  3. Second moment: E[X²] = Σ x²·P(x).
  4. Variance: Var(X) = E[X²] − (E[X])², and the standard deviation is its square root.

Questions and answers

What does the expected value mean?

It is the long-run average if the experiment is repeated many times. It does not have to be one of the possible values: the expected value of a fair die is 3.5.

How is the expected value used for games and decisions?

Use the net gain as x. If the expected net gain of a bet is negative, you lose money on average in the long run, even though you may win single games.

Why do I get an error that the probabilities do not add up to 1?

Every outcome must be listed exactly once. Rounded decimals such as 0.33, 0.33 and 0.33 add up to 0.99; enter 1/3 instead.

How do E[aX + b] and Var(aX + b) change?

E[aX + b] = a·E[X] + b and Var(aX + b) = a²·Var(X). Adding a constant shifts the mean but does not change the spread.

Practise it yourself

Practise Probability

A calculator gives the answer. In the exam you need the method: practise it with new problems, hints and worked solutions.

</> Embed

Free for teachers and schools: paste this code into your course page, LMS or website. Students can use the calculator and its worked solution without an account.

More calculators