Expected Value Calculator - Mean, Variance, and Std Dev for Any Distribution
Use this expected value calculator to find E(X), variance, and standard deviation of a discrete probability distribution. Enter up to 8 outcome rows.
Expected Value Calculator
Results
What Is an Expected Value Calculator?
An expected value calculator finds the mean of a discrete probability distribution, the probability-weighted average of every possible outcome. Enter each outcome value x_i and its probability P(x_i), and the calculator returns E(X), the variance, and the standard deviation. The expected value is the long-run average payoff if you repeat the random experiment many times.
- • Homework and exam checks: Verify the expected value of a die roll, a Bernoulli trial, or a custom payoff table.
- • Lottery and game analysis: Compare ticket prices to expected winnings of a raffle, slot pull, or lottery ticket.
- • Insurance and risk planning: Estimate the expected loss from a deductible and pair it with the variance to size a reserve.
- • Decision analysis under uncertainty: Pick between investments, marketing tests, or project plans by reading their expected values and spreads.
Expected value is the first moment of a distribution. The variance is the second central moment, and the standard deviation is its square root, which puts the spread back in the same units as the outcomes.
For the single-event and conditional probability numbers that feed into a payoff table, the Probability Calculator covers single-event, dependent, and conditional modes in the same page.
How the Expected Value Calculator Works
The calculator reads each outcome x_i and its probability P(x_i), validates that every probability is in [0, 1], and computes the weighted mean, variance, and standard deviation. A worked fair-die example ties the formulas to the canonical 3.5 result.
- x_i: Numeric value of outcome i. Can be any real number, positive or negative, in any unit.
- P(x_i): Probability of outcome i, a decimal between 0 and 1.
- E(X): Probability-weighted average of outcomes, shown to four decimal places.
- Var(X): Probability-weighted average of squared deviations from E(X), shown to six decimal places.
- Standard deviation: Square root of the variance, in the same units as the outcomes.
When probabilities do not sum to 1, the calculator still computes E(X) and surfaces a warning so the user can renormalize.
Fair six-sided die (the classic 3.5 example)
x = 1, 2, 3, 4, 5, 6; P(x) = 1/6 each.
E(X) = (1+2+3+4+5+6)/6 = 21/6 = 3.5. Var(X) = sum (1/6)*(x - 3.5)^2 = 35/12 ≈ 2.9167. SD = sqrt(35/12) ≈ 1.7078.
E(X) = 3.5; Var(X) = 2.9167; SD = 1.7078.
No face shows 3.5, yet the long-run average of repeated die rolls is 3.5. Expected value is a long-run average, not a possible outcome.
$5 lottery ticket with 10% chance of winning
x = 5 with P = 0.1; x = 0 with P = 0.9.
E(X) = 5*0.1 + 0*0.9 = 0.5. Var(X) = 0.1*(5 - 0.5)^2 + 0.9*(0 - 0.5)^2 = 2.25. SD = 1.5.
E(X) = 0.5; Var(X) = 2.25; SD = 1.5.
A ticket that costs more than $0.50 loses money on average. State lotteries price tickets above the expected payout for the same reason.
According to Omni Calculator, the expected value of a discrete distribution is E(X) = sum of x times P(x) and the expected value of a fair die is 3.5
According to Wolfram MathWorld, the variance of a discrete random variable equals the probability-weighted average of squared deviations and is also E(X^2) - E(X)^2
When the payoff table has two independent events, the And Probability Calculator uses the same probability-weighted multiplication rule for the joint P(A and B) that feeds into E(X).
Key Concepts Behind Expected Value
Four ideas make expected value click: the probability-weighted average, the difference between mean and expected value, the link to long-run averages, and variance as a spread measure.
Probability-weighted average
Expected value multiplies each outcome by its chance, then adds the products. Each row contributes x_i * P(x_i).
Expected value versus sample mean
The sample mean averages observed outcomes; the expected value averages outcomes weighted by true probabilities. With enough trials the sample mean converges to E(X).
First moment of a distribution
E(X) is the first moment of a probability distribution. It is the center of mass and the value that minimizes the sum of squared deviations.
Variance as spread around the mean
Variance is the probability-weighted average of (x_i - E(X))^2. The standard deviation puts that spread back in the original units.
When the outcomes are wins and losses in the same units, the standard deviation is the natural companion to E(X) and the simplest one-number measure of risk around that average.
When the same outcomes are observed as a sample rather than a probability table, the Standard Deviation Calculator computes the empirical standard deviation for the same data.
How to Use the Expected Value Calculator
Pick the number of outcomes, type each (value, probability) pair, and read E(X), variance, and standard deviation from the result panel. Watch the probability sum and the warning row to confirm the distribution is normalized.
- 1 Pick the number of outcomes: Choose between 2 and 8 rows. The default 6 mirrors a fair die.
- 2 Enter outcome x_1: Type the numeric value. Use 1 for a coin heads, 5 for a $5 prize, or -100 for a $100 deductible.
- 3 Enter P(x_1): Type the probability as a decimal between 0 and 1. Use 0.5 for a fair coin heads.
- 4 Repeat for each outcome: Fill in the remaining rows. The result panel updates live.
- 5 Check the probability sum: A sum of 1.0000 means the distribution is normalized. Anything outside [0.9999, 1.0001] triggers a warning.
- 6 Reset: Click Reset to return to x = 1..6 with P(x) = 1/6, which gives the textbook E(X) = 3.5 result.
Example: a 10% chance of winning $5 and a 90% chance of winning nothing. Set Number of Outcomes to 2, type 5 and 0.1 for the first row and 0 and 0.9 for the second. The result panel shows E(X) = 0.5 and SD = 1.5, matching the worked lottery example.
When the payoff is the number of successes in n trials, the Binomial Distribution Calculator gives the full binomial distribution, and its expected value n*p matches the E(X) for the underlying Bernoulli table.
Benefits of Using This Expected Value Calculator
Multiplying outcomes by probabilities by hand is where most avoidable mistakes happen, especially when variance and standard deviation are also required. The calculator keeps the formulas, the warning, and the live preview in one place.
- • Mean, variance, and standard deviation together: E(X), Var(X), and SD update in the same panel.
- • Two to eight outcome rows: Switch the row count to model coin flips, three-outcome games, or larger payoff tables.
- • Validates probabilities before computing: Probabilities outside [0, 1] are treated as 0 so the calculator never silently produces a wrong answer.
- • Probability sum and warning row: The Probability Sum row tells you whether the distribution is normalized, and the warning line explains what to fix.
- • Reset to a known textbook example: The Reset button restores the fair-die default so you can verify E(X) = 3.5.
For homework, the calculator doubles as a check against the multiplication and summation you write on paper. For decision analysis, the same workflow gives a fast sanity check on a payoff table.
When the standard deviation needs a benchmark, the Z-Score Calculator converts an outcome into a z-score so the spread can be read on a standard normal scale.
Factors That Affect the Result and Its Limits
The expected value formula is exact, but four choices about the inputs change what the result means and how much trust to put in it.
Probability sum
If the entered probabilities do not sum to 1, the result is a weighted average of the visible rows rather than the true expected value. The calculator still computes the number and flags the gap.
Probability accuracy
Expected value is only as good as the input probabilities. Empirical rates from a small sample propagate into E(X) and the variance.
Outcome units
E(X) is in the same units as the outcome values, but Var(X) is in those units squared. The standard deviation puts the spread back into the original units.
Linearity of expectation
E(X + Y) = E(X) + E(Y) for any pair of random variables, even dependent ones. That is why expected value is so useful for additive models.
Tail outcomes
Rare but extreme outcomes, such as a $1 million liability with probability 0.001, can dominate E(X). The variance captures the size of that tail.
- • The calculator handles up to 8 discrete outcomes. For continuous distributions the integral form is required.
- • E(X) is a long-run average, not a certain outcome in any single trial. A negative expected value does not mean you always lose.
- • Mis-specified probabilities drive E(X), Var(X), and SD in the same direction as the input error.
When the probabilities come from a clear definition and the outcomes are well modeled, expected value is the right summary statistic. When outcomes have heavy tails, the variance and a tail-aware risk measure are essential companions.
According to Khan Academy, expected value is the probability-weighted average of outcomes and is the long-run average payoff if the random experiment is repeated many times
When the probability table is replaced by an observed sample, the Statistics Calculator returns the empirical mean, variance, and standard deviation of the data so you can compare the expected value to the realized average.
Frequently Asked Questions
Q: What is expected value and how do you calculate it?
A: Expected value is the probability-weighted average of a discrete random variable. For each outcome x_i, multiply by its probability P(x_i) and add the products. The expected value calculator does that for up to 8 outcomes and returns E(X), variance, and standard deviation in the same panel.
Q: How do I compute expected value from a probability distribution?
A: Pick the number of outcomes in the dropdown, then type each outcome value and its probability. The result panel updates live with E(X), variance, and standard deviation, so you can read the answer without clicking calculate.
Q: What is the variance and standard deviation of a discrete distribution?
A: Variance is the probability-weighted average of (x_i - E(X))^2 over all outcomes. Standard deviation is the square root of the variance and is in the same units as the outcomes, which is why it is the natural companion to E(X).
Q: Can the expected value be negative?
A: Yes. Expected value supports losses as well as gains. A typical insurance deductible example has x_i = -100 with probability 0.05 and x_i = 0 with probability 0.95, giving E(X) = -5.
Q: What is the expected value of a fair die roll?
A: A fair six-sided die has six faces each with probability 1/6. The expected value is (1+2+3+4+5+6)/6 = 3.5, with variance 35/12 ≈ 2.9167 and standard deviation ≈ 1.7078. The calculator returns the same three numbers when you open it with the default rows.
Q: How does expected value help with decision making?
A: Expected value turns each option into a single number, so you can rank alternatives by their long-run average payoff. Pair it with the variance or standard deviation to see the spread around that average, and use the same tool to compare lottery tickets, insurance plans, or marketing tests.