Expected Value Probability Calculator

Mathematics · Statistics · Mean, variance and standard deviation of a discrete probability distribution

How to use it

  1. Enter each possible value of X in the left column and its probability, P(X), in the right column. One row per value.
  2. Need more values? Click + Add row. The × at the end of a row removes it.
  3. Probabilities can be decimals (0.25), fractions (1/4) or percents (25%). They must each be between 0 and 1 and add up to 1.
  4. Choose how many decimal places you want in the answer, then click Calculate.
  5. Read the answer box, then the step-by-step solution below it. Copy puts the whole solution on your clipboard as plain text, ready to paste into homework.

Not sure what a row means? X is the thing being counted or measured (number of heads, dollars won, people in line). P(X) is how likely that exact value is. The table starts filled with an example you can change or clear.

Calculator

X valueProbability, P(X)

What Expected Value Is

Notes · The long-run average of a random variable

The idea

A discrete random variable X is a quantity whose value depends on chance and can be listed: the number of heads in three coin flips, the number of customers in line, the dollars you win on a lottery ticket. Its probability distribution is the table of every value X can take alongside the probability of each one.

The expected value of X, written E(X) or μ, is the average you would get if you ran the random process over and over and averaged all the outcomes. It is a weighted average: each value counts in proportion to how likely it is, so a value with probability 0.40 pulls the average four times harder than one with probability 0.10.

μ = E(X) = Σ x · P(x)
How to compute it
How to read it
  1. List every value x and its probability P(x). Check that the probabilities add to 1.
  2. Multiply each value by its own probability.
  3. Add the products. That sum is E(X).

There is no dividing by the number of rows. The probabilities already do the weighting: a plain average would treat a rare outcome and a common one as equally important.

  • Balance point — E(X) is where the probability histogram would balance on a fingertip.
  • Not necessarily possible — the expected number of heads in three flips is 1.5, a value X can never equal.
  • Long run, not next time — it predicts the average over many repetitions, not the next single outcome.
  • Fair games — for winnings, E(X) = 0 means a fair game; E(X) < 0 means you lose money on average.

Where it shows up

  • Games and insurance — the expected payout tells a casino or an insurer what a bet or a policy costs on average.
  • Binomial distributions — for n trials with success probability p, the expected number of successes is simply μ = np.
  • Decisions — comparing the expected value of two choices is the usual starting point for choosing between risky options.
  • Sample means — the law of large numbers says a sample average gets closer to E(X) as the sample grows. That is why E(X) is also called the population mean.

Common mistakes

  • Dividing by n — after adding x · P(x) there is nothing left to divide. Dividing again is the most common error.
  • Probabilities that do not total 1 — if they do not, the table is not a probability distribution and the answer means nothing. Fix the table first.
  • Averaging the x values — (0 + 1 + 2 + 3) / 4 = 1.5 ignores the probabilities. The example in the calculator gives 1.7 once they are used.
  • Rounding early — keep full precision through the steps and round only the final answer.

Variance & Standard Deviation

Notes · How far the outcomes typically land from the mean

The idea

Two distributions can share the same expected value and behave completely differently. A game that always pays $5 and a game that pays $0 or $10 with equal odds both have E(X) = 5, but one is certain and the other is a coin flip. Variance and standard deviation measure that difference: how spread out the outcomes are around the mean.

The variance, Var(X) or σ2, is the expected value of the squared distance from the mean. Squaring keeps distances positive so that values above and below the mean do not cancel, but it leaves the answer in squared units (dollars squared, heads squared). The standard deviation, σ, is the square root of the variance, which puts the spread back in the same units as X. That is why σ is the number people actually quote.

Var(X) = σ2 = Σ (x − μ)2 · P(x)
Shortcut:   Var(X) = Σ x2 · P(x) − μ2      Standard deviation:   σ = √Var(X)
Definition formulaShows what variance means
Shortcut formulaFaster on a calculator
  1. Find the mean μ first.
  2. For each value, subtract the mean: x − μ.
  3. Square each difference.
  4. Multiply each square by its probability P(x).
  5. Add the results. That is Var(X).
  6. Square-root it for σ.

A table with columns x, P(x), x − μ, (x − μ)2 and (x − μ)2 · P(x) keeps the work tidy. The calculator builds that table for you.

  1. Find the mean μ.
  2. Square each value of x and multiply by its probability: x2 · P(x).
  3. Add those products to get E(X2).
  4. Subtract μ2. That is Var(X).
  5. Square-root it for σ.

Both formulas give exactly the same answer. The shortcut needs fewer subtractions but is more sensitive to rounding μ early, so carry extra decimals.

How to read the standard deviation

  • Small σ — outcomes cluster tightly around the mean; the result is predictable.
  • Large σ — outcomes swing far from the mean; the result is risky or variable.
  • σ = 0 — only one value has any probability. There is no randomness.
  • Same units as X — a standard deviation of 0.9 heads, or $12, can be pictured directly; a variance of 0.81 heads2 cannot.
  • Rule of thumb — for most distributions, the bulk of the outcomes fall within about two standard deviations of the mean.
  • Comparing choices — between two options with the same E(X), the one with smaller σ is the safer bet.

Common mistakes

  • Forgetting to square — Σ (x − μ) · P(x) is always 0, which is a sign something was skipped.
  • Forgetting − μ2 — in the shortcut, Σ x2 · P(x) alone is E(X2), not the variance.
  • Dividing by n − 1 — that is for the variance of a data sample. A probability distribution is already weighted by P(x); nothing is divided.
  • Square-rooting the wrong thing — σ is the root of the whole variance, not of each term.
  • Mixing up σ and σ2 — read the question. “Standard deviation” wants the root; “variance” does not.

Worked Example

The distribution the calculator opens with, solved in full

The problem

A random variable X takes the values 0, 1, 2 and 3 with the probabilities below. Find the expected value, the variance and the standard deviation of X.

x0123
P(x)0.100.300.400.20

Answer

Answer

E(X) = 1.7000

Variance, Var(X): 0.8100

Standard deviation, σ: 0.9000

The expected value of the discrete probability distribution is 1.7000.

Step-by-Step Solution

Step 1: Check the probabilities.

0.1 + 0.3 + 0.4 + 0.2 = 1

Step 2: Calculate the expected value.

E(X) = (0)(0.1) + (1)(0.3) + (2)(0.4) + (3)(0.2) = 1.7

Step 3: Calculate the variance.

Var(X) = (0 − 1.7)2(0.1) + (1 − 1.7)2(0.3) + (2 − 1.7)2(0.4) + (3 − 1.7)2(0.2) = 0.81

Step 4: Calculate the standard deviation.

σ = √0.81 = 0.9

Try it. Open the Calculator tab, change the probability of 3 from 0.20 to 0.40 and the probability of 0 from 0.10 to 0 (so the total stays 1), and watch E(X) and σ move. More weight far from the mean means a larger standard deviation.