StatlectThe Digital Textbook
Index > Fundamentals of probability

Variance

Variance is a measure of dispersion. It measures how far the realizations of a random variable, on average, are from its expected value.

Table of Contents

Definition

A formal definition of variance follows.

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.

Understanding the definition

To better understand the definition of variance, you can break up the formula used to define it in several steps:

  1. compute the expected value of X, denoted by[eq4]

  2. construct a new random variable [eq5]equal to the deviation of X from its expected value;

  3. take the square[eq6] which is a measure of distance of X from its expected value (the further X is from [eq7], the larger $Y^{2}$);

  4. finally, compute the expected value of the squared deviation $Y^{2}$ to know how far X, on average, is from its expected value:[eq8]

From these steps we can easily see that:

An equivalent definition

Variance can also be equivalently defined by the following important formula:[eq11]

Proof

That this definition is equivalent to the one given above can be seen as follows:[eq12]

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

We will use this formula very often and we will refer to it, for brevity's sake, as variance formula.

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 [eq15] and probability mass function[eq16]where [eq17]. Its expected value is[eq18]The expected value of its square is[eq19]Its variance is[eq20]Alternatively, we can compute the variance of X using the definition. Define a new random variable, the squared deviation of X from [eq21], as[eq22]The support of Z is [eq23] and its probability mass function is[eq24]The variance of X equals the expected value of Z:[eq25]

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 [eq26] or by [eq27]:[eq28]

Addition to a constant

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

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

Multiplication by a constant

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

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

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[eq35]

Square integrability

If [eq14] 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, [eq37] exists and is finite. Therefore, if X is square integrable, then, obviously, also its variance [eq38] 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 [eq39] and probability mass function[eq40]Compute its variance.

Solution

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

Exercise 2

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

Solution

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

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 [eq49] and probability density function[eq50]Compute its variance.

Solution

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

Exercise 5

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

Solution

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

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 of the learning materials found on this website are now available in a traditional textbook format.