Expected Value and Variance Calculator

This expected value and variance calculator takes a list of outcomes and their probabilities. It returns E[X], the variance, the standard deviation and a full distribution table.

Checks on your data

  • The probabilities sum to 1, as a valid distribution requires.
  • The expected value need not be a possible outcome. For a fair die it is 3.5.

Results

Expected value E[X]
2
Variance Var(X)
1.2
Standard deviation
1.0954451
E[X²]
5.2
Median
2
Mode (most likely value)
2
Sum of probabilities
1
must equal 1
Probability distribution (mean 2)
00.10.20.30.40: 0.100.11: 0.210.22: 0.420.43: 0.230.24: 0.140.1
Distribution table
xP(x)x·P(x)(x − μ)²·P(x)Cumulative P(X ≤ x)
00.100.40.1
10.20.20.20.3
20.40.800.7
30.20.60.20.9
40.10.40.41
Show step-by-step solution
  1. E[X] = Σ x·P(x) = 0×0.1 + 1×0.2 + 2×0.4 + 3×0.2 + 4×0.1 = 2.
  2. E[X²] = Σ x²·P(x) = 5.2.
  3. Var(X) = E[X²] − (E[X])² = 5.2 − 4 = 1.2.
  4. σ = √Var(X) = 1.0954451.
E[X]Σ x·P(x)
Var(X)E[X²] − μ²
NeedsΣ P(x) = 1
UseDiscrete outcomes

What Is Expected Value and Variance?

The expected value of a discrete random variable is the probability-weighted average of its outcomes, E[X] = Σ x·P(x). The variance measures spread around that average: Var(X) = Σ (x − μ)² P(x), which equals E[X²] − μ².

Enter the outcomes and probabilities as lists. The calculator checks that the probabilities sum to 1, then gives the expected value, variance, standard deviation, E[X²], median and mode, with a working table and a bar chart of the distribution.

The sections below explain the formulas, the variables, a worked example with a fair die and answers to common questions about probability distributions.

How to Use the Expected Value and Variance Calculator

  1. Enter the possible outcomes separated by commas.
  2. Enter the probability of each outcome in the same order.
  3. Choose decimals or percentages.
  4. Read E[X], variance, standard deviation and the working table.

Expected Value and Variance Formula

Expected value

E[X]=∑xi P(xi)E[X]=\sum x_i\,P(x_i)

Variance

Var(X)=∑(xi−μ)2P(xi)=E[X2]−μ2Var(X)=\sum (x_i-\mu)^2P(x_i)=E[X^2]-\mu^2

Standard deviation

σ=Var(X)\sigma=\sqrt{Var(X)}

Expected Value and Variance Variables Explained

SymbolMeaningNotes
xA possible outcome
P(x)Probability of that outcomeall must sum to 1
E[X] or μExpected value
Var(X)VarianceE[X²] − μ²
σStandard deviation√Var(X)

Expected Value and Variance Worked Example

A fair six-sided die has outcomes 1 to 6, each with probability 1/6. E[X] = (1 + 2 + 3 + 4 + 5 + 6) ÷ 6 = 3.5. E[X²] = 91 ÷ 6 = 15.1667, so Var(X) = 15.1667 − 3.5² = 2.9167 and σ = 1.708.

With the example values loaded in the calculator above, the steps are:

  1. E[X] = Σ x·P(x) = 0×0.1 + 1×0.2 + 2×0.4 + 3×0.2 + 4×0.1 = 2.
  2. E[X²] = Σ x²·P(x) = 5.2.
  3. Var(X) = E[X²] − (E[X])² = 5.2 − 4 = 1.2.
  4. σ = √Var(X) = 1.0954451.

Result: Expected value E[X] = 2; Variance Var(X) = 1.2; Standard deviation = 1.0954451.

How to Read Expected Value and Variance

The expected value is the long-run average of the outcome. For a fair die, E[X] = 3.5, which is not a face you can roll. It is the average over many rolls. The variance 2.9167 measures the typical squared distance from 3.5, and the standard deviation is 1.708.

Two games with the same expected value can differ a lot in variance. A higher variance means bigger swings from the average, so a longer run is needed before results settle near E[X].

Where Expected Value and Variance Is Used

Games and bets

Work out the average gain or loss per play and how much it swings.

Probability homework

Check E[X], E[X²] and Var(X) for a table of outcomes.

Decisions

Compare options with the same expected value but different spread.

Insurance and risk

Find the average claim and its variability.

Common Expected Value and Variance Mistakes to Avoid

  • The probabilities must add to 1. The calculator shows the sum so you can check.
  • The expected value does not have to be one of the outcomes.
  • Compute E[X²] first, then Var(X) = E[X²] − (E[X])².
  • Do not divide by n − 1 here. This is a probability distribution, not a sample.

Expected Value and Variance Terms and Definitions

Random variable
A quantity whose value is determined by chance.
Expected value
The probability-weighted average of all outcomes.

Expected Value and Variance FAQs

How do you calculate expected value?

Multiply each outcome by its probability and add the results. For a fair die this gives (1 + 2 + 3 + 4 + 5 + 6) ÷ 6 = 3.5.

How do you find the variance of a probability distribution?

Compute E[X²] by squaring each outcome before weighting, then subtract the square of the mean. For a die, 15.1667 − 3.5² = 2.9167.

Can the expected value be a number that is not an outcome?

Yes. A die never shows 3.5, but the average of many rolls approaches it.

What if my probabilities do not add to 1?

Then they do not form a valid distribution. Check for a typo or a missing outcome. The calculator displays the total so you can see by how much it is off.

Related calculators

Last updated 2026-11-09. See our disclaimer.