Math Core

Lesson 4.7 · Probability, Random Variables and Distributions

Combining random variables

Real quantities are often built from other random quantities: a total time is the sum of several steps, a profit is revenue minus cost, and a fare is a fixed fee plus a charge per mile. This lesson shows how the mean and standard deviation change when you transform a random variable or combine two of them.

Linear transformations

Suppose Y=a+bXY = a + bX. Adding a constant aa shifts every value, so it shifts the mean but doesn't change the spread. Multiplying by bb stretches every value and every distance between values, so it multiplies both the mean and the standard deviation.

Linear transformation of a random variable

If Y=a+bXY = a + bX, then

μY=a+b μX,σY=∣b∣ σX,σY2=b2σX2.\mu_Y = a + b\,\mu_X, \qquad \sigma_Y = |b|\,\sigma_X, \qquad \sigma_Y^2 = b^2 \sigma_X^2.

The shape of the distribution stays the same (for b>0b > 0).

Worked example: Taxi fare

A taxi company charges a $3 pickup fee plus $2.50 per mile. The length XX of a randomly chosen trip has mean 66 miles and standard deviation 2.42.4 miles. Find the mean and standard deviation of the fare F=3+2.5XF = 3 + 2.5X.

Solution.

μF=3+2.5(6)=18,σF=2.5(2.4)=6.\mu_F = 3 + 2.5(6) = 18, \qquad \sigma_F = 2.5(2.4) = 6.

The mean fare is $18, with a standard deviation of $6. The $3 fee raises every fare by the same amount, so it doesn't affect the spread.

Sums and differences

Now combine two random variables XX and YY.

Means always add or subtract. For any random variables,

μX+Y=μX+μY,μX−Y=μX−μY.\mu_{X+Y} = \mu_X + \mu_Y, \qquad \mu_{X-Y} = \mu_X - \mu_Y.

Variances add, for both sums and differences, when XX and YY are independent. This surprises many students. Combining two sources of randomness always makes the result more variable, whether you add or subtract them.

Variances add for independent random variables

If XX and YY are independent,

σX+Y2=σX2+σY2,σX−Y2=σX2+σY2.\sigma_{X+Y}^2 = \sigma_X^2 + \sigma_Y^2, \qquad \sigma_{X-Y}^2 = \sigma_X^2 + \sigma_Y^2.

So σX±Y=σX2+σY2\sigma_{X \pm Y} = \sqrt{\sigma_X^2 + \sigma_Y^2}. Standard deviations do not add; only variances do.

Why does the difference have the larger spread? Think of the extremes. X−YX - Y is largest when XX is big and YY is small, and smallest when XX is small and YY is big, so its range is the range of XX plus the range of YY.

Worked example: Getting ready in the morning

The time XX a student spends showering has mean 88 minutes and standard deviation 22 minutes. The time YY spent getting dressed has mean 66 minutes and standard deviation 1.51.5 minutes. Assume XX and YY are independent. Find the mean and standard deviation of the total time T=X+YT = X + Y.

Solution.

μT=8+6=14 minutes.\mu_T = 8 + 6 = 14 \text{ minutes}.

σT2=22+1.52=4+2.25=6.25,σT=6.25=2.5 minutes.\sigma_T^2 = 2^2 + 1.5^2 = 4 + 2.25 = 6.25, \qquad \sigma_T = \sqrt{6.25} = 2.5 \text{ minutes}.

Notice σT=2.5\sigma_T = 2.5, not 2+1.5=3.52 + 1.5 = 3.5.

Sums of several independent copies

If X1,X2,…,XnX_1, X_2, \dots, X_n are independent and each has mean μ\mu and standard deviation σ\sigma, the total has mean nμn\mu and standard deviation n σ\sqrt{n}\,\sigma. This is different from nXnX (one value multiplied by nn), which has standard deviation nσn\sigma. Several independent values partly cancel each other's randomness; one value multiplied does not.

Combining normal random variables

If XX and YY are independent and both normally distributed, then X+YX + Y and X−YX - Y are also normally distributed. That lets you compute probabilities with zz-scores.

Worked example: Which takes longer?

Using the morning routine above, suppose both times are approximately normal. Find the probability that the student spends less time showering than getting dressed on a randomly chosen morning.

Solution. Let D=X−YD = X - Y. We want P(D<0)P(D \lt 0).

μD=8−6=2,σD=22+1.52=2.5.\mu_D = 8 - 6 = 2, \qquad \sigma_D = \sqrt{2^2 + 1.5^2} = 2.5.

DD is normal, so

z=0−22.5=−0.8,P(D<0)=P(Z<−0.8)≈0.2119.z = \dfrac{0 - 2}{2.5} = -0.8, \qquad P(D \lt 0) = P(Z \lt -0.8) \approx 0.2119.

On about 21%21\% of mornings, dressing takes longer than showering.

Common mistake

The most common mistake is subtracting variances (or standard deviations) for a difference. Variances always add for independent random variables. A second mistake is adding standard deviations directly; add the variances, then take the square root. And the variance rule requires independence: state that assumption, and question it when it's doubtful.

Practice

Practice 1

A random variable XX has mean 1010 and standard deviation 22. Let Y=4X−3Y = 4X - 3. Find the mean of YY.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

For Y=4X−3Y = 4X - 3 in the previous problem, find the standard deviation of YY.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 3

XX and YY are independent random variables with σX=3\sigma_X = 3 and σY=4\sigma_Y = 4. Find the standard deviation of X+YX + Y.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 4

XX and YY are independent with μX=50\mu_X = 50, σX=6\sigma_X = 6, μY=30\mu_Y = 30 and σY=8\sigma_Y = 8. Find the standard deviation of X−YX - Y.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

A store's daily revenue RR has mean $2,000 and standard deviation $300. Its daily costs CC have mean $1,400 and standard deviation $200. Assuming RR and CC are independent, what are the mean and standard deviation of daily profit R−CR - C?

Practice 6

The weight of a randomly chosen apple has mean 1212 ounces and standard deviation 22 ounces. Three apples are chosen at random, independently. Find the standard deviation of their total weight. Round to 2 decimal places.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

A commuter's morning commute time is approximately normal with mean 2222 minutes and standard deviation 44 minutes. The evening commute is approximately normal with mean 2525 minutes and standard deviation 33 minutes. Assume the two times are independent. Find the probability that the total commuting time on a randomly chosen day is more than 5555 minutes. Round to 4 decimal places.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.