Expected Value Calculator
Calculate the expected value E(X), variance, and standard deviation of a discrete random variable. Enter outcomes and their probabilities to find the long-run average. See also our Probability Calculator, Variance Calculator, and Standard Deviation Calculator.
How to Use the Expected Value Calculator
Expected value (E(X)) is the long-run average outcome of a random variable if the experiment is repeated many times. It is calculated by multiplying each possible outcome by its probability and summing the results. Expected value is fundamental to decision theory, gambling analysis, insurance pricing, and any situation involving uncertainty and payoffs.
Enter each possible outcome value and its corresponding probability. The probabilities should sum to 1 (or very close to 1) for a valid probability distribution. The calculator will warn you if they don't sum correctly. You can add or remove rows as needed. The pre-filled example shows a fair six-sided die with equal probabilities of 1/6 for each face.
The calculator also computes variance (the average squared deviation from the expected value) and standard deviation (the square root of variance). These measure the spread or risk associated with the random variable. A higher standard deviation means more variability in outcomes, which is important for risk assessment in finance, insurance, and game theory.
Expected value is used extensively in decision analysis. When choosing between options with uncertain outcomes, the rational choice (for a risk-neutral decision maker) is the option with the highest expected value. However, real people are often risk-averse, preferring a certain $50 over a 50% chance of $100 (same EV but different risk). This is why variance matters alongside expected value in practical decision-making.
In gambling and lottery analysis, expected value reveals the house edge. Any game with negative expected value means you lose money on average over time. Casinos design games to have slightly negative EV for players (typically -2% to -15%), ensuring long-term profitability while keeping individual sessions unpredictable enough to be entertaining.
Formula
Expected Value:
E(X) = Σ xᵢ × P(xᵢ)
Variance:
Var(X) = Σ P(xᵢ) × (xᵢ - E(X))²
or equivalently: Var(X) = E(X²) - [E(X)]²
Standard Deviation:
σ = √Var(X)
Validity Check:
Σ P(xᵢ) = 1 (all probabilities must sum to 1)
P(xᵢ) ≥ 0 for all i
Linearity of Expectation:
E(aX + b) = a×E(X) + b
Var(aX + b) = a²×Var(X)
Example Calculation
Fair 6-sided die: outcomes 1,2,3,4,5,6 each with P = 1/6
E(X) = 1(1/6) + 2(1/6) + 3(1/6) + 4(1/6) + 5(1/6) + 6(1/6)
E(X) = (1+2+3+4+5+6)/6 = 21/6 = 3.5
E(X²) = (1+4+9+16+25+36)/6 = 91/6 = 15.167
Var(X) = 15.167 - 3.5² = 15.167 - 12.25 = 2.917
σ = √2.917 = 1.708
Interpretation: On average, a die roll yields 3.5 with typical deviation of ±1.7
Reference Table
| Distribution | E(X) | Variance | Std Dev |
|---|---|---|---|
| Fair Die (6-sided) | 3.5 | 2.917 | 1.708 |
| Fair Coin (H=1, T=0) | 0.5 | 0.250 | 0.500 |
| Lottery ($1 ticket) | -$0.50 | Very high | Very high |
| Roulette (single number) | -$0.053 | 33.21 | 5.76 |
| Insurance (annual) | -Premium | Varies | Varies |
| Uniform (1 to n) | (n+1)/2 | (n²-1)/12 | √((n²-1)/12) |
| Bernoulli (p) | p | p(1-p) | √(p(1-p)) |
| Geometric (p) | 1/p | (1-p)/p² | √((1-p)/p²) |
Frequently Asked Questions
What is expected value?
Expected value is the theoretical average outcome of a random experiment if it were repeated infinitely many times. For a discrete random variable, it is the probability-weighted sum of all possible outcomes: E(X) = Σ xᵢP(xᵢ). It represents the "center of mass" of the probability distribution. Note that the expected value may not be a possible outcome itself — a die has E(X) = 3.5, which you can never actually roll.
How is expected value used in gambling?
In gambling, expected value tells you the average amount you win or lose per bet in the long run. A negative expected value means the house has an edge. For example, in American roulette betting on a single number: E(X) = (35)(1/38) + (-1)(37/38) = -$0.053 per dollar bet. This means you lose about 5.3 cents per dollar wagered on average. No betting strategy can overcome a negative expected value in the long run.
What if probabilities don't sum to 1?
For a valid probability distribution, all probabilities must sum to exactly 1 (representing certainty that one of the outcomes will occur). If they sum to less than 1, you may be missing outcomes. If they sum to more than 1, some probabilities are too high. The calculator will still compute E(X) but will flag the issue. Common causes include rounding errors (e.g., 1/3 ≈ 0.333) or forgetting to include all possible outcomes.
What is the relationship between expected value and variance?
Expected value tells you the center (average) of the distribution; variance tells you the spread. Two distributions can have the same expected value but very different variances. For example, getting $50 with certainty has E(X)=$50 and Var=0, while a 50/50 chance of $0 or $100 also has E(X)=$50 but Var=2500. In decision-making, risk-averse people prefer lower variance for the same expected value.
Can expected value be negative?
Yes. Expected value can be any real number — positive, negative, or zero. Negative expected values are common in gambling (the house edge), insurance premiums (you pay more than your expected claims), and lottery tickets (expected return is less than the ticket price). A negative E(X) means you expect to lose money on average. However, people may still rationally accept negative expected value for entertainment or risk reduction (insurance).
How does expected value apply to insurance?
Insurance has negative expected value for the buyer (premiums exceed expected claims) but provides value through risk reduction. If your house has a 0.1% chance of $300,000 fire damage, the expected loss is $300/year. You might pay $500/year in premiums (negative EV of -$200), but you eliminate the catastrophic risk. The insurance company profits because they pool many independent risks, and the law of large numbers ensures their actual losses approach the expected value.