Expected Value Calculator — Discrete Outcomes, Variance & Standard Deviation

Enter a finite discrete probability distribution to calculate its expected value E(X), variance Var(X), standard deviation σ, second moment E(X²), and every outcome’s contribution.

Discrete outcomes and probabilities

#Outcome xProbability p(x)Remove

Enter probabilities from 0 to 1. They must total 1. Completely blank rows are ignored.

Private by design: outcomes and probabilities are processed only in this browser. They are not uploaded or saved.

Results

Enter a complete distribution and select Calculate to see expected value, variance, standard deviation, and weighted steps.

Advertisement

Expected Value, Variance and Standard Deviation Formulas

Expected value (mean) μ = E(X) = Σ xᵢpᵢ

Multiply every possible outcome by its probability, then add the products.

Variance Var(X) = Σ pᵢ(xᵢ − μ)²

Find the probability-weighted average squared distance from the expected value.

Standard deviation σ = √Var(X)

Take the square root of variance to return to the outcome’s original unit.

Second-moment identity Var(X) = E(X²) − [E(X)]²

This equivalent identity is reported as a cross-check, subject to floating-point rounding.

The calculator treats the rows as the complete probability distribution—not as an unweighted sample. Probabilities must be nonnegative and total 1 (or 100%). Variance is calculated with the centered formula for better numerical stability.

How to Calculate Expected Value Step by Step

  1. List every possible numeric outcome of the discrete random variable.
  2. Assign each outcome its probability. The probabilities must total 1.
  3. Multiply each outcome xᵢ by its probability pᵢ.
  4. Add those weighted contributions to get E(X).
  5. For variance, multiply each squared distance (xᵢ − E(X))² by pᵢ and add.
  6. Take the square root of variance to get standard deviation.

Worked example

Suppose the possible net results are −10, 5, and 20 with probabilities 0.2, 0.5, and 0.3. Expected value is (−10 × 0.2) + (5 × 0.5) + (20 × 0.3) = 6.5. The variance is 110.25, so the standard deviation is 10.5.

What the results mean

Expected value describes the long-run probability-weighted average over many repetitions under the same distribution. It is not a guarantee for one trial and may not be a possible outcome. Variance and standard deviation describe spread around that average; variance uses squared units, while standard deviation uses the original outcome unit.

Assumptions and limits

  • The entered rows cover all mutually exclusive outcomes relevant to the model.
  • The probabilities are valid for the situation and together describe a complete distribution.
  • The calculator supports up to 200 finite numeric outcomes. Very large magnitudes that overflow browser arithmetic are rejected.
  • If several events lead to the same numeric outcome, you may enter them separately or combine their probabilities.

Formula references

The probability rules and moment definitions follow the NIST/SEMATECH e-Handbook description of discrete probability distributions and NIST’s tutorial section on expected value, variance, and standard deviation.

Frequently Asked Questions

How do you calculate expected value for discrete outcomes?

Multiply each outcome by its probability and add the products: E(X) = Σxᵢpᵢ. The contribution table shows every product used in the sum.

How are variance and standard deviation calculated?

Variance is Σpᵢ(xᵢ − μ)², where μ is the expected value. Standard deviation is the square root of that variance.

Do probabilities have to add up to 1?

Yes. A complete discrete probability distribution totals 1, or 100%. If you entered nonnegative relative weights, select Normalize probabilities to rescale them proportionally.

Can outcomes be negative or repeated?

Yes. Outcomes may be negative, zero, positive, or repeated. Repeated outcomes can be combined by adding their probabilities, but separate rows produce the same moments.

Is expected value the most likely outcome?

Not necessarily. Expected value is a probability-weighted average. It may differ from the mode and does not even need to be one of the listed outcomes.

Is this sample variance or population variance?

This is distribution variance. Because the probabilities define the full model, the calculator uses Σpᵢ(xᵢ − μ)² rather than dividing an unweighted dataset by n or n − 1.

Are my inputs uploaded or saved?

No. Calculations run locally in your browser, and the tool does not upload or store your outcomes or probabilities.

Explore more tools