Calculate E(X), variance, and standard deviation for any probability distribution.
Last updated: March 2026
Use commas to separate value and probability. One pair per line.
| x | P(X=x) | x·P(x) | x²·P(x) |
|---|---|---|---|
| 1 | 0.1000 | 0.100000 | 0.100000 |
| 2 | 0.2000 | 0.400000 | 0.800000 |
| 3 | 0.3000 | 0.900000 | 2.700000 |
| 4 | 0.2500 | 1.000000 | 4.000000 |
| 5 | 0.1500 | 0.750000 | 3.750000 |
Expected value (or expectation) is the mean outcome of a random event, weighted by probability. It's one of the most fundamental concepts in probability and statistics, giving you the long-run average result if the experiment were repeated infinitely many times.
Expected value is calculated by multiplying each possible outcome by its probability and summing all these products: E(X) = Σ(x × P(X=x)). This is distinct from the simple arithmetic mean because outcomes can occur with different frequencies.
Beyond expected value, we often care about variance and standard deviation, which measure "spread" or variability in outcomes. A low variance means outcomes cluster near the expected value. A high variance means outcomes are scattered far from the mean. Together, expected value and variance fully characterize common probability distributions.
Expected value combines all possible outcomes with their probabilities:
Variance measures spread from the expected value:
Rolling a fair die.
Long-run average roll: 3.5
On average, you'll roll a 3.5. Most rolls vary about ±1.7 from this average. Notice how roughly 68% of rolls fall within 3.5 ± 1.7 (i.e., between 1.8 and 5.2).
Yes! If outcomes are negative (losses or costs), E(X) can be negative. For example, a lottery ticket with expected value -$1 means you expect to lose $1 per ticket on average.
Probabilities should always sum to 1 (or very close to 1 with rounding). If they don't, you've either missed a case, double-counted, or have inconsistent inputs. This calculator warns you if ∑P ≠ 1.
Variance (or standard deviation) measures risk or uncertainty. Two investments can have the same expected return but different risks. A low-variance investment is more predictable; high-variance is more risky.
Arithmetic mean treats all values equally: (1+2+3)/3 = 2. Expected value weights by probability: 1×0.5 + 2×0.1 + 3×0.4 = 2.1. Use expected value when outcomes have different likelihoods.
This calculator works with discrete values. For continuous distributions (normal, exponential, etc.), use integrals: E(X) = ∫ x·f(x)dx. See your stats reference or use specialized software.
E(X²) is the expected value of the square of X. It's always ≥ [E(X)]² due to Jensen's inequality. The difference gives variance: Var(X) = E(X²) - [E(X)]².
Related Tools
Basic probability calculations.
P(A|B) calculations.
P(A and B) calculations.
Three event probabilities.
Conditional probability.
Decision theory.