Expected Value Calculator

StatisticsLast updated: August 22, 2026

The expected value is the value a discrete random variable takes on average in the long run, and it is computed as E(X) = Σxᵢ·pᵢ. It is really a weighted mean: every possible outcome carries a weight equal to its probability. The long-run return of a gambling game, the pricing of an insurance premium, investment decisions, and inventory planning all rest on this single number.

The expected value alone can be misleading, though: two distributions with the same E(X) can be almost certain or extremely risky. That is why this calculator also returns the variance, the standard deviation, the coefficient of variation, and the mode and median of the distribution; it shows how much each row contributes in a working table and draws the probability distribution as a bar chart.

The outcomes the random variable can take. Use a period as the decimal separator (12.5); separate the values with commas, spaces, or line breaks.
The probability of each value, in exactly the same order as the values above. They must sum to 1 (or to 100 in percentage mode).
If you choose percentages, the entered values are divided by 100 to turn them into probabilities.

Expected Value and Variance Formulas

Expected value:      E(X) = Σ xᵢ · pᵢ
Second moment:       E(X²) = Σ xᵢ² · pᵢ
Variance (definition): Var(X) = Σ (xᵢ − E(X))² · pᵢ
Variance (shortcut): Var(X) = E(X²) − [E(X)]²
Standard deviation:  σ = √Var(X)
Coefficient of var.: CV = σ / |E(X)|
Validity condition:  0 ≤ pᵢ ≤ 1  and  Σ pᵢ = 1
Linear transform:    E(aX + b) = a·E(X) + b,   Var(aX + b) = a²·Var(X)

These formulas are for discrete random variables (those with countably many outcomes). For continuous variables the sum becomes an integral: E(X) = ∫x·f(x)dx. If the probabilities do not sum to 1 the distribution is not valid and the calculator refuses to compute.

How to Calculate

  1. Enter every value the random variable can take (xᵢ) in the first box; gains are positive and losses are negative.
  2. Enter the probability of each value in the second box, in the same order; the two lists must line up exactly.
  3. Use the 'Probability format' field to say whether you entered decimals (0.35) or percentages (35).
  4. Make sure the probabilities sum to 1 (or to 100 in percentage mode); otherwise the calculator returns an error.
  5. Read the standard deviation next to E(X): between two options with the same expected value, the one with the smaller σ is less risky.
  6. Inspect the working table to see how much each row contributes to E(X) and to the variance; this is where you see how extreme values inflate the variance.

Worked Examples

Distribution of daily breakdowns

Given the distribution of the number of daily breakdowns of a machine, E(X) = 0×0.35 + 1×0.30 + 2×0.20 + 3×0.10 + 4×0.05 = 1.20 breakdowns. Since E(X²) = 2.80, Var(X) = 2.80 − 1.44 = 1.36 and the standard deviation is 1.17. The single most likely outcome is 0 breakdowns (35%), yet in the long run an average of 1.2 breakdowns per day is expected.

Expected value E(X): 1.20 · Variance Var(X): 1.36 · Standard deviation σ: 1.17

Lottery ticket — a negative expected value

For a ticket bought for 50 TL that returns a net 950 TL with probability 2%, E(X) = -50×0.98 + 950×0.02 = -49 + 19 = -30 TL. The variance is 19,600 and the standard deviation is 140 TL: even though the expected loss is 30 TL, the outcome of a single ticket lands far away from it. The very large coefficient of variation shows just how risky the game is.

Expected value E(X): -30 · Variance Var(X): 19,600 · Standard deviation σ: 140

Sales scenarios entered as percentages

When the probabilities of four sales scenarios are entered as percentages, the calculator converts them to 0.40 / 0.35 / 0.20 / 0.05. Expected sales are E(X) = 0 + 35 + 50 + 25 = 110 units, E(X²) = 28,500, and Var(X) = 28,500 − 12,100 = 16,400, so the standard deviation is 128.06 units. The median of the distribution is 100 and the most likely outcome is 0 units.

Expected value E(X): 110 · Variance Var(X): 16,400 · Standard deviation σ: 128.06

Frequently Asked Questions

How is the expected value calculated?
Each possible outcome is multiplied by its own probability and the products are added up: E(X) = Σxᵢ·pᵢ. The probabilities must sum to 1, otherwise the result is meaningless. In Excel the same computation is a single step with =SUMPRODUCT(values, probabilities).
Does the expected value have to be one of the possible outcomes?
No. The expected value of a die roll is 3.5, but no face of a die shows 3.5. The expected value is not a prediction of a single trial; it is the number the average approaches over many repetitions. For that reason it should not be confused with the most likely outcome (the mode).
What is the difference between an expected value and a weighted mean?
Mathematically they are the same operation; the difference is in interpretation. In a weighted mean the weights are importance coefficients and can sum to any number (they are normalized afterwards). In an expected value the weights are probabilities and must sum to 1, and the result is not an estimate but a long-run average.
What happens if the probabilities do not sum to 1?
The distribution is not valid and the calculator returns an error instead of a result. The most common cause is forgetting to list one outcome — for example the 'nothing happens' case. Small rounding differences on the order of 0.001 are tolerated; for larger gaps the actual total is shown in the error message.
Why should the variance and standard deviation always be reported alongside?
The expected value says nothing about the size of the risk: a variable spread uniformly between 0 and 100 has the same E(X) as one that always returns 50. The variance measures how far the outcomes spread around E(X), and the standard deviation expresses that spread in the original unit. When making a decision, read both together.
What does a negative expected value mean?
It means an average loss in the long run; lotteries, gambling, and most insurance products have a negative expected value for the person buying them. It does not mean you lose every single time — only that the average converges toward a negative number as the number of repetitions grows. People accept a negative expected value in insurance because it protects them against a large loss.
How is the expected value found for continuous distributions?
The sum is replaced by an integral: E(X) = ∫x·f(x)dx. This calculator is for discrete distributions; the expected value of continuous distributions such as the normal, exponential, or uniform is given by closed-form expressions (for the normal distribution it is simply μ). You can also approximate it by grouping a continuous variable into classes and using the class midpoints.