HomeStatistics & Probability › Expected Value Calculator

Expected Value Calculator

Computes the expected value E[X] = Σ x·p(x), the variance and the standard deviation of a discrete random variable from its list of outcomes and their probabilities.

When to use

You have a set of possible outcomes (payoffs, scores, counts) with known probabilities and need the long-run average and its spread: bets, lotteries, insurance, decision analysis.

Do not use when: The probabilities are unknown and you have observed data instead (use descriptive-statistics), or the weights are not probabilities (use weighted-average).

Formula

E[X] = Σ values_i × probabilities_i; variance = Σ probabilities_i × (values_i − E[X])²; std_dev = √variance

Probabilities are checked to sum to 1 within 0.001 (to tolerate rounded inputs such as 0.1667) and rescaled to sum exactly to 1 before computing; a note is added when rescaling changed them by more than 10⁻⁶.

Inputs

ParameterTypeUnitRequiredDescription
valuesnumber_listyesNumeric value of each possible outcome (negative for losses).
probabilitiesnumber_listyesProbability of each outcome as a fraction between 0 and 1, in the same order as values; they must sum to 1 (within 0.001).

Outputs

OutputTypeUnitDescription
expected_valuenumberΣ values × probabilities: the long-run average outcome.
variancenumberΣ probabilities × (values − E[X])².
std_devnumber√variance.
countintegerNumber of outcome/probability pairs.

Example

Payouts 0, 10, 100 with probabilities 0.7, 0.25, 0.05: {"values":[0,10,100],"probabilities":[0.7,0.25,0.05]}{"expected_value":7.5,"variance":468.75,"std_dev":21.6506,"count":3}

Fair six-sided die: {"values":[1,2,3,4,5,6],"probabilities":[0.1666667,0.1666667,0.1666667,0.1666667,0.1666667,0.1666667]}{"expected_value":3.5,"variance":2.9167,"std_dev":1.7078}

GET https://tttkmbb.com/api/v1/calculate/expected-value?values=0%2C10%2C100&probabilities=0.7%2C0.25%2C0.05

Machine access

Sources

FAQ

What does a negative expected value mean?

On average you lose that amount per play; for a lottery ticket or casino bet the expected value is negative because the house keeps a margin. It says nothing about any single outcome.

Can I enter percentages?

No, probabilities are fractions: 0.25 for 25 %. Values can be any numbers, including negative amounts for losses.

Related calculators