topic badge
CanadaON
Grade 12

EXT: Mean and variance of Linear combinations of CRV

Lesson

A linear function of a continuous random variable is an expression in the form $aX+b$aX+b where $X$X is the random variable and $a$a and $b$b are constants. The function transforms the random variable $X$X to make a new random variable, $Z=aX+b$Z=aX+b, with its own mean and variance. These are related to the mean and variance of $X$X in ways that will be explained. 

Mean

Recall that a continuous random variable $X$X with density function $f(x)$f(x) defined on the interval $(m,n)$(m,n) has mean

$E(X)=\int_m^n\ xf(x)\mathrm{d}x$E(X)=nm xf(x)dx

Another useful fact, which we state without proof, is that if $Y=g(X)$Y=g(X) is a random variable that is a function of the random variable $X$X, then the mean of $Y$Y is given by

$E(Y)=\int_m^n\ g(x)f(x)\mathrm{d}x$E(Y)=nm g(x)f(x)dx.

For example, in another chapter, we used this fact to find $E(X^2)$E(X2). According to the rule just given, this must be $\int_m^n\ x^2f(x)\mathrm{d}x$nm x2f(x)dx.

 

Now, suppose $g(X)$g(X) is a linear function of $X$X. That is, $g(X)=aX+b$g(X)=aX+b. Then,

$E[g(X)]$E[g(X)] $=$= $E[aX+b]$E[aX+b]
  $=$= $\int_m^n\ (ax+b)f(x)\mathrm{d}x$nm (ax+b)f(x)dx
  $=$= $\int_m^n\ \left(axf(x)+bf(x)\right)\mathrm{d}x$nm (axf(x)+bf(x))dx
  $=$= $a\int_m^n\ xf(x)\mathrm{d}x+b\int_m^n\ f(x)\mathrm{d}x$anm xf(x)dx+bnm f(x)dx
  $=$= $aE[X]+b$aE[X]+b

We conclude that

$E[aX+b]=aE[X]+b$E[aX+b]=aE[X]+b

This is as expected since the function $aX+b$aX+b is just a re-scaling of $X$X combined with a shift of location.

 

Variance

The variance of a random variable is the expected value of the squared difference of its value from the mean. $\text{var}[X]=E\left[(X-E[X])^2\right]$var[X]=E[(XE[X])2].

Our aim is to find an expression for the variance of $Z=aX+b$Z=aX+b. We could begin by considering the variance of $X+b$X+b and we will make use of the result obtained above for the mean. By substitution into the formula, we have

$\text{var}[X+b]$var[X+b] $=$= $E\left[(X+b-E[X+b])^2\right]$E[(X+bE[X+b])2]
  $=$= $E\left[(X+b-E[X]-b)^2\right]$E[(X+bE[X]b)2]
  $=$= $E\left[(X-E[X])^2\right]$E[(XE[X])2]
  $=$= $\text{var}[X]$var[X]

Next, we consider the variance of $aX$aX. According to the formula and again making use of the results for the mean, we have

$\text{var}[aX]$var[aX] $=$= $E\left[(aX-E[aX])^2\right]$E[(aXE[aX])2]
  $=$= $E\left[(aX-aE[X])^2\right]$E[(aXaE[X])2]
  $=$= $E\left[a^2(X-E[X])^2\right]$E[a2(XE[X])2]
  $=$= $a^2E\left[(X-E[X])^2\right]$a2E[(XE[X])2]
  $=$= $a^2\text{var}[X]$a2var[X]

 

Putting these together, we can state

$\text{var}[aX+b]=a^2\text{var}[X]$var[aX+b]=a2var[X]

In terms of the standard deviation, we have

$\sigma_{aX+b}=a\sigma_X$σaX+b=aσX

 

Example 1

The uniform probability density function on the interval $(0,1)$(0,1) is given by $f(x)=1$f(x)=1. A random variable $X$X having this density function is transformed by $Y=3X-1$Y=3X1. Find the mean and variance of $X$X and $Y$Y.

The mean of X is $E[X]=\int_0^1\ x\mathrm{d}x=\frac{1}{2}.$E[X]=10 xdx=12.

We have seen that $\text{var}[X]=E[(X-E[X])^2]=E[X^2-2XE[X]+(E[X])^2]=E[X^2]-\left(E[X]\right)^2$var[X]=E[(XE[X])2]=E[X22XE[X]+(E[X])2]=E[X2](E[X])2

Therefore,

$\text{var}[X]$var[X] $=$= $\int_0^1\ x^2\mathrm{d}x-\left(\int_0^1\ x\mathrm{d}x\right)^2$10 x2dx(10 xdx)2
  $=$= $\frac{1}{3}-\frac{1}{4}$1314
  $=$= $\frac{1}{12}$112

We could apply the same procedures to find $E[Y]$E[Y] and $\text{var}[Y]$var[Y] after first working out what its PDF must be, but we can with much less effort use the results for linear functions of random variables. Thus,

$E[Y]=E[3X-1]=3E[X]-1=3\times\frac{1}{2}-1=\frac{1}{2}$E[Y]=E[3X1]=3E[X]1=3×121=12 and,

$\text{var}[Y]=\text{var}[3X-1]=3^2\text{var}[X]=9\times\frac{1}{12}=\frac{3}{4}$var[Y]=var[3X1]=32var[X]=9×112=34.

Example 2

The function $e^{-x}$ex where $x\in(0,\infty)$x(0,) serves as a probability density function because $\int_0^{\infty}\ e^{-x}\mathrm{d}x=1$0 exdx=1. Find the mean and variance of a random variable $X$X with this density function and the mean and variance of $W=2X-10$W=2X10.

The mean of $X$X is $\int_0^{\infty}\ xe^{-x}\mathrm{d}x$0 xexdx. Integrating by parts gives $E[X]=\left[-(1+x)e^{-x}\right]_0^{\infty}=1$E[X]=[(1+x)ex]0=1

Therefore, the mean of $Y$Y is $2\times1-10=-8$2×110=8.

The variance of $X$X is $E[X^2]-\left(E[X]\right)^2$E[X2](E[X])2. This is, $\int_0^{\infty}\ x^2e^{-x}\mathrm{d}x-1^2$0 x2exdx12. Integrating by parts gives $\text{var}[X]=\left[-e^{-x}(x^2+2x+2)\right]_0^{\infty}-1=2-1=1$var[X]=[ex(x2+2x+2)]01=21=1

Therefore, the variance of $Y$Y is$2^2\times1=4$22×1=4.

 

Worked Examples

Question 1

A uniform probability density function, $P\left(x\right)$P(x), is positive over the domain $\left[20,50\right]$[20,50] and $0$0 elsewhere.

  1. State the function defining this distribution.

    $P\left(x\right)$P(x) $=$= $\editable{}$ if $\editable{}\le x\le\editable{}$x
    $\editable{}$ for all other values of $x$x
  2. Use integration to determine the expected value of the distribution.

  3. Use integration to determine the variance $V\left(X\right)$V(X) of the distribution.

  4. The distribution is transformed to the random variable $Y$Y by $Y=2X+4$Y=2X+4. Calculate $E\left(Y\right)$E(Y), the expected value of $Y$Y.

  5. Determine the variance $V\left(Y\right)$V(Y) of the random variable $Y$Y as defined by $Y=2X+4$Y=2X+4.

  6. Determine the standard deviation $SD\left(Y\right)$SD(Y) of $Y$Y.

    Round your answer to one decimal place.

Question 2

The probability density function of a random variable $X$X and its graph are given below:

$p\left(x\right)$p(x) $=$= $k\sin x$ksinx     if $0\le x\le\pi$0xπ
$0$0     for all other values of $x$x

Loading Graph...

  1. Solve for the value of $k$k.

  2. Find the derivative of $\sin x-x\cos x$sinxxcosx.

  3. Hence determine the expected value of the distribution. Express your answer in exact form in terms of $\pi$π.

  4. The distribution is transformed to the random variable $Y$Y by $Y=11-2X$Y=112X. Calculate $E\left(Y\right)$E(Y), the expected value of $Y$Y.

    Express your answer in exact form in terms of $\pi$π.

question 3

Consider the following.

  1. Select the option which shows two distributions with the same expectation.

    A

    B

    C

    D
  2. Consider the graphs of the two distributions below.

    Which of the following scenarios could be modelled by these two distributions?

    The length of two species of fish A and B which have the same average length, but where the length in of species B varies more than in the other.

    A

    The battery life of two different brands of phones A and B, where phone A has a longer average battery life but the variation in battery life among the two phones is the same.

    B

 

 

What is Mathspace

About Mathspace