Intermediate

Expected Value & Variance Calculator

Find the expected value, variance and standard deviation of a discrete random variable from its outcome values and matching probabilities.
Comma, space or newline separated
Must sum to 1, same count as values
Expected value E[X]
3.9000

Mean of the distribution

Variance
2.49
Standard deviation
1.578
Sum of probabilities
1
Number of outcomes
6
10%
10%
20%
20%
20%
20%
x = 1
x = 2
x = 3
x = 4
x = 5
x = 6
Probability distribution — each segment proportional to p(xᵢ)
Step by step
  1. 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. 2

    E[X] = Σ xᵢpᵢ

    3.9000
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

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
E[X] = Σ xᵢ·pᵢ; Var(X) = Σ pᵢ·xᵢ² − E[X]²; SD = √Var(X)
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

expected value
expected value and variance
mean of distribution
variance from table
discrete random variable
ev calculator
expected value formula
weighted outcome average

APA

TG we-Calculate Editorial Team. (2026). Expected Value & Variance Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/expected-value-calculator

Chicago

TG we-Calculate Editorial Team. "Expected Value & Variance Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/expected-value-calculator.

IEEE

TG we-Calculate Editorial Team, "Expected Value & Variance Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/expected-value-calculator

BibTeX

@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?