Expected Value Formula: Derivation and 5 Worked Examples

The expected value formula is E[X] = Σ(p × x). Full derivation and five worked examples - coin flip, lottery, insurance, poker, and stock investment.

Mathematical formulas on a whiteboard illustrating expected value calculations
Updated
By Rob Griffiths6 June 2026 · 11 min read

The expected value formula for a discrete random variable is E[X] = Σ(p × x) - the sum, over every possible outcome, of that outcome's value multiplied by its probability. It is the most-used formula in probability theory and the foundation for every rational decision under uncertainty. This page derives the formula from first principles, then works through five examples - a coin flip, a UK lottery ticket, a home-insurance policy, a poker hand, and a stock investment - so you can see exactly how it applies in each domain.

What does the expected value formula actually say?

Each outcome counts in proportion to how likely it is

Expected value is the long-run average of a random outcome. If you repeated the same uncertain decision an infinite number of times, the average of your results would converge to E[X]. That convergence is guaranteed by the law of large numbers - provided the variance of X is finite.

The formula encodes a simple idea: outcomes that are more likely should count for more, and outcomes that are less likely should count for less. The probability is the weight; the outcome value is what gets weighted. Sum them all up and you have the average you would expect over many repetitions.

Three things to notice. First, the sum runs over every possible outcome - miss one and the formula gives the wrong answer. Second, the probabilities must add to 1, otherwise the calculation is meaningless. Third, expected value can equal a value the variable never actually takes - the expected value of a fair six-sided die is 3.5, which is not a face on the die.

How is the EV formula derived from first principles?

Why the weighted average is the right average

Imagine a game with three possible outcomes: you win £10, you win £0, or you lose £5. Suppose the probabilities are 30%, 50%, and 20% respectively (they sum to 100%, as required). What is the average outcome?

Play the game 100 times. Statistically, you would expect roughly 30 wins of £10 (= £300), 50 nothings (= £0), and 20 losses of £5 (= −£100). Total: £200. Average per game: £2.

The shortcut to that calculation is exactly the expected value formula. The 30 wins of £10 sum to £300, which is the same as 100 × 0.30 × £10. The 20 losses of £5 sum to −£100, which is 100 × 0.20 × (−£5). Add them together, divide by 100, and you get:

E[X] = 0.30 × £10 + 0.50 × £0 + 0.20 × (−£5) = £3 + £0 − £1 = £2

The formula falls out of the long-run average by definition. There is nothing magical about it - it is what "average" means when outcomes happen with different probabilities.

Example: what is the EV of a fair coin flip bet?

The simplest non-trivial expected value calculation

A friend offers you a bet: flip a fair coin. Heads, you win £15. Tails, you lose £10. Should you take it?

Compute the expected value. There are two outcomes, each with probability 0.5.

E[X] = 0.5 × £15 + 0.5 × (−£10) = £7.50 − £5.00 = £2.50

Every time you play, you expect to make £2.50 on average. Over a single flip, you will either gain £15 or lose £10 - those are the only two possibilities. But over a thousand flips, your total winnings should be roughly £2,500. Take the bet.

This is the cleanest illustration of why expected value matters. The bet pays out an asymmetric amount because the probabilities of both outcomes are equal, so the higher payoff dominates. The same expected value calculation generalises to any odds and any payout structure.

Example: what is the EV of a UK lottery ticket?

Why every lottery is a negative-EV bet

The UK National Lottery's Lotto draw requires you to match six numbers from 1 to 59. The probability of matching all six is 1 / C(59, 6) = 1 / 45,057,474. A ticket costs £2 and the jackpot averages around £4 million.

For simplicity, consider only the jackpot outcome and the no-win outcome. The expected value of one ticket is:

E[X] = (1 / 45,057,474) × £4,000,000 + (45,057,473 / 45,057,474) × £0 − £2

E[X] ≈ £0.089 − £2 = −£1.91

Every ticket has an expected value of around negative £1.91. You are paying £2 for an asset worth about 9 pence. Over many years, lottery players lose 96% of what they spend. The other prize tiers (matching five or four numbers) lift the figure slightly but not enough to make the bet positive - under almost any jackpot, the net expected value stays well below the ticket price.

This is one of the cleanest demonstrations that humans are not natural expected-value calculators. We respond to the size of the prize rather than its probability - see the availability heuristic for the psychology behind why lottery wins feel more vivid than the millions of losing tickets that funded them.

Example: what is the EV of a home insurance policy?

Buying negative EV on purpose (and why it is rational)

You pay £350 a year for buildings insurance on a £300,000 home. The probability of a total loss (fire, flood, structural collapse) in any given year is roughly 0.001 - one in a thousand homes. Smaller claims (storm damage, burst pipes) have higher probability, but assume the policy primarily exists to cover catastrophic loss.

The expected payout to you in any year is:

E[payout] = 0.001 × £300,000 + 0.999 × £0 = £300

Your expected value from buying the insurance is £300 − £350 = −£50. Every year you expect to lose £50 on average. Yet buying the policy is the rational choice - because losing your £300,000 home would be financially ruinous in a way that paying £350 a year is not.

This is the most important practical insight in expected-value thinking. EV is not the whole story when outcomes are non-linear in value - when a £300,000 loss hurts you more than 1,000 times as much as a £300 loss. The framework that handles this properly is expected utility, which weights outcomes by their personal impact rather than their monetary face value.

Example: what is the EV of a poker hand decision?

Pot odds, equity, and the EV of a single call

You are playing No-Limit Hold'em. The pot is £80 and your opponent has bet £40, making the total pot £120. You must call £40 to continue. You estimate (using conditional probability) that your hand has a 35% chance of winning at showdown.

There are two outcomes from calling: you win the £120 currently in the pot, or you lose your £40 call. Apply the formula:

E[call] = 0.35 × £120 + 0.65 × (−£40) = £42 − £26 = £16

The call has positive expected value of £16. Make the call. Every time you face this exact situation, you will sometimes win and sometimes lose, but the average across many such hands will be a £16 gain per call.

This is the calculation behind every poker decision worth taking seriously. The crucial input is your equity estimate - the 35% above. Get that wrong and the formula gives the wrong answer. The skill in poker is partly about working out your equity quickly and honestly; once you have it, the expected-value arithmetic is mechanical. See expected value in poker for more applications.

Example: what is the EV of a stock investment?

Expected value when outcomes are continuous

You are considering a £10,000 investment in a single stock. Three scenarios:

Bull case (probability 30%)
Stock returns +40% → £14,000
Base case (probability 50%)
Stock returns +8% → £10,800
Bear case (probability 20%)
Stock returns −30% → £7,000

Apply the expected value formula:

E[final value] = 0.30 × £14,000 + 0.50 × £10,800 + 0.20 × £7,000

E[final value] = £4,200 + £5,400 + £1,400 = £11,000

The expected final value is £11,000, so the expected return is (£11,000 − £10,000) / £10,000 = 10%. On expected-value grounds, the investment looks attractive - provided the input probabilities and outcome values are honest estimates.

But expected value alone does not capture risk. The same expected return is available from a fixed-income product with no bear-case loss, and most rational investors would prefer that. The full framework needs to account for the distribution around the expected value, which is what variance and Sharpe ratio capture. For position sizing on an investment like this, see the Kelly Criterion calculator.

When does the EV formula give the wrong answer?

Cases where EV maximisation is not the right rule

Expected value is the right number to maximise across a long sequence of independent, repeatable bets where the outcomes are linear in their personal impact. Three situations break those assumptions and require a different framework.

One-shot decisions with ruinous downside. If a single outcome would wipe you out (financially, professionally, medically), you should not maximise EV. The insurance example above is the classic case - the expected value of buying the policy is negative, but the policy is rational because losing the house is not 1,000 times as bad as losing the premium, it is infinitely worse. Expected utility handles this case.

Non-ergodic systems. Some processes have a time-average that diverges from the ensemble-average. The classic example is a 50% gain followed by a 50% loss: on average across many traders the wealth stays flat, but a single trader playing repeatedly trends toward zero. See ergodicity explained for why this matters for compounding investments.

Adversarial settings with shared information. If you are taking a market price as input to your EV calculation, the price already encodes other people's EV estimates. Acting on EV alone in markets means systematically betting against people with better information than you - see risk versus uncertainty for the distinction Knight drew between the two in 1921.

Frequently asked questions

Q01What does Σ mean in the expected value formula?
Σ is the Greek capital sigma - the mathematical notation for "sum of". Σ pᵢ × xᵢ means "add up the product of probability and value for every outcome i". If the variable can take values x₁, x₂, x₃ with probabilities p₁, p₂, p₃, the expected value is p₁x₁ + p₂x₂ + p₃x₃.
Q02How is expected value different from the mean?
For a probability distribution, they are the same number. The mean of a random variable is its expected value. The distinction matters when you have a sample of observations: the sample mean is your estimate of the population mean, which is the expected value. With infinite data, sample mean converges to expected value (the law of large numbers).
Q03Can expected value be negative?

Yes - and that is often the most useful answer the formula gives you. A negative expected value tells you the bet is unfavourable. Every lottery ticket, slot machine, and casino game has a negative expected value for the player. Recognising this is the first step to making rational decisions about whether to play.

Q04What if I don't know the probabilities?
You almost never do, exactly. Expected value calculations in real life use estimates - your best guess at the probabilities. The framework is still useful if your estimates are calibrated, even if they are imprecise. See probability calibration training for how to test whether your estimates are honest.
Q05How does the formula change for continuous outcomes?
The sum becomes an integral and the probabilities become a probability density function: E[X] = ∫ x × f(x) dx, integrated over the full range of possible outcomes. The intuition is identical - average over the distribution, weighted by probability density. In practice you rarely calculate the integral by hand; you use the known formula for the relevant distribution (normal, log-normal, exponential, etc.).
Q06Why does the formula multiply rather than add probability and value?
Because the probability is the weight applied to that outcome's value. "30% chance of £10" contributes £3 to the long-run average, not £10.30. Multiplication encodes the idea that an outcome that happens 30% of the time should count for 30% of its full value when you compute the average across many trials.