The mean of a random variable — its expected value — summarises the centre of the distribution. We next define a summary of the spread of values around this centre.

Definition

The variance of a discrete random variable, X, is defined to be

\[ \Var (X) = \sigma^2 = E \left[(X - \mu)^2 \right] \]

where \(\mu\) is the variable's mean.

As with the variance of a data set, \(s^2 = \dfrac { \sum {(x_i - \overline{x})^2}} {n-1}\), this is a kind of average of squared differences of values from the mean. The standard deviation, \(\sigma\), is the square root of the variance.

An alternative formula for the variance is usually easier to apply in practice when evaluating a random variable's variance:

Alternative formula for variance

A discrete random variable's variance can be written as

\[ \Var (X) = E \left[(X - \mu)^2 \right] = E[X^2] - \left( E[X] \right)^2 \]

(Proved in full version)

When the probability function is described by a mathematical function, the summations needed to find \(E[X]\) and \(E[X^2]\) can often be evaluated mathematically. However they can also be easily evaluated if the probabilities are specified in tabular form.

Question

A couple want at least two children and no more than four, but will stop when they get a boy. Assuming that the probability of each child being a girl is \(\frac {1} {2} \) , independently of the genders of previous children, the probability function for the number of girls in the resulting family is

Number of girls, x 0 1 2 3 4
p(x) 0.25 0.5 0.125 0.0625 0.0625

What are the mean and standard deviation of \(X\)?

(Solved in full version)

The next result gives the variance of a linear function of X.

Variance of a linear function of X

If X is a discrete random variable and a and b are constants,

\[ \Var(a + b \times X) = b^2 \times \Var(X) \]

(Proved in full version)