Math

Expected Value Calculator

Calculate expected value E(X), variance σ², and standard deviation from outcomes and their probabilities. See the step-by-step formula breakdown.

Quick Answer

Expected value is the weighted average of all possible outcomes: E(X) = Σ(x × P(x)). It represents the long-run average if the experiment were repeated infinitely. Variance measures spread: σ² = Σ(P(x) × (x - E(X))²).

Enter Outcomes and Probabilities

Enter each possible outcome value and its probability. Probabilities should sum to 1. Up to 10 outcomes.

#Outcome (x)Probability P(x)
1
2
3
4
5

Results

Expected Value E(X)
3.15
Variance σ²
1.4275
Std Deviation σ
1.1948

Probability Distribution

0.1
1
0.2
2
0.3
3
0.25
4
0.15
5
E(X) = 3.15 shown as the weighted average

Step-by-Step Calculation

xP(x)x×Px-E(X)(x-E(X))²P×(x-E(X))²
10.10.1-2.154.62250.4622
20.20.4-1.151.32250.2645
30.30.9-0.150.02250.0067
40.2510.850.72250.1806
50.150.751.853.42250.5134
Sum13.15--1.4275

E(X) = Σ(x × P(x)) = 3.15

σ² = Σ(P(x) × (x - E(X))²) = 1.4275

σ = σ² = 1.4275 = 1.1948

About This Tool

The Expected Value Calculator computes the expected value (E(X)), variance, and standard deviation of a discrete random variable from a user-defined probability distribution. It provides a complete step-by-step breakdown showing each outcome's contribution to the expected value and variance, along with a visual bar chart of the probability distribution. This tool is essential for probability and statistics students, actuaries, game designers, financial analysts, and anyone who needs to analyze the long-run average and spread of uncertain outcomes.

What Is Expected Value?

Expected value, denoted E(X) or mu, is the long-run average outcome of a random variable if the experiment were repeated infinitely many times. For a discrete random variable, it is calculated as E(X) = sum of (xi times P(xi)) over all possible outcomes. The expected value is not necessarily an outcome that can actually occur. For example, the expected value of a fair six-sided die roll is 3.5, even though you can never roll a 3.5. The concept was formalized by Blaise Pascal and Pierre de Fermat in the 17th century during their analysis of gambling problems, and it remains foundational to probability theory, statistics, and decision theory.

Understanding Variance and Standard Deviation

While expected value tells you the center of a distribution, variance and standard deviation tell you how spread out the outcomes are. Variance (sigma squared) is calculated as the expected value of the squared deviations from the mean: sigma^2 = sum of P(xi) times (xi - E(X))^2. Standard deviation (sigma) is the square root of variance and is in the same units as the original variable, making it more interpretable. A large standard deviation means outcomes are widely scattered, while a small one means they cluster tightly around the expected value. These measures are critical for risk assessment in finance, quality control in manufacturing, and error analysis in science.

Properties of Expected Value

Expected value has several useful properties. Linearity: E(aX + b) = a*E(X) + b, and E(X + Y) = E(X) + E(Y) for any random variables X and Y, even if they are not independent. This makes expected value easy to work with algebraically. For independent variables, E(XY) = E(X)*E(Y). These properties are used extensively in statistics, insurance, and portfolio theory. However, expected value does not always capture the full picture: two distributions can have the same expected value but very different risk profiles, which is why variance is equally important.

Applications in Decision Making

Expected value is the cornerstone of rational decision-making under uncertainty. In business, it helps evaluate investments by computing the weighted average return across scenarios. In insurance, actuaries use expected value to set premiums that cover expected claims plus a margin. In game theory, expected value determines fair games (E(X) = 0 for the house) and identifies the best strategy in repeated games. In medical decision-making, expected value analysis compares treatment options by weighting outcomes by their probabilities. The limitation is that expected value ignores risk tolerance: a 50% chance of winning a million dollars and a 50% chance of losing a million dollars has an expected value of zero, but most people would not consider that a neutral gamble.

Probability Distributions Must Sum to 1

For a valid discrete probability distribution, all probabilities must be non-negative and they must sum to exactly 1 (or 100%). This reflects the fact that one of the listed outcomes must occur. If your probabilities sum to more or less than 1, the expected value and variance calculations are technically invalid. This calculator warns you when probabilities do not sum to 1 but still computes results so you can identify and fix the error. In practice, rounding errors may cause probabilities to sum to 0.999 or 1.001, which is usually acceptable.

Expected Value vs. Most Likely Outcome

The expected value is often confused with the mode (most likely outcome), but they are fundamentally different concepts. The mode is the outcome with the highest probability, while the expected value is the probability-weighted average of all outcomes. For a skewed distribution, the expected value can be far from the mode. For example, in a lottery, the most likely outcome is losing (the mode), but the expected value accounts for the small probability of a large win. Understanding this distinction is crucial for making informed decisions: the expected value tells you what to anticipate on average, while the mode tells you what is most likely to happen in a single trial.

Frequently Asked Questions

What does expected value represent in real life?
Expected value represents the long-run average outcome if an experiment is repeated many times. For example, if a game pays $10 with probability 0.3 and $0 with probability 0.7, the expected value is $3. This means that over many plays, you'd average $3 per game. It is the fundamental concept behind insurance pricing, investment analysis, and gambling mathematics.
Why do my probabilities need to sum to 1?
Probabilities must sum to 1 because exactly one outcome must occur in any trial. If they sum to less than 1, you have missing outcomes. If they sum to more than 1, you have overlapping or impossible probabilities. A valid probability distribution requires all values between 0 and 1, with a total sum of exactly 1. This is a fundamental axiom of probability theory (Kolmogorov's axioms).
Can expected value be negative?
Yes. Expected value can be any real number, including negative values. A negative expected value is common in gambling games where the house has an edge. For example, in roulette, the expected value of a $1 bet on a single number is approximately -$0.053, meaning you lose about 5.3 cents per dollar wagered on average. Negative expected value investments or games are unfavorable in the long run.
What is the difference between expected value and average?
Expected value is a theoretical concept calculated from a probability distribution before any data is collected. It predicts what the average should be. A sample average (mean) is computed from actual observed data. By the Law of Large Numbers, the sample average converges to the expected value as the sample size grows. Expected value uses probabilities; sample average uses frequencies from data.
How is variance related to risk?
Variance quantifies the spread of possible outcomes around the expected value. Higher variance means more uncertainty and risk. In finance, variance (and its square root, standard deviation) is the standard measure of investment risk. Two investments with the same expected return but different variances have different risk profiles. Risk-averse investors prefer lower variance. The Sharpe ratio combines expected return and standard deviation to measure risk-adjusted performance.
Can I use this for continuous distributions?
This calculator handles discrete distributions (a finite list of outcomes). For continuous distributions (normal, exponential, etc.), expected value requires integration rather than summation. However, you can approximate a continuous distribution by discretizing it into bins. For exact continuous calculations, use specialized statistical software. The concepts of expected value and variance apply identically; only the computational method differs.

Was this tool helpful?