Expected Value Calculator (Mean, Variance of Outcomes)

The expected value is the long-run average result of a random event — each outcome weighted by its probability. This expected value calculator takes up to four outcomes and their probabilities and returns E(X), the variance and the standard deviation, and checks that the probabilities add up to 100%.

calculated
calculated
calculated
calculated
Type in any field to change it. Press × on a value to calculate that field instead.

How to use the expected value calculator

Enter up to four outcome values (gains as positive numbers, losses as negative) and the probability of each. Set the probability of unused outcomes to 0. The calculator returns the expected value, variance and standard deviation, and the total of the probabilities so you can check it is 100%.

Expected value formulas

E(X) = Σ xᵢ pᵢ  ·  Var(X) = Σ xᵢ² pᵢ − E(X)²  ·  σ = √Var(X)

Example

A game pays +100 with probability 5%, +20 with 15% and 0 with 50%, and costs −10 with probability 30%:

Outcome x Probability p x × p x² × p
+100 5% +5.00 500.00
+20 15% +3.00 60.00
+0 50% +0.00 0.00
-10 30% -3.00 30.00
  • E(X) = 5 + 3 + 0 − 3 = 5
  • Var(X) = 590 − 5² = 565, standard deviation = √565 = 23.77

On average the game pays 5 per play, but the large standard deviation shows individual results vary widely.

Notes

  • For a fair die the expected value is 3.5.
  • Expected value is a weighted average with probabilities as the weights.

Frequently asked questions

What is the formula for expected value?

E(X) = Σ xᵢ pᵢ — multiply each outcome by its probability and add the results. The probabilities must add up to 1 (100%).

How do I calculate the variance of a random variable?

Var(X) = Σ xᵢ² pᵢ − E(X)². The standard deviation is the square root of the variance and is in the same units as the outcomes.

What is the expected value of rolling a die?

(1 + 2 + 3 + 4 + 5 + 6) ÷ 6 = 3.5. The expected value need not be a possible outcome — it is the average over many rolls.

How is expected value used in decisions?

A bet or project with a positive expected value gains on average over many repetitions. Insurance, lotteries and casino games have a negative expected value for the buyer; risk (the standard deviation) matters too when the stake is large.

Embed this calculator

Free to use on your website or blog. Copy this code: