Expected Value Calculator

The expected value of a random quantity is its long-run average: each outcome multiplied by its probability, then added up. This calculator takes a list of outcomes and their probabilities, checks the probabilities add to one, and gives the expected value, variance and standard deviation exactly, with the distribution drawn as a bar chart.

Must add up to 1. Fractions are fine.
Try:

How to use the expected value calculator

  1. Enter the outcomes, separated by commas.
  2. Enter the matching probabilities (they must add to 1).
  3. Press Calculate to see E(X), the variance and the chart.

Formula

E(X)=∑x P(x)E(X) = \sum x\,P(x)
Var⁡(X)=E(X2)−E(X)2\operatorname{Var}(X) = E(X^2) - E(X)^2

Worked example: 0–3 with given probabilities

  • Outcomes x: 0, 1, 2, 3
  • Probabilities P(x): 0.1, 0.3, 0.4, 0.2

✓ Answer checked

E(X)=1710=1.7E(X) = \frac{17}{10} = 1.7
Variance
81100≈0.81\frac{81}{100} \approx 0.81
Standard deviation
≈0.9\approx 0.9
00.10.20.30.40: 0.101: 0.312: 0.423: 0.23
The probability distribution. Its balance point is the expected value, 1.7.
Step-by-step working (2 steps)
  1. Multiply each outcome by its probability E(X) = Σ x·P(x)

    Then add the results.

    E(X)=(0)(110)+(1)(310)+(2)(25)+(3)(15)=1710E(X) = (0)(\frac{1}{10}) + (1)(\frac{3}{10}) + (2)(\frac{2}{5}) + (3)(\frac{1}{5}) = \frac{17}{10}
  2. Variance

    Expected value of x² minus the square of the expected value.

    E(X2)−E(X)2=3710−(1710)2=81100E(X^2) - E(X)^2 = \frac{37}{10} - (\frac{17}{10})^2 = \frac{81}{100}
Formulas used
E(X)=∑x P(x)E(X) = \sum x\,P(x)
Var⁡(X)=E(X2)−E(X)2\operatorname{Var}(X) = E(X^2) - E(X)^2
How this was checked
  • ✓ The definition Σ(x − μ)²P(x) gives exactly the same variance.

Frequently asked questions

What is the expected value of a fair die?

(1 + 2 + 3 + 4 + 5 + 6) ÷ 6 = 3.5.

Is a raffle with a 1% chance to win 100 and a 2 ticket worth it?

The expected value is 0.01 × 100 − 0.99 × 2 = −0.98, so on average you lose about 0.98 per ticket.

Can the expected value be an impossible outcome?

Yes. A die never shows 3.5, but that is its long-run average.

Related calculators

Related guides