Expected Value Calculator (Free, Step-by-Step)

StatisticsFreeNo sign-up

An expected value calculator finds the long-run average of a random variable: multiply each outcome by its probability and add, E(X) = Σ x·P(x). For outcomes 0, 1, 2, 3 with probabilities 0.1, 0.3, 0.4, 0.2, E(X) = 0 + 0.3 + 0.8 + 0.6 = 1.7. Enter your own table below to get E(X), the variance, the standard deviation and every step.

Expected value calculator
Value xProbability P(x)
Probabilities can be decimals (0.25), fractions (1/6), percents (25%) or odds like 1 in 6. They must add up to 1. Leave one probability blank and it gets whatever is left.
Try:
Expected value E(X)
E(X) = 1.7

The expected value is 1.7: over many repetitions, the average outcome settles near 1.7. Outcomes typically land within about 0.9 (one standard deviation) of it.
Expected value μ = E(X)1.7
Variance σ²0.81
Standard deviation σ0.9
E(X²)3.7
E(X) as a fraction17/10
Variance as a fraction81/100
Probability distribution of X

Bar chart of the probability of each value, with the expected value marked by a dashed line and one standard deviation either side shaded.00.150.300.450.600.10.30.40.20123Value x (sorted, evenly spaced)

P(x)Expected value μ = 1.7μ ± σ
Show steps
  1. Check that the probabilities add up to 1: 0.1 + 0.3 + 0.4 + 0.2 = 1.
  2. Multiply each value by its probability and add: E(X) = Σ x·P(x) = (0)(0.1) + (1)(0.3) + (2)(0.4) + (3)(0.2).
  3. The products are 0, 0.3, 0.8, 0.6. Their sum is E(X) = 1.7 (exactly 17/10).
  4. Variance: square each distance from the mean and weight it by its probability. σ² = Σ (x − μ)²·P(x) = 0.81. Shortcut check: E(X²) − μ² = 3.7 − 2.89 = 0.81.
  5. Standard deviation: σ = √σ² = √(81/100) ≈ 0.9.
All sums are done with exact fractions, so fractions like 1/3 or 1 in 6 introduce no rounding error. Results are rounded only for display (4 decimals).
Table of contributions
x P(x) x·P(x) (x − μ)²·P(x)
0 0.1 0 0.289
1 0.3 0.3 0.147
2 0.4 0.8 0.036
3 0.2 0.6 0.338
Total 1 1.7 0.81
The x·P(x) column adds up to E(X) and the last column adds up to the variance σ².

Expected Value Calculator (Free, Step-by-Step)
Embed this calculator on your site

Free to use on class pages, blogs and course pages. Copy the code below and paste it into your page:

How to use the expected value calculator

  1. Pick the input type. Probabilities takes each value with its probability. Frequencies takes each value with how many times it happened. Game or bet takes the cost to play and each prize with its chance.
  2. Type the values. Probabilities can be decimals (0.25), fractions (1/6), percents (25%) or odds such as 1 in 6. Leave one probability blank and the calculator fills it with whatever is left so the total is 1.
  3. Read E(X) at the top, then the variance, standard deviation and E(X²). Open Show steps for the full working and Table of contributions to see how much each outcome adds.

The calculator checks that the probabilities add up to exactly 1. If they add up to something like 0.999 because you rounded 1/3 to 0.333, it tells you and scales them; anything further from 1 is flagged so you can fix it. All arithmetic uses exact fractions, so 1/3 or 1 in 6 cause no rounding error.

Expected value formula

For a discrete random variable X that takes values x1, x2, …, xn with probabilities P(x1), P(x2), …, P(xn):

E(X) = μ = x1P(x1) + x2P(x2) + … + xnP(xn) = Σ x·P(x)

  • x is one possible outcome (a score, a payout, a count).
  • P(x) is the probability of that outcome. Every P(x) is between 0 and 1, and together they add up to 1.
  • μ (mu) is another name for the expected value, the mean of the distribution.

The spread around the mean is measured by the variance, σ² = Σ (x − μ)²·P(x), which also equals E(X²) − μ². The standard deviation is σ = √σ², in the same units as X. Expected value is a weighted average: the probabilities are the weights.

With frequencies instead of probabilities, divide each frequency by the total N first: P(x) = f / N. The calculator also shows the sample variance, which divides by N − 1, for when your counts are a sample from a larger population.

Expected value examples

Example 1: a fair die

Each face 1 to 6 has probability 1/6. E(X) = (1 + 2 + 3 + 4 + 5 + 6) × 1/6 = 21/6 = 3.5. You can never roll 3.5, but the average of many rolls settles near it. E(X²) = 91/6, so the variance is 91/6 − 3.5² = 35/12 ≈ 2.9167 and the standard deviation is about 1.7078.

Example 2: a raffle ticket

A ticket costs $5. One prize of $500 has a 1 in 1,000 chance and a $100 prize has a 1 in 500 chance. The expected payout is 500 × 0.001 + 100 × 0.002 = $0.70, so the expected net gain is $0.70 − $5 = −$4.30 per ticket. Buying 100 tickets you would expect to be down about $430. A negative expected value means the game favors the seller.

Example 3: insurance

A policy costs $750 a year. It pays $20,000 with probability 1 in 50 and $5,000 with probability 1 in 25. Expected payout: 20,000 × 0.02 + 5,000 × 0.04 = 400 + 200 = $600. For the buyer the expected value is $600 − $750 = −$150 a year; for the insurer it is +$150. People still buy insurance because it limits a large loss, which is a question about risk (the standard deviation), not only about the average.

Example 4: roulette

On an American wheel, a $1 bet on red wins with probability 18/38 and pays $1 profit; otherwise you lose $1. E(X) = 1 × 18/38 + (−1) × 20/38 = −2/38 ≈ −$0.0526, a house edge of about 5.26%.

Expected value quick reference

Situation E(X) Variance
One fair die 3.5 35/12 ≈ 2.9167
Sum of two fair dice 7 35/6 ≈ 5.8333
Heads in one coin flip 0.5 0.25
Bernoulli trial with success chance p p p(1 − p)
Binomial, n trials, chance p np np(1 − p)
$1 on red, American roulette −$0.0526 about 0.9972
$1 on red, European roulette (18/37) −$0.0270 about 0.9993

Rules that make expected value easier

  • Linearity: E(aX + b) = a·E(X) + b. Doubling every payout doubles the expected value; adding a $2 fee lowers it by $2.
  • Sums: E(X + Y) = E(X) + E(Y), even when X and Y are not independent. That is why two dice average 3.5 + 3.5 = 7.
  • Variance scaling: Var(aX + b) = a²·Var(X). Adding a constant does not change the spread.
  • Repeated plays: over n independent plays the expected total is n·E(X) and the standard deviation of the total is √n·σ. The calculator shows both in Game mode.

Checking homework with the expected value calculator

Work the problem by hand first: list the outcomes, check that the probabilities add to 1, multiply and add. Estimate before you calculate; E(X) must lie between the smallest and largest outcome. Then enter the same table and compare each line of Show steps with yours. The table below lists the slips we see most often.

Mistake How to catch it
Probabilities do not add up to 1 Add them first; a missing outcome (such as “win nothing”) is the usual cause.
Using the prize instead of the net gain Subtract the cost from every outcome, including the losing one.
Rounding 1/3 to 0.33 too early Keep fractions until the end; the calculator accepts them.
Forgetting to square in the variance Variance is never negative; if you got a negative number, a square is missing.
Confusing variance and standard deviation Standard deviation is in the units of X; variance is in squared units.
Expecting E(X) to be a possible outcome It is an average; a die never shows 3.5.

Expected value practice quiz: 10 questions

Test yourself with 10 multiple-choice questions. Choose an answer and press Submit to see if you are right and why. Your score appears at the end.

Question 1 of 10
1. X takes the values 2, 4 and 6 with probabilities 0.5, 0.3 and 0.2. What is E(X)?

Found a mistake? Let us know!

2. What is the expected value of one roll of a fair six-sided die?

Found a mistake? Let us know!

3. A table lists P(0) = 0.2, P(1) = 0.5 and P(2) = k. What must k be?

Found a mistake? Let us know!

4. A $2 ticket wins $50 with probability 0.02 and nothing otherwise. What is the expected net gain per ticket?

Found a mistake? Let us know!

5. X is 0 or 10, each with probability 1/2. What is the variance of X?

Found a mistake? Let us know!

6. If E(X) = 4, what is E(3X + 2)?

Found a mistake? Let us know!

7. A random variable has E(X) = 3 and E(X²) = 13. What is its standard deviation?

Found a mistake? Let us know!

8. Scores 1, 2 and 3 occur 5, 3 and 2 times. What is the expected value (mean) of the score?

Found a mistake? Let us know!

9. On an American roulette wheel, a $1 bet on red wins $1 with probability 18/38 and loses $1 otherwise. What is the expected value of the bet, to the nearest cent?

Found a mistake? Let us know!

10. What does an expected value of 0 mean for a game with a cost to play?

Found a mistake? Let us know!

Frequently asked questions

What is expected value?

Expected value is the long-run average of a random variable. If you repeat the same random experiment many times, the average of the results gets closer and closer to E(X). It is found by multiplying each outcome by its probability and adding the products.

How do you calculate expected value?

List every outcome and its probability, check that the probabilities add up to 1, multiply each outcome by its probability, then add the products. For a $10 prize with probability 0.2 and $0 with probability 0.8, E(X) = 10 × 0.2 + 0 × 0.8 = $2.

Can expected value be negative?

Yes. When outcomes are gains and losses, a negative expected value means you lose money on average, as with most lottery tickets and casino bets. An expected value of 0 is called a fair game.

How do you find expected value on a graphing calculator?

On a TI-84, press STAT, then Edit, and type the values in L1 and the probabilities in L2. Then choose STAT, CALC, 1-Var Stats with List: L1 and FreqList: L2. The mean x̄ shown is E(X), and σx is the standard deviation.

Can you find expected value for a continuous distribution?

Yes, but it uses an integral instead of a sum: E(X) = ∫ x·f(x) dx, where f is the density. For a uniform distribution from a to b this gives (a + b) / 2. This calculator handles discrete distributions, where you can list the outcomes.

How do you find expected values in a chi-square test?

That is a different idea with a similar name. In a contingency table the expected count for a cell is (row total × column total) / grand total. With a row total of 40, a column total of 50 and a grand total of 200, the expected count is 10.

Related calculators

More statistics calculators

Browse all 541 calculators

Related to This Article

What people say about "Expected Value Calculator: E(X), Variance, SD with Steps"?

No one replied yet.

Leave a Reply