Skip to content
PercentPoint

Expected Value Calculator

Enter the possible outcomes of a discrete random variable and their probabilities to get the expected value (the long-run mean), the variance and the standard deviation, with a step-by-step table you can copy into homework or a report.

For planning only. Your school, syllabus or accountant has the final word. First published · Last reviewed by PercentPoint.

How to use the expected value calculator

  1. List the outcomes. Type the values of x separated by commas: counts, scores, or amounts gained and lost. Use a minus sign for losses.
  2. List the probabilities in the same order. Decimals (0.25), percentages (25%) and fractions (1/4) all work. They must add up to 1.
  3. Or use counts. If you have frequencies instead of probabilities, such as 2, 11 and 23 families out of 50, switch on “Treat as counts or weights” and the calculator divides each by the total.

The calculator opens on Example 4.3 from OpenStax’s Introductory Statistics 2e: a soccer team plays 0, 1 or 2 days a week with probabilities 0.2, 0.5 and 0.3. The expected value is 1.1 days per week.

The expected value formula

For a discrete random variable X, the expected value, also called the mean μ, multiplies each outcome by its probability and adds the products:

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

For the soccer team: 0 × 0.2 + 1 × 0.5 + 2 × 0.3 = 0 + 0.5 + 0.6 = 1.1.

The table under the inputs shows each product x · P(x) and the running total, so you can see which outcomes contribute most. An outcome with a large value but a tiny probability can move the mean as much as a common outcome with a modest value.

Before using the formula, check that you have a valid probability distribution. Section 4.1 of the textbook gives two conditions: each probability is between 0 and 1, and the probabilities add up to 1. The calculator reports an error when either fails, rather than giving a misleading mean.

What “expected” means

The expected value is a long-term average. The textbook ties it to the law of large numbers: as the number of trials grows, the average of the observed outcomes gets closer to μ.

It need not be a possible outcome. No team plays 1.1 days in a week, just as no family has 2.4 children. It describes what happens on average over many weeks. Over 100 weeks, you would expect the team to play about 110 days in total, though any single week will be 0, 1 or 2.

A fair six-sided die is a familiar example: (1 + 2 + 3 + 4 + 5 + 6) ÷ 6 = 3.5. No roll shows 3.5, but the average of many rolls settles near it.

Variance and standard deviation

The expected value says where outcomes center; the standard deviation says how far they typically fall from that center. For a discrete distribution:

σ² = Σ (x − μ)² · P(x)    σ = √σ²

Example 4.4 counts how many times a newborn’s crying wakes its parents after midnight in a week, from a survey of 50 families: 0 to 5 times, with 2, 11, 23, 9, 4 and 1 families. The mean is μ = 2.1 wakings a week. The variance is 1.05 and the standard deviation is about 1.02. Pick the “Newborn wakings” example to see each (x − μ)² · P(x) term.

Two distributions can share a mean but differ in spread. A choice that pays a certain 5 and one that pays 0 or 10 with equal chances both have an expected value of 5, but the second has a standard deviation of 5, the first of 0.

Gains and losses

Expected value is the standard way to judge a game of chance or any repeated decision with money at stake. Use positive values for gains and negative values for losses.

In Example 4.6, you toss a biased coin with P(heads) = 2/3. Heads, you pay $6; tails, you win $10. The expected value is 10 × 1/3 + (−6) × 2/3 = 10/3 − 12/3 = −2/3, a loss of about 67 cents per game on average. The textbook’s conclusion: if you play many times, you lose money. Choose “Biased coin bet” to check it.

The textbook’s lottery exercise makes the same point at larger scale: once the ticket price is counted, the expected value of a typical lottery ticket is close to −$1. A negative expected value means the game is designed to take more than it pays out over time, which is how games of chance stay in business.

The same reasoning applies to decisions like whether to buy an extended warranty: multiply each possible cost by its probability, and compare the totals.

Building a distribution from scratch

Sometimes you have to work out the probabilities first. In Example 4.7, a fair die is tossed twice and X counts the faces showing an even number. Listing the 36 equally likely outcomes gives P(0) = 9/36, P(1) = 18/36 and P(2) = 9/36. Enter 0, 1, 2 with 1/4, 1/2, 1/4 to get μ = 1 and σ ≈ 0.7071. The probability calculator can help with the counting step.

Expected value as a weighted average

The formula is a weighted average with the probabilities as weights. That is why the weights switch works: a course grade with homework at 20%, quizzes at 30% and the final at 50%, and scores of 80, 90 and 70, is 80 × 0.2 + 90 × 0.3 + 70 × 0.5 = 16 + 27 + 35 = 78. Enter the scores as outcomes and the weights as probabilities to check.

If you enter counts, such as 2, 11, 23, 9, 4 and 1 families from the newborn example, the calculator divides by the total of 50 first. The result is the same mean you would get by averaging all 50 individual answers, which is what the average calculator does with raw data.

Step by step with the table

  1. Check the distribution: every P(x) between 0 and 1, total 1.
  2. Multiply: fill the x · P(x) column.
  3. Add: the column total is μ.
  4. Spread: for each row compute (x − μ)² · P(x), add them for the variance, and take the square root for σ.

Limits of expected value

Expected value describes the long run. For a decision you face only once, the spread matters too: a choice with a slightly higher mean but a real chance of a large loss may not suit you. That is why the calculator reports the standard deviation next to the mean. The probabilities are also only as good as their source; an estimate built on guessed probabilities is a guess.

Sources & assumptions

How this calculator gets its numbers. Full method: our methodology.

  • E(X) = Σ x·P(x); variance = Σ (x − μ)²·P(x); standard deviation = √variance.
  • Probabilities must add to 1 (within 0.000001) unless they are treated as counts or weights and divided by their total.
  • Outcomes and probabilities are paired by position in the two lists.

Sources

  1. OpenStax (Rice University), Introductory Statistics 2e, 4.2 Mean or Expected Value and Standard Deviation. μ = Σ x·P(x) and σ = √Σ (x − μ)²·P(x); Example 4.3 (μ = 1.1), Example 4.4 (μ = 2.1), Example 4.6 (μ = −2/3) and Example 4.7 (two dice).
  2. OpenStax (Rice University), Introductory Statistics 2e, 4.1 Probability Distribution Function (PDF) for a Discrete Random Variable. A discrete probability distribution has probabilities between 0 and 1 that add up to 1.

Last reviewed . For the probability of combined events or repeated trials, use the probability calculator.

Frequently asked questions

How do I calculate expected value?

Multiply each outcome by its probability and add the products: E(X) = Σ x · P(x). For outcomes 0, 1, 2 with probabilities 0.2, 0.5, 0.3, E(X) = 1.1.

Can the expected value be a number that can’t happen?

Yes. It is a long-run average, so a die’s expected value is 3.5 even though no roll shows 3.5.

What does a negative expected value mean?

On average, each play loses that amount. A game with an expected value of −2/3 dollar loses about 67 cents per play over many plays.

What if my probabilities don’t add up to 1?

Then it isn’t a valid probability distribution; check for a missing outcome or a typo. If the numbers are counts or frequencies, switch on the weights option to divide each by the total.

How do I find the standard deviation of a probability distribution?

Compute Σ (x − μ)² · P(x) to get the variance, then take the square root.

Is expected value the same as the mean?

Yes. For a probability distribution, the expected value is the mean μ of the random variable.