🧮
🧮 Math & statistics

Expected Value & Variance Calculator (discrete)

Results update as you type.

Your numbers

Understanding the expected value and variance calculator — concept and principle

The expected value E[X] of a discrete random variable is its probability-weighted average: the long-run mean you would see if the same situation were repeated many times. Variance and standard deviation measure how far individual outcomes typically fall from that mean. Together they are used to compare games and lotteries, price insurance, evaluate business decisions with uncertain payoffs and summarize any probability distribution given as a table.

Expected value of a three-outcome prize0 with 70%, 10 with 25% and 100 with 5%: 0 + 2.5 + 5 = 7.5 on average; variance 468.75, SD about 21.65.Average payout of 100 tickets70 × 025 × 105 × 100x = 0p = 0.700 × 0.70 = 0x = 10p = 0.2510 × 0.25 = 2.5x = 100p = 0.05100 × 0.05 = 5$E[X] = 0 + 2.5 + 5 = 7.5the long-run average per ticketVariance 468.75 · SD ≈ 21.65 (wide spread)
Each outcome is weighted by its probability; the rare 100 supplies two-thirds of the 7.5.

How it is calculated

Enter the outcomes x₁, x₂, … and their probabilities p₁, p₂, … as two comma-separated lists of the same length.

The principle

Think of the probabilities as weights on a number line. E[X] is the balance point, the centre of mass of those weights. By the law of large numbers, the average of many independent repetitions approaches E[X]. Variance squares each deviation so that values above and below the mean do not cancel and large deviations count more; the square root returns to the original units. Expected value is linear: E[aX + b] = aE[X] + b, while Var(aX + b) = a²Var(X).

Worked example

  1. Defaults: x = 0, 10, 100 with p = 0.7, 0.25, 0.05 (Σp = 1).
  2. E[X] = 0·0.7 + 10·0.25 + 100·0.05 = 0 + 2.5 + 5 = 7.5.
  3. Deviations squared and weighted: 0.7·(−7.5)² = 39.375; 0.25·(2.5)² = 1.5625; 0.05·(92.5)² = 427.8125.
  4. Variance = 39.375 + 1.5625 + 427.8125 = 468.75. Check: E[X²] = 0 + 25 + 500 = 525, and 525 − 7.5² = 468.75.
  5. Standard deviation = √468.75 ≈ 21.65063509.

How to read the result

If the outcomes were prizes and a ticket cost 10, the expected net result would be 7.5 − 10 = −2.5 per play: a loss in the long run even though one play in twenty wins 100. The standard deviation of 21.65 is almost three times the mean, showing that the result is dominated by the rare large outcome. Use E[X] to compare long-run averages and σ to compare risk.

Common mistakes

Keep in mind: Expected value describes the long-run average over many repetitions. For a single decision with large stakes, risk, ruin and personal circumstances matter too; this is not financial advice.

Frequently asked questions

Can the expected value be a value X never takes?

Yes. A fair die has E[X] = 3.5, which is not a face of the die.

Is a positive expected value always a good bet?

Not necessarily. High variance can wipe out a limited budget before the average shows up.

How is this different from the mean of a data set?

A data mean weights each observation equally; E[X] weights each outcome by its probability. With observed relative frequencies as probabilities, they coincide.

Sources: Sheldon M. Ross, A First Course in Probability, Pearson — expectation and variance · William Feller, An Introduction to Probability Theory and Its Applications, Vol. 1, Wiley

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

🧮 All math & statistics tools →🌍 Calculators by country →