AP Statistics Audio Lectures

Transformations of Random Variables

by Arnold Kling

Transformations of Random Variables

by Arnold Kling

To hear the lecture, click here.

In probability, we work a lot with transformations of random variables. These include a linear transformation of one random variable (Y = a + bX) as well as sums of two or more random variables (W = X + Y).

For example, a waiter earns money based on the amount that people spend at his tables, which is a random variable. Let the amount that they spend be X. If he gets $20 a night in base pay plus 20 percent in tips, then his income Y = $20 + 0.2X.

If X is the amount that one table spends and Y is the amount that another table spends, then the total of both tables, W, is X + Y.

Adding a constant to a random variable or distribution changes the mean but not the standard deviation. You move the center, but everything else moves along with it. If you raised the waiter's base pay by $5, his mean would go up but his standard deviation would not change. He gets $5 more every night.

Let X be the original random variable, let Y be the transformed variable, and let a be a constant. Then if Y = X + a, then

m_{Y} = m_{X} + a

s_{Y} = s_{X}

So, if you add 10 degrees to the temperature in DC every day, the mean would be 10 degrees higher but the variance and standard deviation would not change.

Multiplying a constant times a random variable changes the mean and the standard deviation. If Y = bX, then

m_{Y} = bm_{X}

s_{Y} = bs_{X}

In general, if Y = a + bX, then

m_{Y} = a + bm_{X}

s_{Y} = bs_{X}

So, if X is the amount that gets spent at the waiter's tables, then

Y = $20 + 0.2X

m_{Y} = $20 + 0.2m_{X}

s_{Y} = 0.2s_{X}

If W = X + Y, then

m_{W} = m_{X} + m_{Y}

s_{W} = SQRT(s^{2}_{X} + s^{2}_{Y} + 2 s_{XY})

Note that we *cannot* simply add the standard deviations of X and Y to get the standard deviation of W. We have to take the square root of the variances, including the covariance term s_{XY}. Covariance will be explained next semester.

Note the resemblance to FOIL (X+Y)^{2} = (X+Y)(X+Y)

In many problems, it is given that X and Y are independent, so that covariance is zero. In that case

s_{W} = SQRT(s^{2}_{X} + s^{2}_{Y}) (only if X and Y are independent)

Suppose our waiter has four tables, each with a mean spending of $100 and a standard deviation of $20. Assume that spending on the four tables is independent. Then for the total amount spent, we have

mean = $100 + $100 + $100 + $100 = $400

standard deviation = SQRT(400 + 400 + 400 + 400) = $40

When X is a random variable, and Y = a + bX, we have

m_{Y} = a + bm_{X}

s_{Y} = bs_{X}

When X and Y are random variables, and W = X + Y, we have

m_{W} = m_{X} + m_{Y}

s_{W} = SQRT(s^{2}_{X} + s^{2}_{Y} + 2 s_{XY})

s_{W} = SQRT(s^{2}_{X} + s^{2}_{Y}) (only if X and Y are independent)