Expected Value Calculator

The expected value of a random variable, written E(X), is the weighted average of all possible outcomes where each outcome is weighted by its probability. It tells you the long-run average result you would expect if you repeated the same random experiment an infinite number of times. Expected value is a foundational concept in probability theory, decision-making, finance, and game theory. When you buy insurance, invest in shares, or decide whether to accept a bet, you are (whether you realise it or not) comparing expected values. The formula is simple: E(X) equals the sum of each possible outcome multiplied by its probability. For a fair six-sided die, the outcomes are 1, 2, 3, 4, 5, and 6, each with probability 1/6, giving E(X) = 3.50. You can also calculate the variance of the distribution, which measures how spread out the outcomes are around the expected value. Variance equals E(X squared) minus [E(X)] squared. Standard deviation is the square root of variance and is expressed in the same units as the outcomes. This calculator accepts comma-separated outcomes and their corresponding probabilities. Probabilities should be entered as decimal fractions that sum to 1 (for example, 1/6 is entered as 0.1667). If you have equal probabilities, you can enter the same value for each. The calculator checks whether the probabilities sum to 1 and warns you if they do not. You get E(X), variance, standard deviation, probability sum, and the number of outcomes. Useful for students, statisticians, gamblers analysing odds, and anyone weighing up options with uncertain payoffs.

Calculate.co.nz is proud to be partnered with Premium Homes, a recognised leader in eco-friendly, sustainable, and energy-efficient homebuilding. With a dedicated team and award-winning experience, they create homes that prioritise health, comfort, and long-term performance. Their founders, Andrew and Kelly, set out to raise the standard of residential construction in New Zealand by combining practical building expertise with a clear commitment to doing things better for homeowners.
Calculate.co.nz partner: Premium Homes
3.50
expected value E(X)
Variance2.9148
Std deviation1.7073
Probability sum1.0002
Outcomes (n)6

How it works

The calculator parses the outcomes and probabilities as parallel comma-separated lists. It takes the shorter length as n. E(X) is the sum of xi times pi for all i. E(X squared) is the sum of xi squared times pi. Variance is E(X squared) minus [E(X)] squared. Standard deviation is the square root of variance. The probability sum is displayed so you can verify the distribution is valid. If the sum differs from 1 by more than 0.01, the result is flagged as potentially invalid.

Worked example

For a fair six-sided die, outcomes are 1, 2, 3, 4, 5, 6 each with probability entered as 0.1667. E(X) = (1 x 0.1667) + (2 x 0.1667) + ... + (6 x 0.1667) = 21 x 0.1667 = 3.5007 ≈ 3.50. Using the stored probabilities, E(X squared) = (1 + 4 + 9 + 16 + 25 + 36) x 0.1667 = 15.1697. Variance = 15.1697 - (3.5007) squared = 15.1697 - 12.2549 = 2.9148. Standard deviation = sqrt(2.9148) = 1.7073. These match the default values pre-filled above.

Related calculators