Expected Value Calculator

Expected Value Calculator

Calculate E(X), variance, and standard deviation for any probability distribution.

Last updated: March 2026

Probability Distribution

Use commas to separate value and probability. One pair per line.

Expected Value E(X)
3.150000
Variance
1.427500
Std Dev
1.194780
Total Probability (∑P)
1.0000
Distribution Table
xP(X=x)x·P(x)x²·P(x)
10.10000.1000000.100000
20.20000.4000000.800000
30.30000.9000002.700000
40.25001.0000004.000000
50.15000.7500003.750000

What is Expected Value?

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.

How to Calculate Expected Value

The Formula

Expected value combines all possible outcomes with their probabilities:

E(X) = x₁·P(x₁) + x₂·P(x₂) + ... + xₙ·P(xₙ)
Also written as: E(X) = Σ xᵢ · P(X = xᵢ)

Variance & Standard Deviation

Variance measures spread from the expected value:

Var(X) = E(X²) - [E(X)]²
σ = √Var(X) (standard deviation)
Higher variance = outcomes more spread out from mean

Step-by-Step Process

  1. 1. List outcomes: Catalog all possible values X can take
  2. 2. List probabilities: Assign P(X=x) for each outcome (must sum to 1)
  3. 3. Multiply: Calculate x × P(x) for each pair
  4. 4. Sum: Add all x·P(x) values → E(X)
  5. 5. Calculate variance: Find E(X²) - [E(X)]² and take square root for std dev

Example: Fair Six-Sided Die

Rolling a fair die.

Distribution:
Each outcome: 1, 2, 3, 4, 5, 6
Each probability: 1/6 ≈ 0.1667
Calculate E(X):
E(X) = (1 + 2 + 3 + 4 + 5 + 6) / 6
E(X) = 21 / 6 = 3.5

Long-run average roll: 3.5

Calculate Var(X):
E(X²) = (1² + 2² + 3² + 4² + 5² + 6²) / 6
E(X²) = 91 / 6 ≈ 15.167
Var(X) = 15.167 - 3.5² = 15.167 - 12.25 = 2.917
σ = √2.917 = 1.708
Interpretation:

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).

Frequently Asked Questions

Can expected value be negative?

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.

What if probabilities don't sum to 1?

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.

Why is variance important?

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.

How is this different from arithmetic mean?

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.

Can I use this for continuous distributions?

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.

What's the relationship between E(X) and E(X²)?

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