Tutorials › Introduction to Statistics › How Shifts and Rescaling Change Mean and Variance

Random Variables and Expected Value · Tutorial 363 of 996

How Shifts and Rescaling Change Mean and Variance

Derive and use the formulas for the mean and variance of a shifted or rescaled random variable, including changes of measurement units.

Intermediate 10 min read

What You'll Learn

  • State the conditions under which the shift and rescaling formulas apply.
  • Derive the expected value of aX + b from the probability mass function.
  • Derive why variance is multiplied by a² and is unchanged by a shift.
  • Apply the rules to centering a variable and converting temperature units.
  • Distinguish how rescaling affects variance from how it affects standard deviation.

Why Shifts and Rescaling Matter

The numerical values used to describe a quantity can change without changing the underlying uncertainty. A temperature can be reported in Celsius or Fahrenheit; a measurement can be expressed relative to zero or relative to a chosen baseline. To understand how such changes affect a random variable, we need to track its expected value and variance separately.

A shift changes the location of every possible value by the same amount. Rescaling multiplies every value by the same factor. The expected value changes with both operations, but variance responds differently: a shift leaves it unchanged, while multiplying values by \(a\) multiplies variance by \(a^2\). The square matters because variance measures squared deviations from the mean.

Definition: Let \(X\) be a discrete random variable with a finite or countably infinite set of possible values, and let \(p_x=P(X=x)\). Assume \(E(X^2)<\infty\), so that \(X\) has a finite expected value and variance. For constants \(a\) and \(b\), define the transformed random variable \(Y=aX+b\). The constant \(b\) shifts the values, and \(a\) rescales them (and reverses their order if \(a<0\)).

The Transformation Rules

Write \(\mu_X=E(X)\) and \(\operatorname{Var}(X)=E[(X-\mu_X)^2]\). The transformation rules give the expected value and variance of \(Y\) directly from those of \(X\).

Theorem: If \(X\) is a discrete random variable with finite second moment and \(Y=aX+b\), where \(a\) and \(b\) are constants, then
$$ E(aX+b)=aE(X)+b,\qquad \operatorname{Var}(aX+b)=a^2\operatorname{Var}(X). $$

These results also cover \(a=0\): then \(Y=b\) is constant, so its expected value is \(b\) and its variance is zero. When \(a\ne 0\), multiplying by \(a\) changes the scale of deviations. Adding \(b\) changes the location but not the deviations from the mean.

Why the Rules Hold

For a discrete variable, expectation is a probability-weighted sum over all possible values. The support may be finite or countably infinite. The finite-second-moment assumption ensures the sums used below converge, including when the support is infinite.

First, \(E(X^2)<\infty\) implies \(E|X|<\infty\): by the Cauchy–Schwarz inequality, \(E|X|\leq \sqrt{E(X^2)}\). Thus \(E(X)\) is finite. Also,

$$ \sum_x |ax+b|p_x \leq |a|\sum_x |x|p_x+|b|\sum_x p_x =|a|E|X|+|b|<\infty. $$

Therefore, the expectation series for \(aX+b\) is absolutely convergent. We can split and combine its terms without changing its value:

$$ \begin{aligned} E(aX+b) &=\sum_x (ax+b)p_x\\ &=a\sum_x xp_x+b\sum_x p_x\\ &=aE(X)+b, \end{aligned} $$

because the probabilities over the support sum to one.

For variance, the result just proved gives \(E(Y)=a\mu_X+b\). The deviation of \(Y\) from its own mean is therefore

$$ Y-E(Y)=(aX+b)-(a\mu_X+b)=a(X-\mu_X). $$

Squaring this deviation and taking its expectation proves the variance rule:

$$ \begin{aligned} \operatorname{Var}(aX+b) &=E\left[\{(aX+b)-E(aX+b)\}^2\right]\\ &=E\left[a^2(X-\mu_X)^2\right]\\ &=a^2E\left[(X-\mu_X)^2\right]\\ &=a^2\operatorname{Var}(X). \end{aligned} $$

For a countably infinite support, the last expectation is a sum of nonnegative terms \(a^2(x-\mu_X)^2p_x\). It is finite: \((x-\mu_X)^2\leq 2x^2+2\mu_X^2\), and both \(E(X^2)\) and \(\mu_X^2\) are finite. Thus the derivation applies to finite and countably infinite discrete distributions under the stated condition.

Worked Applications

Worked Example: Shifting and Rescaling a Discrete Variable

Suppose a hypothetical variable \(X\) takes values \(0,1,2\) with probabilities \(0.20,0.50,0.30\), respectively. Define \(Y=10X+5\). Find the expected value and variance of \(Y\). The probabilities are nonnegative and sum to \(1\), and \(X\) has finite support, so its moments are finite.

First calculate the moments of \(X\):

$$ E(X)=0(0.20)+1(0.50)+2(0.30)=1.10. $$

Using the computational formula \(\operatorname{Var}(X)=E(X^2)-[E(X)]^2\),

$$ E(X^2)=0^2(0.20)+1^2(0.50)+2^2(0.30)=1.70, \qquad \operatorname{Var}(X)=1.70-(1.10)^2=0.49. $$

Here \(a=10\) and \(b=5\). Therefore,

$$ E(Y)=10(1.10)+5=16.0,\qquad \operatorname{Var}(Y)=10^2(0.49)=49.0. $$

As a check, \(Y\) takes values \(5,15,25\) with the same respective probabilities. Its mean is \(5(0.20)+15(0.50)+25(0.30)=16.0\). Its variance is \(0.20(5-16)^2+0.50(15-16)^2+0.30(25-16)^2=49.0\), matching the transformation rules.

Worked Example: Converting Celsius to Fahrenheit

Consider a hypothetical discrete Celsius temperature \(C\) that is \(0\), \(10\), or \(20\) degrees with probabilities \(0.25\), \(0.50\), and \(0.25\). The Fahrenheit conversion is \(F=\frac{9}{5}C+32\). The probabilities sum to \(1\), and the variable has finite support, so the rules apply.

In degrees Celsius,

$$ E(C)=0(0.25)+10(0.50)+20(0.25)=10, $$

and

$$ E(C^2)=0^2(0.25)+10^2(0.50)+20^2(0.25)=150, \qquad \operatorname{Var}(C)=150-10^2=50\ \text{°C}^2. $$

The conversion has \(a=\frac{9}{5}\) and \(b=32\), so

$$ E(F)=\frac{9}{5}(10)+32=50\ \text{°F}, \qquad \operatorname{Var}(F)=\left(\frac{9}{5}\right)^2(50)=162\ \text{°F}^2. $$

Directly, the Fahrenheit values are \(32,50,68\). Their expected value is \(32(0.25)+50(0.50)+68(0.25)=50\) degrees Fahrenheit, and their variance is \(0.25(32-50)^2+0.50(50-50)^2+0.25(68-50)^2=162\) degrees Fahrenheit squared. The offset \(32\) changes the mean, while the scale factor \(\frac{9}{5}\) changes the variance.

Worked Example: Shifting a Variable to Have Mean Zero

Suppose a hypothetical discrete variable \(X\) takes values \(1,2,4\) with probabilities \(0.50,0.25,0.25\). Define the centered variable \(Z=X-E(X)\). Find its mean and variance. The probabilities sum to \(1\), and finite support ensures finite moments.

The mean and variance of \(X\) are

$$ E(X)=1(0.50)+2(0.25)+4(0.25)=2, $$

and

$$ E(X^2)=1^2(0.50)+2^2(0.25)+4^2(0.25)=5.50, \qquad \operatorname{Var}(X)=5.50-2^2=1.50. $$

Since \(Z=X-2\), the transformation has \(a=1\) and \(b=-2\). Thus

$$ E(Z)=2-2=0,\qquad \operatorname{Var}(Z)=1^2(1.50)=1.50. $$

Indeed, \(Z\) takes values \(-1,0,2\) with probabilities \(0.50,0.25,0.25\). Its mean is \((-1)(0.50)+0(0.25)+2(0.25)=0\), and its variance is \(1^2(0.50)+0^2(0.25)+2^2(0.25)=1.50\). Centering moves the mean to zero without changing the spread measured by variance.

Interpreting the Effect on Variability

A translation \(X+b\) adds the same amount to every outcome and to the mean. Each deviation from the mean stays exactly the same, so variance is unchanged. A multiplication \(aX\) multiplies each deviation by \(a\); squaring those deviations multiplies their contribution to variance by \(a^2\). If \(a<0\), the values are reversed in order, but the squared deviations are still multiplied by \(a^2\).

Standard deviation is the square root of variance. Consequently,

$$ \operatorname{SD}(aX+b)=|a|\operatorname{SD}(X). $$

The absolute value is necessary because standard deviation cannot be negative. Variance has squared units: if \(X\) is measured in seconds, its variance is measured in seconds squared. If values are converted from seconds to milliseconds, then \(a=1000\), so the variance is multiplied by \(1{,}000{,}000\), while the standard deviation is multiplied by \(1000\).

For a temperature conversion, the offset changes the location of the distribution, and the scale factor changes the size of its standard deviation. For a change of origin alone, such as recording height relative to a chosen reference level, variance and standard deviation do not change.

Common Mistake

A frequent error is to say that multiplying a random variable by \(a\) multiplies its variance by \(a\). That confuses variance with a measurement on the original scale. Variance uses squared deviations, so the factor is \(a^2\). For example, if every value is doubled, each deviation from the mean doubles, and each squared deviation becomes four times as large. Therefore the variance is multiplied by \(4\), not \(2\). The standard deviation, which is not squared, is multiplied by \(2\).

Another useful distinction is that adding \(b\) does not add \(b\) to the variance. It adds \(b\) to the expected value, but leaves every deviation from that expected value unchanged. The formulas describe different features of the distribution: expected value tracks location, while variance tracks squared spread.

Key takeaway: For \(Y=aX+b\), the expected value is \(aE(X)+b\), but the variance is \(a^2\operatorname{Var}(X)\). A shift changes location without changing spread; rescaling changes variance by the square of the scale factor.

Check Your Understanding

For each question, identify the shift or scale factor and show how it affects the expected value or variance.

  1. If \(E(X)=6\) and \(\operatorname{Var}(X)=3\), find \(E(4X-2)\) and \(\operatorname{Var}(4X-2)\).
  2. A variable is shifted upward by 12 units. What happens to its expected value, variance, and standard deviation?
  3. If \(Y=-3X+1\), describe how the transformation affects the order of values, the expected value, and the variance.
  4. A measurement in meters is converted to centimeters by multiplying by 100. By what factors do its standard deviation and variance change?
  5. Why does a Celsius-to-Fahrenheit conversion change variance by the square of \(\frac{9}{5}\), rather than by the square of 32?