StatlectThe Digital Textbook
Index > Fundamentals of probability

Variance

We start this lecture with a definition of variance.

Definition Let X be a random variable. Denote by [eq1] the expected value operator. The variance of X, denoted by [eq2], is defined as follows:[eq3]provided the above expected value exists and is well-defined.

The variance of X is also called the second central moment of X.

Interpretation

Variance is a measure of the dispersion of a random variable around its mean. Being the expected value of a squared number, variance is always positive. When a random variable X is constant (whatever happens, it always takes on the same value), then its variance is zero (because X is always equal to its expected value [eq4]). On the contrary, the larger are the possible deviations of X from its expected value [eq5], the larger the variance of X is.

Computation

To better understand how variance is computed, you can break up its computation in several steps:

  1. compute [eq6], the expected value of X;

  2. construct a random variable Y that measures how much the realizations of X deviate from their expected value:[eq7]

  3. take the square of Y, so that positive and negative deviations from the mean having the same magnitude yield the same measure of distance from [eq8];

  4. finally, compute the expected value of the squared deviation $Y^{2}$ to know how much on average X deviates from [eq9]:[eq10]

A variance formula

The following is a very important formula for computing variance:[eq11]

Proof

The variance formula is derived as follows. First expand the square:[eq12]Then, by linearity of the expected value:[eq13]

The above variance formula also makes clear that variance exists and is well-defined only as long as [eq14] and [eq15] exist and are well-defined.

Example

The following example shows how to compute the variance of a discrete random variable using both the definition and the variance formula above.

Example Let X be a discrete random variable with support [eq16] and probability mass function[eq17]where [eq18]. Its expected value is[eq19]The expected value of its square is[eq20]Its variance is[eq21]Alternatively, we can compute the variance of X using the definition. Define a new random variable, the squared deviation of X from [eq22], as[eq23]The support of Z is [eq24] and its probability mass function is[eq25]The variance of X equals the expected value of Z:[eq26]

The exercises at the bottom of this page provide more examples of how variance is computed.

More details

The following subsections contain more details on variance.

Variance and standard deviation

The square root of variance is called standard deviation. The standard deviation of a random variable X is usually denoted by [eq27] or by [eq28]:[eq29]

Addition to a constant

Let $ain U{211d} $ be a constant and let X be a random variable. Then,[eq30]

Thanks to the fact that [eq31] (by linearity of the expected value), we have[eq32]

Multiplication by a constant

Let $bin U{211d} $ be a constant and let X be a random variable. Then,[eq33]

Thanks to the fact that [eq34] (by linearity of the expected value), we obtain[eq35]

Linear transformations

Let $a,bin U{211d} $ be two constants and let X be a random variable. Then, combining the two properties above, one obtains[eq36]

Square integrability

If [eq37] exists and is finite, we say that X is a square integrable random variable, or just that X is square integrable. It can easily be proved that, if X is square integrable then X is also integrable, that is, [eq38] exists and is finite. Therefore, if X is square integrable, then, obviously, also its variance [eq39] exists and is finite.

Solved exercises

Below you can find some exercises with explained solutions.

Exercise 1

Let X be a discrete random variable with support [eq40] and probability mass function[eq41]Compute its variance.

Solution

The expected value of X is[eq42]The expected value of $X^{2}$ is[eq43]The variance of X is[eq44]

Exercise 2

Let X be a discrete random variable with support [eq45] and probability mass function[eq46]Compute its variance.

Solution

The expected value of X is[eq47]The expected value of $X^{2}$ is[eq48]The variance of X is[eq49]

Exercise 3

Read and try to understand how the variance of a Poisson random variable is derived in the lecture entitled Poisson distribution.

Exercise 4

Let X be an absolutely continuous random variable with support [eq50] and probability density function[eq51]Compute its variance.

Solution

The expected value of X is[eq52]The expected value of $X^{2}$ is[eq53]The variance of X is[eq54]

Exercise 5

Let X be an absolutely continuous random variable with support [eq50] and probability density function[eq56]Compute its variance.

Solution

The expected value of X is[eq57]The expected value of $X^{2}$ is[eq58]The variance of X is[eq59]

Exercise 6

Read and try to understand how the variance of a Chi-square random variable is derived in the lecture entitled Chi-square distribution.

The book

Most learning materials found on this website are now available in a traditional textbook format.