Sum vs difference of random variables

By Jude Wallis · Published

For a sum, the means add: μX+Y=μX+μY\mu_{X+Y} = \mu_X + \mu_Y. For a difference, the means subtract: μX−Y=μX−μY\mu_{X-Y} = \mu_X - \mu_Y. When X and Y are independent, the variances add in both cases, so the sum and the difference have the same standard deviation, σX2+σY2\sqrt{\sigma_X^2 + \sigma_Y^2}.

This page is general statistics background. The Fall 2026 AP Statistics course has no topic on sums and differences of random variables: the College Board revisions page lists combining random variables, topic 4.9 of the old course, among the topics removed. The idea of adding variances still explains the standard deviation formulas for a difference of two sample proportions (topic 3.9) and a difference of two sample means (topic 4.6).

Sum vs difference of random variables: the short answer

Adding or subtracting two random variables creates a new random variable with its own mean and standard deviation. Two rules give them.

  • Means follow the operation. The mean of X+YX + Y is μX+μY\mu_X + \mu_Y, and the mean of X−YX - Y is μX−μY\mu_X - \mu_Y.
  • Variances always add, as long as XX and YY are independent. The variance of X+YX + Y and the variance of X−YX - Y are both σX2+σY2\sigma_X^2 + \sigma_Y^2.

So a sum and a difference of the same two independent variables differ in center and match in spread. The only sign that changes between the two cases is the one in the mean.

The sum of two random variables

Let XX and YY be random variables and let S=X+YS = X + Y. The mean of the sum is the sum of the means:

μX+Y=μX+μY\mu_{X+Y} = \mu_X + \mu_Y

This rule holds for any two random variables, independent or not.

If XX and YY are independent, the variance of the sum is the sum of the variances:

σX+Y2=σX2+σY2σX+Y=σX2+σY2\sigma_{X+Y}^2 = \sigma_X^2 + \sigma_Y^2 \qquad \sigma_{X+Y} = \sqrt{\sigma_X^2 + \sigma_Y^2}

Standard deviations do not add. If σX=4\sigma_X = 4 and σY=3\sigma_Y = 3, the standard deviation of the sum is 16+9=25=5\sqrt{16 + 9} = \sqrt{25} = 5, which is less than 4+3=74 + 3 = 7. The sum varies less than the two standard deviations added together because a high value of one variable is often offset by a low value of the other.

The difference of two random variables

Let D=X−YD = X - Y. The mean of the difference is the difference of the means, in the same order:

μX−Y=μX−μY\mu_{X-Y} = \mu_X - \mu_Y

If XX and YY are independent, the variance of the difference is still the sum of the variances:

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

The plus sign is correct. Subtracting a variable does not cancel its variability. The difference X−YX - Y is large when XX is high and YY is low, and small when XX is low and YY is high, so the uncertainty in YY widens the range of the difference just as it widens the range of the sum. Formally, X−YX - Y is X+(−1)YX + (-1)Y, and multiplying YY by −1-1 multiplies its variance by (−1)2=1(-1)^2 = 1.

The order of subtraction matters for the mean and not for the spread. Y−XY - X has mean μY−μX\mu_Y - \mu_X and the same standard deviation as X−YX - Y.

The differences side by side

FeatureSum, X+YX + YDifference, X−YX - Y
MeanμX+μY\mu_X + \mu_YμX−μY\mu_X - \mu_Y
Mean rule needs independenceNoNo
Variance (independent)σX2+σY2\sigma_X^2 + \sigma_Y^2σX2+σY2\sigma_X^2 + \sigma_Y^2
Standard deviation (independent)σX2+σY2\sqrt{\sigma_X^2 + \sigma_Y^2}σX2+σY2\sqrt{\sigma_X^2 + \sigma_Y^2}
Order of the variablesDoes not matterChanges the sign of the mean
Typical questionTotal of two quantitiesGap between two quantities, or which is larger
With means 25 and 30, SDs 4 and 3Mean 55, SD 5Mean −5-5 for X−YX - Y, SD 5

One more fact is useful for probability calculations: if XX and YY are independent and each is normally distributed, then X+YX + Y and X−YX - Y are also normally distributed, with the means and standard deviations given above.

When to use which

Use a sum when the question is about a total: the combined time for two legs of a trip, the total weight of two packages, the total score on two sections.

Use a difference when the question compares two quantities: how much longer one task takes than another, or the probability that one variable exceeds the other. "Find the probability that YY is greater than XX" becomes "find P(Y−X>0)P(Y - X > 0)", a question about a single random variable.

Check independence before using the variance rule. Two measurements on unrelated individuals are usually independent. Two measurements on the same individual often are not. If the variables are not independent, the mean rules still work and the variance rule cannot be relied on.

Adding two independent copies of a variable is also different from doubling one copy. For independent X1X_1 and X2X_2 with the same distribution, X1+X2X_1 + X_2 has standard deviation σ2\sigma\sqrt{2}. The variable 2X2X has standard deviation 2σ2\sigma, by the rule for a linear transformation of a random variable.

The classic mix-up and how to avoid it

The most common error is subtracting variances for a difference. With σX=4\sigma_X = 4 and σY=3\sigma_Y = 3, the standard deviation of X−YX - Y is 16+9=5\sqrt{16 + 9} = 5. Subtracting gives 16−9≈2.65\sqrt{16 - 9} \approx 2.65, which is wrong, and with the variables in the other order the same mistake would put a negative number under the square root.

The second error is adding standard deviations directly: 4+3=74 + 3 = 7. Convert each standard deviation to a variance by squaring, add the variances, then take one square root at the end.

The third error is using the variance rule without independence. The rule σX2+σY2\sigma_X^2 + \sigma_Y^2 is guaranteed only for independent variables.

A working routine avoids all three: write the two means and combine them with the sign in the question, square the two standard deviations, add them with a plus sign, and take the square root. The reason for squaring is covered in standard deviation vs variance.

Total commute time and the gap between two commutes

A worker's morning commute time X is normal with mean 25 minutes and standard deviation 4 minutes. The evening commute time Y is normal with mean 30 minutes and standard deviation 3 minutes. Assume X and Y are independent. Find the mean and standard deviation of the total daily commute and of the difference Y minus X. Then find the probability that the evening commute is shorter than the morning commute.

  1. Mean of the total: μX+Y=25+30=55\mu_{X+Y} = 25 + 30 = 55 minutes.

  2. Variance of the total, using independence: σX+Y2=42+32=16+9=25\sigma_{X+Y}^2 = 4^2 + 3^2 = 16 + 9 = 25, so σX+Y=25=5\sigma_{X+Y} = \sqrt{25} = 5 minutes.

  3. Mean of the difference D=Y−XD = Y - X: μD=30−25=5\mu_D = 30 - 25 = 5 minutes.

  4. Variance of the difference: variances still add, so σD2=32+42=25\sigma_D^2 = 3^2 + 4^2 = 25 and σD=5\sigma_D = 5 minutes, the same as for the total.

  5. Translate the question. The evening commute is shorter when Y<XY < X, which is D<0D < 0.

  6. Because XX and YY are independent and normal, DD is normal with mean 5 and standard deviation 5. Standardize: z=0−55=−1z = \frac{0 - 5}{5} = -1.

  7. The area to the left of z=−1z = -1 is 0.15870.1587.

The total commute has mean 55 minutes and standard deviation 5 minutes. The difference Y−XY - X has mean 5 minutes and standard deviation 5 minutes. The probability that the evening commute is shorter than the morning commute is P(D<0)≈0.1587P(D < 0) \approx 0.1587.

Two tickets, one ticket doubled, and a difference

A raffle ticket's payout has mean 3 dollars and standard deviation 6 dollars. Find the mean and standard deviation of the total payout of two independent tickets, of the payout of one ticket counted twice, and of the difference in payout between two independent tickets.

  1. Two independent tickets, X1+X2X_1 + X_2. Mean: 3+3=63 + 3 = 6 dollars.

  2. Variance: 62+62=36+36=726^2 + 6^2 = 36 + 36 = 72, so the standard deviation is 72≈8.49\sqrt{72} \approx 8.49 dollars.

  3. One ticket doubled, 2X2X. Mean: 2(3)=62(3) = 6 dollars. Standard deviation: 2(6)=122(6) = 12 dollars, because multiplying a variable by 2 multiplies its standard deviation by 2.

  4. Compare. Both have mean 6 dollars, and the standard deviations are about 8.49 dollars and 12 dollars. Two separate tickets can offset each other, and one ticket counted twice cannot.

  5. Difference of two independent tickets, X1−X2X_1 - X_2. Mean: 3−3=03 - 3 = 0 dollars.

  6. Variance of the difference: 36+36=7236 + 36 = 72, so the standard deviation is 72≈8.49\sqrt{72} \approx 8.49 dollars, the same as for the sum.

Two independent tickets: mean 6 dollars, standard deviation about 8.49 dollars. One ticket doubled: mean 6 dollars, standard deviation 12 dollars. Difference of two independent tickets: mean 0 dollars, standard deviation about 8.49 dollars.

Frequently asked questions

Why do you add variances when subtracting random variables?

Because the variability of each variable adds uncertainty to the result, whether you add or subtract. The difference X−YX - Y equals X+(−1)YX + (-1)Y, and multiplying YY by −1-1 leaves its variance unchanged, so the variances add for independent variables.

Can I add standard deviations instead of variances?

No. For independent variables the variances add, and the standard deviation is the square root of that total. With standard deviations 4 and 3, the combined standard deviation is 16+9=5\sqrt{16 + 9} = 5. Adding directly would give 7, which is too large.

Do the rules work if the variables are not independent?

The mean rules do: means add for a sum and subtract for a difference in every case. The variance rule does not. Adding variances is guaranteed only when the two random variables are independent; without independence it can give the wrong answer.