statcompute

Distributions

Expected Value Calculator

The long-run average of a random quantity — and the risk that average conceals.

Updated August 2026Runs in your browser — nothing is uploadedVerified against R
One value per line.
One per outcome, in the same order. They must sum to 1 — or to 100 if you prefer percentages.

The calculation runs in your browser, so this box needs JavaScript. The formula, the worked example and the interpretation below do not.

01

How to read this result

The expected value is a weighted average, and the weights are probabilities. It is where the distribution would balance on a fulcrum — which is why it need not be an outcome that can actually occur. The expected value of a fair die is 3.5.

It is a long-run average, not a prediction. A lottery ticket with an expected value of −£0.60 never loses exactly sixty pence. The average only emerges over many repetitions, and how many depends on the standard deviation.

Which is why the SD is reported beside it. Two bets with the same expectation and very different spreads are not the same bet. A guaranteed £5 and a 1-in-1,000 chance of £5,000 share an expected value and nothing else.

Expected value is additive, always. E(X + Y) = E(X) + E(Y) whether or not X and Y are independent — a property that makes it far better behaved than variance, which only adds when the variables are independent.

02

The formula

E(X)=xiP(xi)Var(X)=(xiE(X))2P(xi)
xi
each possible outcome
P(xi)
its probability — the set must sum to 1

The standard deviation is the square root of the variance, in the same units as the outcomes.

03

Worked example

Expected number of defects

A batch contains 0, 1, 2 or 3 defects with probabilities 0.1, 0.2, 0.4 and 0.3. What is the expected number, and how much do batches vary?

  1. Multiply each outcome by its probability.
    0 × 0.1 = 0 1 × 0.2 = 0.2 2 × 0.4 = 0.8 3 × 0.3 = 0.9
  2. Add them.
    E(X) = 0 + 0.2 + 0.8 + 0.9 = 1.9
  3. For the variance, square each outcome's distance from 1.9 and weight it.
    (0−1.9)²(0.1) + (1−1.9)²(0.2) + (2−1.9)²(0.4) + (3−1.9)²(0.3)
  4. Which comes to:
    0.361 + 0.162 + 0.004 + 0.363 = 0.89
  5. The standard deviation.
    √0.89 = 0.943
E(X) 1.9variance 0.89SD 0.943most likely outcome 2

The expected value of 1.9 is not an outcome that can occur. The most likely single outcome is 2, and neither number alone describes the batch — which is why both are reported.

Checked against Σ x·P(x) and Σ (x − E)²·P(x), computed directly.

The calculator above is loaded with these numbers by the Load the worked example button.

04

Assumptions, and when to use something else

The probabilities must be non-negative and sum to 1 — the calculator refuses anything else rather than normalising silently, because a set that does not sum to 1 usually means an outcome is missing rather than that the numbers need rescaling.

The outcomes must be numeric and on a scale where averaging means something. Expected value of a category is not defined.

For continuous quantities, the sum becomes an integral; the calculator handles the discrete case, which covers most practical problems.

  • The outcomes follow a standard distributionBinomial distributionFor counts of successes, the mean is np and needs no enumeration.
  • You are combining probabilities rather than averaging outcomesProbability calculatorAND, OR and at-least-one rules.
  • You want to update probabilities with evidenceBayes' theoremConditional probability, run backwards.
05

Questions people ask

Can the expected value be a number that cannot happen?

Yes, and usually it is. A fair die has an expected value of 3.5. Expected value is a balance point, not a forecast of any single trial.

What if my probabilities do not add to 1?

The calculator refuses the input, because the usual cause is a missing outcome rather than a scaling problem. Percentages summing to 100 are accepted and converted.

What is expected value used for?

Deciding between uncertain options: insurance pricing, expected revenue, whether a bet is worth taking. It is the right criterion when the same decision is repeated many times and no single outcome is catastrophic — which is exactly when it is not the right criterion for a one-off decision that could ruin you.