Category

Expected Value Calculator — E(X), Variance and Standard Deviation

Free expected value calculator. Enter values and probabilities as decimals, percentages or fractions and get E(X), the variance, the standard deviation and a term-by-term table. Handles dice rolls, bets with a house edge, both measurement systems and 24 currencies.

0 calculations

Calculation Parameters

One outcome per line: the value, then its probability.

Enter your outcomes

Fill in the form on the left to get the expected value, the spread around it and the full term-by-term working.

If "How to calculate expected value?" is the question that's troubling you, here is the solution — the expected value calculator. Simply input the values and their probabilities and it will do the rest. If you're not yet very familiar with what probabilities are, it's worth visiting a probability calculator first.

From the text below you can learn the expected value formula, the expected value definition, and how to find expected value by hand.

What is the expected value?

The expected value is an approximation of the mean of a random variable — a prediction of what an average would equal if we were to repeat the experiment many times. For example, if we were to roll a die a thousand times, what would be the most likely average of the outcomes? That number is the expected value.

💡 The expected value of a random variable is the theoretical counterpart of the average of a sample. The average changes every time you collect a new sample; the expected value does not, because it is a property of the distribution itself rather than of any particular set of observations.

Expected value formula

Mathematically speaking, the expected value of a random variable X is the sum of each possible value x of X, multiplied by the probability of that value, P(x).

Have a look at the expected value formula:

E(X) = x₁ · P(x₁) + x₂ · P(x₂) + … + xₙ · P(xₙ)

where P(xᵢ) is the probability of the value xᵢ occurring (i = 1, …, n) and n is the number of all possible values assumed by our random variable. Written with the summation sign, the same thing is:

E(X) = Σ xᵢ · P(xᵢ)

Two conditions have to hold for this to be an expected value at all: every probability must be between 0 and 1, and they must add up to exactly 1. If they add up to something else, the sum above is just a weighted total and not an expectation — the calculator says so plainly instead of quietly rescaling behind your back.

The calculator also reports the spread around that centre, because an expected value on its own says nothing about how far a single outcome is likely to stray from it:

Var(X) = Σ P(xᵢ) · (xᵢ − μ)²  =  E(X²) − μ²
σ = √Var(X)

Note that the variance carries the square of the unit of your data — if the outcomes are in centimetres, the variance is in cm² and only the standard deviation σ is back in centimetres.

How to use the expected value calculator?

  1. Pick a mode. Values and probabilities is the general case; Dice roll handles any number of dice with any number of sides; Bet, lottery or game works with money and subtracts your stake.
  2. Enter one outcome per line as value: probability. A colon, an equals sign, a comma, a vertical bar or plain whitespace all work as the separator. Probabilities may be written as decimals (0.25), percentages (25%) or fractions (1/6).
  3. Choose how the second column is written — decimals, percentages, or relative weights. Weights are handy when you know the counts but not the probabilities: 1, 3, 1 is read as 20%, 60%, 20%.
  4. Pick a unit if your outcomes carry one. Both measurement systems are supported — metric (mm, cm, m, km, g, kg, t, ml, l, °C, km/h, m/s) and US customary (in, ft, yd, mi, oz, lb, ton, fl oz, pt, qt, gal, °F, mph, ft/s) — and the result is restated in the other system automatically. Seconds, minutes, hours and days appear in both lists because they are the same quantity either way, and nothing is converted for them. For money there are 24 currencies, led by the US dollar and the Russian ruble.
  5. Set the number of repetitions to see what the experiment adds up to in the long run, and how tightly the average of those repetitions closes in on the expected value.

The result panel shows the expected value, the variance and standard deviation, the most likely outcome, the median, a term-by-term table where the last column literally adds up to E(X), and a chart of the distribution with E(X) marked on it.

How to calculate the expected value? — examples

Example 1 — a fair six-sided die

Every face has probability 1/6, so:

E(X) = 1·(1/6) + 2·(1/6) + 3·(1/6) + 4·(1/6) + 5·(1/6) + 6·(1/6) = 21/6 = 3.5

The expected value is 3.5 — a number the die can never actually show. That is not a mistake: the expected value is the long-run average of the rolls, not a prediction of any single roll. The variance is 35/12 ≈ 2.9167, so the standard deviation is about 1.71.

Example 2 — a simple money game

You win $10 with probability 0.3 and lose $5 with probability 0.7:

E(X) = 10 · 0.3 + (−5) · 0.7 = 3 − 3.5 = −$0.50

Every play costs you 50 cents on average. Over 100 plays you would expect to be about $50 down — although with a standard deviation of about $6.87 per play, a single evening can easily go the other way.

Example 3 — a single number at European roulette

A $1 chip on one number of a 37-pocket wheel returns $36 with probability 1/37 and nothing otherwise:

Outcome Payoff Probability Contribution
Your number$36.001/37 = 2.70%$0.972973
Any other$0.0036/37 = 97.30%$0.00
Total100.00%$0.972973

The expected payoff is $0.972973, and after subtracting the $1 stake the expected value of the bet is −$0.027027 per spin. That is a return to player of 97.30% and a house edge of exactly 1/37 = 2.70% — the well-known figure for European roulette. Across 100 spins you would expect to be about $2.70 down.

Example 4 — the sum of two dice

With 2d6 the expected total is 2 × 3.5 = 7, which here is a reachable outcome, and it is also the most likely one with probability 6/36 = 16.67%. The variance of a sum of independent dice is the sum of their variances, 2 × 35/12 = 35/6 ≈ 5.83, so σ ≈ 2.42.

Example 5 — outcomes that carry a unit

A forecast gives 0 mm of rain with probability 0.5, 5 mm with probability 0.3 and 20 mm with probability 0.2:

E(X) = 0·0.5 + 5·0.3 + 20·0.2 = 5.5 mm  (0.2165 in)
σ     = 7.5664 mm  (0.2979 in)

Both figures convert cleanly because millimetres and inches share a zero point. Temperature does not: a mean of 20 °C is 68 °F, but a standard deviation of 3 °C is 5.4 °F, not 37.4 °F. A spread is a difference, so only the scale factor applies to it and the +32 offset drops out. The calculator handles this for you.

FAQs

What is the expected value in simple terms?

It is the average outcome you would see if you could repeat a random experiment endlessly. Each possible value is weighted by how likely it is, and the weighted values are added together.

Can the expected value be a number that never occurs?

Yes, and it very often is. The expected value of a fair die is 3.5, which no face shows. The expected number of children per family might be 1.8. The expected value is a centre of mass, not a possible outcome.

Do the probabilities have to add up to 1?

Yes. If they don't, you have either missed an outcome or made an arithmetic slip, and the weighted sum is not an expected value. Switch the second column to relative weights if you only know the counts — the calculator will convert them into probabilities for you.

What is the difference between the expected value and the mean?

The expected value is a property of the theoretical distribution and never changes. The mean (or average) is computed from a finite sample of actual observations and changes from sample to sample. As the sample grows, its mean converges on the expected value — that is the law of large numbers.

How do I find the expected value of a bet?

Take the expected payoff and subtract what the bet costs you: EV = E(payoff) − stake. A negative result means the bet loses money on average. Dividing the loss by the stake gives the house edge.

Does a positive expected value guarantee a profit?

No. It only says the average result is favourable in the long run. The standard deviation tells you how wide the swings around that average are, and a run of bad luck can easily last longer than your bankroll.

Can the expected value be negative?

Certainly — any bet with a house edge has a negative expected value, and so does any random variable whose outcomes are mostly losses.

What is E(X²) used for?

It is the second moment of the distribution, and it is the quickest route to the variance: Var(X) = E(X²) − μ². The calculator computes the variance directly from the squared deviations instead, which stays accurate even when the values are large and close together, and reports E(X²) alongside it.

Calculation History

Loading...