Expected value calculator

Calculate expected value E[X], variance and standard deviation for a bet, game or decision from its outcomes and their probabilities or weights.

Drafted with AI writing toolsUpdated Checked examples: 4

Net result of each outcome, e.g. −5 for losing a $5 stake.
One per outcome, in the same order. Fractions such as 1/38 work.
Try
Expected value E[X]
Expected value E[X]: −1.5
Maximum decimal places: 6; Nearest, ties away from zero
Variance
127.75
Standard deviation
11.302655
Probability of a positive outcome
0.2
Worst outcome
−5
Best outcome
95

Over many repetitions this loses 1.5 per play on average. The standard deviation per play is 11.3; it measures spread, not a guaranteed range. The expected value is a long-run average. Outcomes with positive probability range from −5 to 95. The probability of coming out ahead is 20%.

Probability of each outcome

−5: 0.80.8−55: 0.150.15520: 0.040.042095: 0.010.0195
Outcomes Rows: 4
OutcomeProbabilityx × p(x − E)² × p
−50.8−49.8
50.150.756.3375
200.040.818.49
950.010.9593.1225
How it's calculated S
  1. Expected value

    E[X]=∑xipi=−5×0.8+5×0.15+20×0.04+95×0.01=−1.5E[X] = \sum x_i p_i = -5 \times 0.8 + 5 \times 0.15 + 20 \times 0.04 + 95 \times 0.01 = -1.5
  2. Variance

    Var⁡(X)=∑(xi−−1.5)2pi=127.75\operatorname{Var}(X) = \sum (x_i - -1.5)^2 p_i = 127.75
  3. Standard deviation

    σ=127.75=11.302655\sigma = \sqrt{127.75} = 11.302655

About the expected value calculator

Expected value is the probability-weighted average of the outcomes, E[X] = Σ xᵢpᵢ: what a bet, game or decision returns per play over many plays. The variance, Σ(xᵢ − E[X])²pᵢ, and its square root, the standard deviation, measure how far single results swing around that average. Counts or relative weights are rescaled to probabilities before the sums.

The default is a $5 scratch card that loses the stake with probability 0.8 and wins a net $5, $20 or $95 with probabilities 0.15, 0.04 and 0.01. Its expected value is −$1.50 per card, even though 20% of cards come out ahead.

Enter each outcome as a net result, winnings minus the stake: a lost $5 stake is −5 and a $100 prize on a $5 card is 95. The probabilities must add up to 1, or switch to counts and weights.

How to calculate expected value

Multiply each outcome by its probability and add the products: E[X] = Σ xᵢpᵢ. A $5 scratch card that loses the stake with probability 0.8 and wins a net $5, $20 or $95 with probabilities 0.15, 0.04 and 0.01 has E = −4 + 0.75 + 0.8 + 0.95 = −$1.50 per card.

Worked by hand:

  1. Write every outcome as a net result, winnings minus the stake: −5, 5, 20 and 95.
  2. Multiply each by its probability: −5 × 0.8 = −4, 5 × 0.15 = 0.75, 20 × 0.04 = 0.8 and 95 × 0.01 = 0.95.
  3. Add the products: −4 + 0.75 + 0.8 + 0.95 = −1.5.

The card returns −30% of its price on average, so 100 cards are expected to lose $150. For a fair six-sided die, E = (1 + 2 + 3 + 4 + 5 + 6) ÷ 6 = 3.5.

Expected value is not the likely result

Expected value is a long-run average per play, and it may not be a possible result at all: no die roll shows 3.5. The scratch card's most likely outcome is losing the full $5, which happens 80% of the time.

Yet 20% of cards come out ahead, since 0.15 + 0.04 + 0.01 = 0.2. In a skewed payoff like this, a few large prizes pull the average above the typical result. A break-even outcome of 0 counts as neither a gain nor a loss.

Variance and standard deviation of an outcome

The spread around the average is Var(X) = Σ (xᵢ − E[X])² pᵢ, and the standard deviation is its square root. For the scratch card, the four terms are 9.8, 6.3375, 18.49 and 93.1225, so the variance is 127.75 and the SD is $11.30.

This is the variance of a stated distribution, so it has no n − 1 correction. It is in squared units, square dollars here, while the SD is back in dollars.

Over many independent plays, the expected total grows with the number of plays and the SD with its square root. 100 cards have an expected total of −$150 with an SD of 11.30 × √100 = $113, so some buyers of 100 cards still come out ahead.

House edge: roulette as an example

A single-number roulette bet pays 35 to 1. On an American wheel with 38 pockets, the expected value per $1 is 35 × 1/38 − 1 × 37/38 = −2/38 = −$0.0526, a house edge of 5.26%.

A European wheel has 37 pockets, so the value is (35 − 36) ÷ 37 = −1/37, an edge of 2.70%. Almost every other American bet has the same 5.26% edge.

Why the highest expected value is not always best

A sure $50 and a 50% chance of $100 both have an expected value of 50, but their standard deviations are 0 and 50. Which one is better depends on how much risk you can carry.

Insurance has a negative expected value for the buyer, yet it is rational when it removes a loss the buyer could not absorb. Expected utility theory (von Neumann and Morgenstern, 1944) formalizes that trade-off.

Expected value examples

ScenarioExpected valueStandard deviation
Default-1.50000011.302655
Fair die3.5000001.707825
Sure fifty50.0000000.000000
Risky fifty50.00000050.000000
Zero weight5.0000000.000000

"Default" is the scratch card and "Fair die" the values 1 to 6 with equal weights. "Sure fifty" is 50 with probability 1, and "Risky fifty" is 0 or 100 at 50% each.

"Zero weight" lists −100, 5 and 500 with probabilities 0, 1 and 0. Outcomes with zero probability cannot happen, so the worst and best outcomes are both 5.

Probabilities or weights

  • Probabilities must each lie between 0 and 1 and add to 1, within 10⁻⁹. Fractions such as 1/38 work.
  • Counts or weights are divided by their total, so 80, 15, 4 and 1 give the same distribution as 0.8, 0.15, 0.04 and 0.01.
  • Outcomes and probabilities pair by position. The two lists need the same length, in the same order.

Mistakes that change the answer

  • Mixing gross and net payouts. Entering the card's prizes as gross 10, 25 and 100 next to a net loss of −5 gives −$0.50 instead of −$1.50.
  • Entering percentages as probabilities. 80, 15, 4 and 1 are weights, not probabilities.
  • Leaving out an outcome. Correct arithmetic on an incomplete list of results still gives the wrong average.

NIST sets out what makes a valid probability distribution, and Grinstead and Snell, chapter 6, develop expectation and variance.

To turn a bookmaker's price into the probability it implies, use the odds converter. For outcome probabilities from a binomial or Poisson model, use the binomial and Poisson distribution calculator.

Worked examples

$5 scratch card (defaults)

Outcomes (values or payoffs)
-5, 5, 20, 95
Probabilities
0.8, 0.15, 0.04, 0.01
Second list holds
Probabilities (sum to 1)
Expected value E[X]
-1.5
Variance
127.75
Probability of a positive outcome
0.2

Checked against: Hand calculation: −4 + 0.75 + 0.8 + 0.95 = −1.5; Σp(x − μ)² with exact fractions = 127.75

American roulette, single-number bet

Outcomes (values or payoffs)
35, -1
Probabilities
1/38, 37/38
Second list holds
Probabilities (sum to 1)
Expected value E[X]
-0.052632

Checked against: House edge of a straight-up bet: −2/38 = −5.26% (standard roulette tables)

Fair die

Outcomes (values or payoffs)
1 2 3 4 5 6
Probabilities
1 1 1 1 1 1
Second list holds
Counts or weights
Expected value E[X]
3.5
Variance
2.916667

Checked against: E = 7/2 and Var = 35/12 for a fair die

Edge case: a certain outcome

Outcomes (values or payoffs)
42
Probabilities
1
Second list holds
Probabilities (sum to 1)
Expected value E[X]
42
Variance
0
Standard deviation
0

Checked against: A single outcome with probability 1 has no spread

Questions

How do you calculate expected value?

Multiply each outcome by its probability and add the products: E[X] = Σ xᵢpᵢ. For a fair six-sided die, E = (1 + 2 + 3 + 4 + 5 + 6) × 1/6 = 3.5. For the default scratch card, −5 × 0.8 + 5 × 0.15 + 20 × 0.04 + 95 × 0.01 = −1.5, a loss of $1.50 per $5 card on average.

What does a negative expected value mean?

The bet loses money on average per play. The −$1.50 scratch card returns −30% of its $5 price, so 100 cards are expected to lose $150. Single results vary: with a standard deviation of 11.30 per card, the total over 100 independent cards has a standard deviation of 11.30 × √100 = 113, so some buyers of 100 cards still come out ahead.

What is the house edge in roulette?

5.26% on an American double-zero wheel and 2.70% on a European single-zero wheel. A single-number bet pays 35 to 1. With 38 pockets, the expected value per unit staked is (35 − 37)/38 = −2/38 = −0.0526; with 37 pockets it is (35 − 36)/37 = −1/37 = −0.0270. Almost every other American bet has the same 5.26% edge.

Is expected value the most likely outcome?

No. It is a long-run average and may not be a possible result at all: a die's expected value is 3.5, which no roll shows. The scratch card's expected value is −1.5, but its most likely outcome is losing the full $5, which happens 80% of the time. In a skewed payoff like this, a few large prizes pull the average above the typical result.

Is the option with the highest expected value always the best choice?

Not always, because expected value ignores risk. A sure $50 and a 50% chance of $100 both have an expected value of 50, but standard deviations of 0 and 50. Insurance has a negative expected value for the buyer yet is rational when it removes a loss the buyer could not absorb. Expected utility theory (von Neumann and Morgenstern, 1944) formalizes this trade-off.

About this calculator

E[X]=∑ixi pi,Var⁡(X)=∑i(xi−E[X])2 piE[X] = \sum_i x_i\,p_i,\qquad \operatorname{Var}(X) = \sum_i (x_i - E[X])^2\,p_i

Sources

  1. Grinstead & Snell, Introduction to Probability (AMS), chapter 6 Expected value and variance
  2. NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.6.1 What is a probability distribution

Checked against references

This calculator includes 4 worked examples with independently sourced answers. They run in the test suite, and you can run them here too.

Put this calculator on your site

Paste this where you want the calculator to appear. It is free to use, it stays in step with corrections made here, and the credit line below it links back so your readers can find the full version.

Height
Preview the embed

Keep the credit line. It is the only condition, and it is what keeps these calculators free.