How is the variance of a random variable calculated?

Created from Britannica articles using AI. AI can make mistakes, so verify using Britannica articles.

In probability and statistics, the variance of a random variable is a measure of the weighted average of the squared deviations from the mean (μ). It is denoted as Var(X) or σ2 and is defined as Var(X)=E{[X−E(X)]2}.12

The calculation method depends on whether the random variable is discrete or continuous:

Alternatively, the variance can be calculated using the formula Var(X)=E(X2)−{E(X)}2. The standard deviation is the positive square root of the variance, providing a measure of dispersion in the same units as the original variable.231