If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

### Course: AP®︎/College Statistics>Unit 8

Lesson 3: Transforming random variables

# Impact of transforming (scaling and shifting) random variables

Linear transformations (addition and multiplication of a constant) and their impacts on center (mean) and spread (standard deviation) of a distribution.

## Want to join the conversation?

• I get why adding k to all data points would shift the prob density curve, but can someone explain why multiplying the data by a constant would stretch and squash the graph?
• Scaling a density function doesn't affect the overall probabilities (total = 1), hence the area under the function has to stay the same one.

If you multiply the random variable by 2, the distance between min(x) and max(x) will be multiplied by 2. Hence you have to scale the y-axis by 1/2.

For instance, if you've got a rectangle with x = 6 and y = 4, the area will be x*y = 6*4 = 24. If you multiply your x by 2 and want to keep your area constant, then x*y = 12*y = 24 => y = 24/12 = 2. Scaling the x by 2 = scaling the y by 1/2.

If you didn't scale down your y-axis, then your cumulative probabilities will be >1, which is not possible.
• Why does k shift the function to the right and not upwards?
• Because an upwards shift would imply that the probability density for all possible values of the random variable has increased (at all points). But this would consequently be increasing the area under the probability density function, which violates the rule that the area under any probability density function must be = 1 . Furthermore, the reason the shift is instead rightward (or it could be leftward if k is negative) is that the new random variable that's created simply has all of its initial possible values incremented by that constant k. 0 goes to 0+k. 1 goes to 1+k. 2 goes to 2+k, etc, but the associated probability density sort of just slides over to a new position without changing in its value.
• In real life situation, when are people add a constant in to the random variable
• If you are a teacher grading a test, you will have a distribution of scores. You are considering giving some extra credit because there was an internet outage during the exam and no one could use a calculator for ten minutes. You want to see how much the scores will be affected by different amounts of extra credit, and want to determine what would benefit all the students the most. Extra credit is represented by a constant, k, and grades are represented by a random variable X.

Now we have a new distribution that is Y = X + k
• What if you scale a random variable by a negative value? If we scale multiply a standard deviation by a negative number we would get a negative standard deviation, which makes no sense. I think you should multiply the standard deviation by the absolute value of the scaling factor instead.
• @rdeyke Let's consider a Random Variable X with mean 2 and Variance 1 (Standard Deviation also natuarally is then 1).

The mean gets multiplied by the constant k, let's say it is -2. As originally, your mean was 2, now new mean would be -2*2 = -4

Next comes the Variance. Variance is scaled by k squared. Hence, it would be multiplied by (-2)^2 which is 4. The Standard Deviation is always the positive root of the Variance, and hence, the SD in this case would come out to be 2.
• At , the graph of the variable Z is flatted because it was scaled up and must keep the same area. So how is it possible to Z have a bigger mean than X's one?
Sal says Z(mean) = k times X(mean)
• What do the horizontal and vertical axes in the graphs respectively represent?
• The graphs are density curves that measure probability distribution.
The horizontal axis represents the random variable (e.g. X).
The vertical axis represents the probability outcome for each possible value of the random variable.
• Do the mean and standard deviation formulas for transformation apply to any probability density function or just the normal one?
• The formulas for the transformation of means and standard deviations apply generally, not just to the normal distribution. For any probability distribution, adding a constant to a random variable shifts its mean without affecting its standard deviation, while multiplying a random variable by a constant scales both its mean and standard deviation by that constant.
(1 vote)
• What does it mean adding k to the random variable X? Does it mean that we add k to all values X (i.e. possible outcomes of X)?
• I think that is a good question. I think since Y = X+k and Sal was saying that Y is also a random variable, the equation is meant to show that Y is an incremented version of X. For eg. If X was representing the amount of rain falling in April, Y would be the amount of rain in mm falling in April plus some constant number 'k', let's say the number is 2.5. Thus the normal distribution for X is shifted 2.5mm to the right. Hope this helps.