Math
Expected Value Calculator
Compute the expected value E[X], variance, and standard deviation of a discrete probability distribution with up to 10 outcomes. Sees through coin flips, dice, insurance bets, and lottery tickets.
Outcomes and probabilities
Probability sum so far: 1 (2/10 outcomes)
Expected value E[X]
2.5
Variance
56.25
Std. deviation
7.5
Total probability
1
Per-outcome contribution to E[X]
| Value (x) | Probability (p) | Contribution (x times p) |
|---|---|---|
| 10 | 0.5 | 5 |
| -5 | 0.5 | -2.5 |
Frequently Asked Questions about the Expected Value Calculator
What is expected value?
Expected value, written E[X], is the long-run average payoff of a random outcome. You multiply each possible value by its probability and add the products: E[X] = sum of (xi * pi). It is not the value you expect on any single trial; it is the value you would converge to if you repeated the experiment forever. A bet that pays $10 on heads and loses $5 on tails has E[X] = 0.5 * 10 + 0.5 * (-5) = $2.50, even though every individual flip pays out $10 or -$5 and never $2.50.
Why do probabilities have to sum to 1?
Because the outcomes you list have to cover every possible result of the experiment exactly once. If your probabilities sum to less than 1, you have forgotten an outcome; if they sum to more than 1, you have double-counted something. The math of E[X] is a weighted average where the weights are probabilities, and weighted averages only make sense when the weights add to a known total. The calculator hard-rejects sums outside 0.9 to 1.1, warns you for anything outside 0.999 to 1.001, and only marks the distribution as fully valid when the sum lands inside that tight window.
How do variance and standard deviation fit in?
Variance measures how spread out the outcomes are around E[X]. The formula is Var(X) = sum of pi * (xi - E[X])^2: take each outcome, subtract the mean, square the gap, weight by probability, and add. Standard deviation is the square root of variance, in the same units as your outcomes, so it is easier to interpret. A coin flip paying $10 / -$5 has E[X] = 2.5, variance = 0.5 * (10 - 2.5)^2 + 0.5 * (-5 - 2.5)^2 = 56.25, and standard deviation = 7.5. Big standard deviation means the bet is volatile around its mean; small standard deviation means it is close to deterministic.
What does a positive expected value actually mean?
A positive E[X] means the bet pays out on average. Over many trials you make money; over a single trial anything can happen. Casinos, insurance companies, and lottery operators design products with negative E[X] for the customer and positive E[X] for the house: a lottery ticket might cost $2 with E[X] of $1.40, so the operator keeps 60 cents per ticket on average. Insurance flips it: the buyer pays a premium with negative E[X] but buys protection against a rare catastrophic outcome. The insurer collects positive E[X] across thousands of policies and pays out the occasional large claim.
If a bet has positive expected value, should I always take it?
No. Expected value treats a 50% chance of doubling your savings and a 50% chance of losing them the same as a guaranteed small profit, as long as the average matches. In real life, going broke once kills your ability to keep playing, so a bet with positive E[X] but catastrophic downside can still be irrational. This is why investors use risk-adjusted measures (Sharpe ratio, drawdown), why insurance exists at all (people accept negative E[X] to avoid ruin), and why the Kelly criterion sizes bets by both E[X] and volatility rather than by E[X] alone. Expected value tells you the direction of the bet; variance, standard deviation, and your bankroll tell you how much to put on the table.