CCalclabhub

Statistics

How To Calculate Expected Value

Expected value is the long run average of a gamble. Weight every outcome by how likely it is, add the results, and you have the number that decides whether a bet is worth taking.

Quick Answer

E = p1 x x1 + p2 x2 + ... + pn x xn

E
The expected value, a long run average
xi
Each possible outcome, profit or loss
pi
The probability of that outcome, as a decimal
sum of pi
Must equal one, or the inputs are incomplete

Multiply each outcome by its probability and add every product. Outcomes of 100, 50, 0 and minus 20 with probabilities of 25, 40, 25 and 10 percent give 25 plus 20 plus 0 minus 2, an expected value of 43.

What Is Expected Value?

The expected value of a random quantity is the probability weighted average of everything that could happen. It is the number you would converge on if you repeated the same gamble a very large number of times.

It is not a forecast of what will happen next. A single play of a game returns one of the listed outcomes, and the expected value may not even be a value the game can actually pay out.

The formula is a sum of products. Take each outcome, multiply it by the chance of that outcome, and add every product together. Nothing in the calculation cares about the order of the outcomes.

Probabilities have to add up to one. If they do not, some outcome has been left out of the list, and the expected value is computing the average of a partial world.

Outcomes can be negative. A loss, a cost or a penalty enters the sum as a negative number, which is what makes an unfair game show up as a negative expected value.

The classic fair game has an expected value of zero. Pay 10 to play, win 50 with a one in five chance and nothing otherwise, and the expected return is exactly the 10 it cost, so neither side has an edge.

Casinos and lotteries run on negative expected value. The prize structure is fixed so that the average payout per ticket is less than the price, and the gap is the house margin.

Insurance is the mirror image. The insurer prices the premium above the expected claim, so the expected value is positive for the insurer and negative for the buyer, and that gap pays for the transfer of risk.

Expected value alone ignores risk. Two bets can share an expected value of 43 while one pays 43 every time and the other pays 1000 or loses 900, and most people would not treat those as the same decision.

That is why the variance of the distribution matters. The variance is the probability weighted average of the squared distance from the expected value, and its square root is the standard deviation.

The law of large numbers is what makes the number useful. Averaged over enough trials, the sample mean converges on the expected value, which is why casinos are confident and individual gamblers are not.

Decision theory pairs the expected value with a utility function. A loss that would ruin you is worse than the raw number suggests, so the expected value is an input to the decision rather than the decision itself.

The St Petersburg game is the famous stress test. Its expected value is infinite because of an extremely unlikely enormous payout, yet nobody would pay much to play it, which shows the limits of the number.

Small errors in the probabilities move the answer a long way. A one percentage point shift on a large payout can swing the expected value more than a large shift on a small one, so check the big outcomes first.

In business the same arithmetic is called expected monetary value. Multiply each scenario by its likelihood, add them up, and compare projects on a like for like basis.

Formula

E = p1 x x1 + p2 x2 + ... + pn x xn

Formula page →

Weight every outcome by its probability and add the products.

SymbolMeaning
EExpected value
xiOutcome
piProbability

Var = p1 x (x1 - E)^2 + ... + pn x (xn - E)^2

Formula page →

How far the outcomes scatter around the average, weighted by probability.

SymbolMeaning
VarVariance
EExpected value
xiOutcome

fair price = expected payout, so net expected value = expected payout - price

Formula page →

A game is fair when the price equals the expected payout, leaving a net of zero.

SymbolMeaning
pricePrice to play
payoutExpected payout
netNet expected value

How To Calculate Expected Value

  1. 1

    List every outcome with its probability

    Write down each result and how likely it is. Outcomes of 100, 50, 0 and minus 20 with probabilities of 25, 40, 25 and 10 percent cover the whole space.

  2. 2

    Check the probabilities add to one

    25 plus 40 plus 25 plus 10 is 100 percent. If the total falls short, an outcome is missing and the expected value will be wrong by exactly the unlisted part.

  3. 3

    Multiply each outcome by its probability

    100 times 0.25 is 25, 50 times 0.40 is 20, 0 times 0.25 is 0, and minus 20 times 0.10 is minus 2. These are each outcome's contribution.

  4. 4

    Add the contributions

    25 plus 20 plus 0 minus 2 is 43, the expected value. Compare it against the spread of 41.1218 to see how much of the story the average leaves out.

Examples

Example 1: Four outcomes of 100, 50, 0 and minus 20

First outcome
100
First probability
25
Second outcome
50
Second probability
40
Third outcome
0
Third probability
25
Fourth outcome
-20
Fourth probability
10
StepCalculationResult
Contribution of the first outcome100 x 0.2525
Contribution of the second outcome50 x 0.4020
Contribution of the loss-20 x 0.10-2
Sum of every contribution25 + 20 + 0 - 243

Result: The four weighted contributions are 25, 20, 0 and minus 2, giving an expected value of 43, and the standard deviation of 41.1218 shows the outcomes are spread almost as widely as that average.

Example 2: A raffle ticket costing 5 with a 1000 prize at 0.4 percent

First outcome
1000
First probability
0.4
Second outcome
0
Second probability
99.6
Third outcome
0
Third probability
0
Fourth outcome
0
Fourth probability
0
StepCalculationResult
Chance of winning as a decimal0.4 / 1000.004
Expected prize1000 x 0.0044
Cost of the ticket55
Net expected value per ticket4 - 5-1

Result: The expected prize is 4, so after paying 5 for the ticket the net expected value is minus 1 per ticket. Buy 1000 of them and the average loss is about 1000.

Calculator

Expected value

43

Variance of the outcomes
1,691
Standard deviation
41.1218
Total of the probabilities
100.00%
Best outcome
100
Worst outcome
-20

Values update as you type. This calculator covers the single scenario its formula assumes — see Common Mistakes for what it leaves out.

Prefer a full-width tool? Open the Expected Value calculator page.

Common Mistakes

  • Letting the probabilities fail to add to one

    A list that adds to 90 percent has lost 10 percent of the world. The expected value then describes only the part you remembered to write down.

  • Entering percentages as whole numbers

    25 percent is 0.25 in the formula. Multiplying by 25 instead inflates the expected value a hundred fold, from 43 to 4300.

  • Leaving the losses out

    Negative outcomes carry negative weight. Dropping the minus 20 at 10 percent raises the expected value from 43 to 45, hiding the real downside.

  • Treating the expected value as the likely result

    It is a long run average, not a prediction. A game can have an expected value of 43 and never pay 43 in a single play.

  • Ignoring the spread

    Two gambles can share an expected value and differ enormously in risk. Check the standard deviation before deciding, especially when a loss would be hard to absorb.

  • Mixing gross payout with net result

    Subtract the cost to play before interpreting the number. An expected payout of 10 on a ticket that costs 10 is a fair game, not a profit.

FAQ

What is the expected value formula?

Multiply each outcome by its probability and add all the products. Probabilities are decimals, so 25 percent enters as 0.25.

Can an expected value be negative?

Yes. Any game where the average payout is below the price has a negative expected value, which is how lotteries and casino games make money.

What does an expected value of zero mean?

The game is fair. Over many plays you would break even on average, with no edge for either side.

How is expected value different from the average?

An average weights every observation equally, while an expected value weights each outcome by its probability. With enough trials the observed average converges on the expected value.

Do I need the variance as well?

Almost always. The expected value tells you the centre, and the variance tells you whether the outcomes cluster near it or swing wildly around it.

What happens if my probabilities add to more than 100 percent?

The inputs are contradictory, usually because two outcomes overlap or one was counted twice. Fix the list before trusting the result.

References

  1. [1]Wikipedia, Expected value — https://en.wikipedia.org/wiki/Expected_value
  2. [2]Wikipedia, Variance — https://en.wikipedia.org/wiki/Variance
  3. [3]Wikipedia, Law of large numbers — https://en.wikipedia.org/wiki/Law_of_large_numbers