Expected Value Calculator

Find the expected value (mean) of a discrete random variable from its outcomes and probabilities — with variance and standard deviation shown too.

#math#probability#expected-value#statistics#mean

The possible values of X. Comma, space, or newline-separated.

One probability per outcome, in the same order. Should sum to 1.

Expected value E[X]

1.5

E[X] (mean, μ)
1.5
Variance Var(X) = σ²
0.75
Standard deviation σ
0.8660254038
E[X²]
3
Σ P(x)
1
Outcomes used (n)
4

E[X] = Σ x·P(x); Var(X) = Σ P(x)·(x − μ)²; σ = √Var(X).

How to use this calculator

Enter each possible value of your random variable in the "Outcomes" box, then enter the probability of each outcome in the "Probabilities" box in the same order. Separate values with commas, spaces, or new lines. The probabilities should add up to 1 (the calculator flags it if they do not). The result panel shows the expected value E[X] along with the variance and standard deviation of the distribution.

How the calculation works

The expected value of a discrete random variable X is the probability-weighted average of its possible outcomes: E[X] = Σ x·P(x). You multiply each outcome by its probability and add the products. It is the long-run average value you would expect if the experiment were repeated many times — and it need not equal any single achievable outcome. The variance measures how spread out the distribution is around the mean, Var(X) = Σ P(x)·(x − μ)², and the standard deviation σ is its square root, expressed in the same units as X. These definitions follow OpenStax Introductory Statistics §4.2 and standard probability texts such as Ross, A First Course in Probability.

Worked example

Toss a fair coin three times and let X be the number of heads. X can be 0, 1, 2 or 3 with probabilities 1/8, 3/8, 3/8, 1/8 (0.125, 0.375, 0.375, 0.125). Then E[X] = 0(0.125) + 1(0.375) + 2(0.375) + 3(0.125) = 0 + 0.375 + 0.75 + 0.375 = 1.5 heads. This matches the binomial shortcut np = 3 × 0.5 = 1.5. The variance is 0.75 (equal to np(1−p) = 3 × 0.5 × 0.5), so the standard deviation is √0.75 ≈ 0.87.

Frequently asked questions

What is expected value?

Expected value, written E[X], is the probability-weighted average of all the possible outcomes of a random variable. It represents the long-run average result you would get if the random experiment were repeated many times.

How do you calculate expected value?

Multiply each outcome by its probability, then add all those products together: E[X] = Σ x·P(x). For example, with outcomes 10 and −5 at probabilities 0.3 and 0.7, E[X] = 10(0.3) + (−5)(0.7) = 3 − 3.5 = −0.5.

Do the probabilities have to add up to 1?

Yes. For a valid discrete probability distribution the probabilities must sum to exactly 1. This calculator still computes E[X] from the numbers you enter but warns you if the probabilities do not add up to 1, so you can check for a missing or mistyped value.

Can the expected value be a number that never actually occurs?

Yes. The expected value is an average, not a prediction of a single trial. A fair six-sided die has an expected value of 3.5 even though you can never roll 3.5 — it is the mean you would approach over many rolls.

What is the difference between expected value and variance?

Expected value tells you the centre of the distribution (its mean), while variance and standard deviation tell you how spread out the outcomes are around that centre. Variance is Var(X) = Σ P(x)·(x − μ)², and the standard deviation is its square root.

How is expected value used in real life?

Expected value underpins decisions involving risk and uncertainty — pricing insurance, valuing bets and lottery tickets, assessing investment returns, and comparing business options. A positive expected value means a favourable long-run outcome; a negative one means an unfavourable one.