What Is Expected Value and Variance?
The expected value of a discrete random variable is the probability-weighted average of its outcomes, E[X] = Σ x·P(x). The variance measures spread around that average: Var(X) = Σ (x − μ)² P(x), which equals E[X²] − μ².
Enter the outcomes and probabilities as lists. The calculator checks that the probabilities sum to 1, then gives the expected value, variance, standard deviation, E[X²], median and mode, with a working table and a bar chart of the distribution.
The sections below explain the formulas, the variables, a worked example with a fair die and answers to common questions about probability distributions.
How to Use the Expected Value and Variance Calculator
- Enter the possible outcomes separated by commas.
- Enter the probability of each outcome in the same order.
- Choose decimals or percentages.
- Read E[X], variance, standard deviation and the working table.
Expected Value and Variance Formula
Expected value
Variance
Standard deviation
Expected Value and Variance Variables Explained
| Symbol | Meaning | Notes |
|---|---|---|
| x | A possible outcome | |
| P(x) | Probability of that outcome | all must sum to 1 |
| E[X] or μ | Expected value | |
| Var(X) | Variance | E[X²] − μ² |
| σ | Standard deviation | √Var(X) |
Expected Value and Variance Worked Example
A fair six-sided die has outcomes 1 to 6, each with probability 1/6. E[X] = (1 + 2 + 3 + 4 + 5 + 6) ÷ 6 = 3.5. E[X²] = 91 ÷ 6 = 15.1667, so Var(X) = 15.1667 − 3.5² = 2.9167 and σ = 1.708.
With the example values loaded in the calculator above, the steps are:
- E[X] = Σ x·P(x) = 0×0.1 + 1×0.2 + 2×0.4 + 3×0.2 + 4×0.1 = 2.
- E[X²] = Σ x²·P(x) = 5.2.
- Var(X) = E[X²] − (E[X])² = 5.2 − 4 = 1.2.
- σ = √Var(X) = 1.0954451.
Result: Expected value E[X] = 2; Variance Var(X) = 1.2; Standard deviation = 1.0954451.
How to Read Expected Value and Variance
The expected value is the long-run average of the outcome. For a fair die, E[X] = 3.5, which is not a face you can roll. It is the average over many rolls. The variance 2.9167 measures the typical squared distance from 3.5, and the standard deviation is 1.708.
Two games with the same expected value can differ a lot in variance. A higher variance means bigger swings from the average, so a longer run is needed before results settle near E[X].
Where Expected Value and Variance Is Used
Games and bets
Work out the average gain or loss per play and how much it swings.
Probability homework
Check E[X], E[X²] and Var(X) for a table of outcomes.
Decisions
Compare options with the same expected value but different spread.
Insurance and risk
Find the average claim and its variability.
Common Expected Value and Variance Mistakes to Avoid
- The probabilities must add to 1. The calculator shows the sum so you can check.
- The expected value does not have to be one of the outcomes.
- Compute E[X²] first, then Var(X) = E[X²] − (E[X])².
- Do not divide by n − 1 here. This is a probability distribution, not a sample.
Expected Value and Variance Terms and Definitions
- Random variable
- A quantity whose value is determined by chance.
- Expected value
- The probability-weighted average of all outcomes.
Expected Value and Variance FAQs
How do you calculate expected value?
Multiply each outcome by its probability and add the results. For a fair die this gives (1 + 2 + 3 + 4 + 5 + 6) ÷ 6 = 3.5.
How do you find the variance of a probability distribution?
Compute E[X²] by squaring each outcome before weighting, then subtract the square of the mean. For a die, 15.1667 − 3.5² = 2.9167.
Can the expected value be a number that is not an outcome?
Yes. A die never shows 3.5, but the average of many rolls approaches it.
What if my probabilities do not add to 1?
Then they do not form a valid distribution. Check for a typo or a missing outcome. The calculator displays the total so you can see by how much it is off.