MathorynMathematical Formula Database

Statistics & Probability

Variance of a Random Variable

The variance of a random variable is the mean of the squares minus the square of the mean. This shortcut is used to compute variances of discrete distributions quickly and appears in many proofs in probability.

Var⁡(X)=E[X2]−(E[X])2\operatorname{Var}(X)=E\left[X^2\right]-\left(E[X]\right)^2
LaTeX\operatorname{Var}(X)=E\left[X^2\right]-\left(E[X]\right)^2

Variables

Var⁡(X)\operatorname{Var}(X)
variance
E[X]E[X]
expected value
E[X2]E\left[X^2\right]
expected value of the square

Example

Find the variance of a fair die roll.

  1. E[X]=3.5E[X]=3.5.
  2. E[X2]=1+4+9+16+25+366=916E[X^2]=\frac{1+4+9+16+25+36}{6}=\frac{91}{6}.
  3. Var⁡=916−12.25\operatorname{Var}=\frac{91}{6}-12.25.

Answer: Var⁡(X)≈2.9167\operatorname{Var}(X)\approx2.9167.

Related formulas