Home page for accesible maths 6 Continuous random variables

Style control - access keys in brackets

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

6.4 Expectation and variance

All the information about the distribution of a continuous random variable X is contained in either the cdf FX(x) or the pdf fX(x). However it is often helpful to summarise the main characteristics of the distribution in terms of a few values, analogously to in the discrete case.

The expected value of a continuous random variable X can be thought of as the average of the different values that X may take, weighted according to their chance of occurrence.

The expected value of a continuous random variable X is E(X)=-xfX(x)dx.

Notice the similarity with the definition of expectation of a discrete random variable. Similarly for a real-valued function g(X) of a continuous random variable X, one can show that the expected value is

E(g(X))=-g(x)fX(x)dx.

For example,

E(X2)=-x2fX(x)dx.
Exercise 6.5.

(Alternative triangular pdf) For X, with pdf given by

fX(x)={2x0x1,0otherwise,

find E(X), E(2X) and E(X2).

Solution.
E(X) = -xfX(x)𝑑x
= [-0+01+1]xfX(x)dx
= 0+01x 2x𝑑x+0
= [23x3]01=23.

Also

E(2X) = 012x 2x𝑑x=43=2E(X)
E(X2) = 01x2 2x𝑑x=[12x4]01=12,

using the same method to split the range.

For continuous variables linearity properties of expectation are very similar to those stated in Chapter 4 for discrete random variables.

For arbitrary functions g and h, constants a, b and c, and a continuous random variable X

E[g(X)+h(X)] = E[g(X)]+E[h(X)],
E[cg(X)] = cE[g(X)].

Derivation (of first property):

E[g(X)+h(X)] = -[g(x)+h(x)]fX(x)dx
= -g(x)fX(x)dx+-h(x)fX(x)dx
= E(g(X))+E(h(X))

The other properties are shown similarly.

The variance, measuring of the spread or dispersion of a random variable about the expectation, for a continuous distribution is Var(X)=E[(X-E(X))2]

As with discrete rvs, the easiest way to evaluate the variance is usually

Var(X)=E(X2)-E(X)2.
Proof.

Note that the calculation of this formula on page 4.5 uses only the properties of expectation given above, and so is just as valid for continuous random variables as it was for discrete random variables.

Exercise 6.6.

For X, with pdf given by

fX(x)={2x0x1,0otherwise,

find VarX. You might well want to use some results from Exercise 6.5.

Solution.

From the previous example we know that E(X)=23 and E(X2)=12. Therefore

VarX = E(X2)-E(X)2
= 12-49=118,

Warning: Sometimes the expectation and variance do not exist. This occurs when the chance of obtaining very large values is too big.