Expected Value & Variance Calculator
Find the expected value, variance and standard deviation of a discrete random variable from its outcome values and matching probabilities.
Mean of the distribution
- 1
Weighted terms Σ xᵢ × pᵢ
1 × 0.1 + 2 × 0.1 + 3 × 0.2 + 4 × 0.2 + 5 × 0.2 + …Showing first 5 of 6 terms. - 2
E[X] = Σ xᵢpᵢ
3.9000
How does this calculator work?
Enter outcome values and their probabilities, and this tool returns the expected value E[X] = Σ xᵢ·pᵢ, the variance Σ pᵢ·xᵢ² − E[X]², and the standard deviation. It checks that both lists are equal length and that the probabilities sum to 1, then charts each outcome probability.
Formula
How this is calculated
Enter two equal-length lists: the outcome values x of a discrete random variable, and the probability p of each outcome. Entries can be separated by commas, spaces or newlines. The probabilities should form a valid distribution, so they must each be between 0 and 1 and sum to 1; the calculator warns when the two lists differ in length or when the total probability deviates from 1 by more than 1e−6.
The expected value (mean) is the probability-weighted average of the outcomes, E[X] = Σ xᵢ·pᵢ. The variance measures spread around that mean and is computed with the shortcut Var(X) = Σ pᵢ·xᵢ² − E[X]², which is algebraically identical to Σ pᵢ·(xᵢ − E[X])². The standard deviation is the square root of the variance, giving a spread figure in the same units as the outcomes.
Values are unitless numbers, so attach your own units (dollars, points, etc.) as needed. The variance is clamped at zero before the square root to avoid tiny negative results from floating-point rounding. A degenerate distribution where all probability sits on one outcome yields zero variance and zero standard deviation.
Frequently asked questions
A valid probability distribution assigns total probability 1 across all possible outcomes. If your list sums to something else, either an outcome is missing or a probability is mistyped, so results would be meaningless.
Variance is the average squared deviation from the mean and is in squared units. Standard deviation is its square root, expressed in the same units as the outcomes, which makes it easier to interpret.
Yes. Outcome values can be any real numbers, including negatives (for example net gains and losses). Only the probabilities are restricted to non-negative values summing to 1.
Also known as
TG we-Calculate Editorial Team. (2026). Expected Value & Variance Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/expected-value-calculator
TG we-Calculate Editorial Team. "Expected Value & Variance Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/expected-value-calculator.
TG we-Calculate Editorial Team, "Expected Value & Variance Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/expected-value-calculator
@misc{wecalculate_expected_value_calculator, title = {Expected Value & Variance Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/expected-value-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
