Home page for accesible maths 4 Discrete random variables

Style control - access keys in brackets

Font (2 3) - + Letter spacing (4 5) - + Word spacing (6 7) - + Line spacing (8 9) - +

4.5 Variance

Expectation is a weighted average, and consequently is a measure of the location of the pmf. The spread, or dispersion, of a random variable is usually measured by the variance: the expected squared deviation about the expectation.

The variance of the random variable R, Var(R), is defined as Var(R)=E[(R-E[R])2], The standard deviation of R, s.d.(R), is defined to be the square root of the variance.

The variance is the expectation of the function of the random variable g(R)=(R-m)2, where m=E(R) is a number.

Aside: To get a feel for standard deviations experience (and some nice theory in later courses!) suggests that for many random variables approximately 95% of the probability mass falls within ±2 standard deviations of the mean of the random variable.

Exercise 4.22.

Suppose that four random variables R1, R2, R3 and R4 on 𝒮={0,1,2} have pmfs

012p1(r)010p2(r)1/41/21/4p3(r)1/31/31/3p4(r)1/201/2

respectively. These are plotted in the graphs:

Note for each pmf the sum of the probs is 1. The expectations are the same so that

E[R1]=E[R2]=E[R3]=E[R4]=1.

Find the variances.

Solution.

The different variances are

(0-1)2×0+(1-1)2×1+(2-1)2×0=0,(0-1)2×1/4+(1-1)2×1/2+(2-1)2×1/4=1/2,(0-1)2×1/3+(1-1)2×1/3+(2-1)2×1/3=2/3,(0-1)2×1/2+(1-1)2×0+(2-1)2×1/2=1.

We see that Var[R1]<Var[R2]<Var[R3]<Var[R4]. This agrees with intuition of dispersions from barplots.

This formulation of the variance is inconvenient for calculation, so alternative forms have been derived which simplify evaluation. Writing E[R] as m a constant, we have

Var(R) = E[(R-E(R))2], def
= E[(R-m)2], rewrite
= E[R2-2Rm+m2], expand
= E[R2]-2E[mR]+E[m2], linearity
= E[R2]-2mE[R]+m2, E const
= E[R2]-2mm+m2, def m
= E[R2]-m2, simplify
= E[R2]-(E[R])2, rewrite.
Exercise 4.23.

Find the variance of a random digit R uniformly distributed on the integers r=1,2,,6.

Solution.

From above E(R)=72, and

E(R2)=1612+1622++1662=916.

So

Var(R) = E(R2)-[E(R)]2=916-[72]2=3512

As with linearity for expectation there is an important result for the variance of linear functions of a random variable R. Suppose a and b are constants

Var(aR+b) = E[(aR+b-E[aR+b])2] def Var
= E[(aR+b-(aE[R]+b))2] lin E
= E[(aR-aE[R])2] factor
= E[a2(R-E[R])2] factor
= a2E[(R-E[R])2] lin E
= a2Var(R). def Var

This result shows the important properties of variance:

Var(R+b) = Var(R)
Var(aR) = a2Var(R).
Exercise 4.24.

For a random variable R, E[R]=3 and Var(R)=2. Find

  1. i.

    E[2R]

  2. ii.

    E[-2R+6]

  3. iii.

    Var(2R)

  4. iv.

    Var(-2R+6)

Solution.
  1. i.

    E[2R]=2E[R]=6.

  2. ii.

    E[-2R+6]=-2E[R]+6=0.

  3. iii.

    Var(2R)=22Var(R)=8.

  4. iv.

    Var(-2R+6)=(-2)2Var(R)=4Var(R)=8.


In summary

Var(R) = E[(R-E(R))2] = E[R2]-(E[R])2, Var(aR+b) = a2Var(R),