Expected Value Calculator

Enter the values X can take and the probability of each to find the expected value.

The values X can take, separated by commas or spaces.

One probability for each value, in the same order. They must add up to 1.

Try

Result

You enteredX∈{0, 1, 2}X \in \left\{ 0,\ 1,\ 2 \right\}

E(X)=1\displaystyle E(X) = 1

Variance

0.5\displaystyle 0.5

Standard deviation

0.707107\displaystyle 0.707107
Show the work
  1. Expected value

    The expected value is the long-run average: each value xx is weighted by its probability P(x)P(x) and the results are added.

    E(X)=∑x P(x)=0×0.25+1×0.5+2×0.25=0+0.5+0.5=1\begin{aligned} E(X) &= \sum x\,P(x) \\ &= 0 \times 0.25 + 1 \times 0.5 + 2 \times 0.25 \\ &= 0 + 0.5 + 0.5 \\ &= 1 \end{aligned}
  2. Mean of the squares

    The variance needs the average of the squared values, found in the same way with x2x^2 in place of xx.

    E(X2)=∑x2 P(x)=0×0.25+1×0.5+4×0.25=0+0.5+1=1.5\begin{aligned} E(X^2) &= \sum x^2\,P(x) \\ &= 0 \times 0.25 + 1 \times 0.5 + 4 \times 0.25 \\ &= 0 + 0.5 + 1 \\ &= 1.5 \end{aligned}
  3. Variance

    The variance measures the spread: the mean of the squares less the square of the mean. Here E(X)=1E(X) = 1 and E(X2)=1.5E(X^2) = 1.5.

    Var(X)=E(X2)−(E(X))2=1.5−(1)2=1.5−1=0.5\begin{aligned} \mathrm{Var}(X) &= E(X^2) - \left(E(X)\right)^2 \\ &= 1.5 - \left(1\right)^2 \\ &= 1.5 - 1 \\ &= 0.5 \end{aligned}
  4. Standard deviation

    The standard deviation is the square root of the variance, which puts the spread back in the units of XX.

    σ=Var(X)=0.5≈0.707107\begin{aligned} \sigma &= \sqrt{\mathrm{Var}(X)} \\ &= \sqrt{0.5} \approx 0.707107 \end{aligned}
  5. Result

    So E(X)=1E(X) = 1 and Var(X)=0.5\mathrm{Var}(X) = 0.5.

Worked examples