Sub topic 10
What Happens When Values Are Added, Scaled, or Changed
This chapter assumes you can already compute the mean, median, mode, range, and population standard deviation of a short list, and that you can do basic algebra with negative numbers. Here you will predict how those five statistics move when a data set is modified. The GRE often asks for the direction or size of the change, so you can usually answer without recomputing anything.
The running example is [2, 4, 4, 4, 5, 5, 7, 9]. Its mean is 5, median 4.5, mode 4, range 7, and standard deviation 2.
Two kinds of modification
Every change to a data set falls into one of two groups.
- Transforming every value. You add the same constant to every value, or multiply every value by the same constant. The result is a clean rule for each statistic.
- Changing the membership of the set. You add a value, remove a value, or change one value. The effect depends on where the affected value sits relative to the mean, the median, and the extremes.
Adding a constant to every value
Adding k to every value slides the whole data set along the number line. Nothing about its shape changes.
- The mean, median, and mode each increase by k.
- The range does not change, because the largest and smallest values both move by k, and the difference between them stays the same.
- The standard deviation does not change, because each deviation from the mean is (x + k) − (mean + k) = x − mean.
Subtracting a constant works the same way, with k negative.
Multiplying every value by a constant
Multiplying every value by k stretches the data set about zero.
- The mean, median, and mode are each multiplied by k.
- The range is multiplied by |k|.
- The standard deviation is multiplied by |k|.
The absolute value matters when k is negative. Multiplying by −2 flips the data set around zero, so the old largest value becomes the new smallest. The center values are multiplied by −2, but the spread measures remain positive. Range and standard deviation can never be negative.
If k = 0, every value becomes 0. The mean and median are 0, and both range and standard deviation collapse to 0.
Combining both: the rule for 3x + 10
When you apply a transformation such as 3x + 10, apply the multiplication and the addition to the center statistics. Apply only the multiplication, using its absolute value, to the spread statistics.
| Statistic | Add k | Multiply by k | Apply ax + b | Column | Column | Column | Column |
|---|---|---|---|---|---|---|---|
| Mean | mean + k | mean × k | a × mean + b | ||||
| Median | median + k | median × k | a × median + b | ||||
| Mode | mode + k | mode × k | a × mode + b | ||||
| Range | unchanged | range × \ | k\ | \ | a\ | × range | |
| Standard deviation | unchanged | sd × \ | k\ | \ | a\ | × sd |
For the running example with 3x + 10:
- Mean: 3(5) + 10 = 25.
- Median: 3(4.5) + 10 = 23.5.
- Range: 3(7) = 21, with no +10.
- Standard deviation: 3(2) = 6, with no +10.
import statistics
data = [2, 4, 4, 4, 5, 5, 7, 9]
transformed = [3 * x + 10 for x in data]
print(statistics.mean(transformed)) # 25
print(statistics.median(transformed)) # 23.5
print(max(transformed) - min(transformed)) # 21
print(statistics.pstdev(transformed)) # 6.0A related fact is that variance, the square of the standard deviation, is multiplied by k², not by |k|. If the question asks about variance, square the multiplier.
Adding, removing, or changing a single value
Now suppose only one value is affected. Each statistic responds differently.
Mean
Compare the new value to the current mean.
- Adding a value above the mean raises the mean. Adding a value below it lowers the mean.
- Adding a value exactly equal to the mean leaves the mean unchanged.
- Changing one value by an amount d changes the sum by d, so the mean changes by d divided by the count. Replacing 9 with 17 in our 8-value set adds 8 to the sum, so the mean rises by 8/8 = 1, from 5 to 6.
Median
The median depends on position, not size. A value that is far larger or smaller than the median moves the median by the same amount as a value just barely above or below it.
- Adding a value above the current median moves the median up to the next position, or averages in the next one. Adding a value below moves it down.
- Changing a value that does not cross the middle leaves the median unchanged. In our set, replacing 9 with 17 leaves the median at 4.5, because 9 and 17 are both above the middle.
- When the count goes from odd to even or from even to odd, the median definition switches between a single middle value and the average of two.
Range
The range changes only when the new, removed, or changed value is the minimum or maximum, or when it becomes a new extreme. Adding a value between the current minimum and maximum never changes the range.
Standard deviation
Standard deviation measures typical distance from the mean.
- Adding a value far from the mean increases the standard deviation.
- Adding a value equal to the mean decreases it, because the sum of squared deviations stays the same while the count grows.
- Adding a value close to the mean, closer than the current standard deviation, usually decreases it. Adding one far from the mean increases it.
import statistics
def summarize(values):
return (
round(statistics.mean(values), 2),
statistics.median(values),
max(values) - min(values),
round(statistics.pstdev(values), 2),
)
data = [2, 4, 4, 4, 5, 5, 7, 9]
print(summarize(data)) # (5, 4.5, 7, 2.0)
print(summarize([2, 4, 4, 4, 5, 5, 7, 17])) # (6, 4.5, 15, 4.36)
print(summarize(data + [20])) # (6.67, 5, 18, 5.08)
print(summarize(data[:-1])) # (4.43, 4, 5, 1.4)The four lines show these patterns:
- Replacing 9 with 17 raises the mean, keeps the median, widens the range, and increases the standard deviation.
- Adding 20 pulls the mean up and the median only slightly, from 4.5 to 5, while the range and standard deviation jump.
- Removing 9 lowers the mean, drops the median to 4, shrinks the range, and lowers the standard deviation.
Adding the mean itself
A frequent GRE pattern asks what happens when you add a value equal to the current mean. The mean stays the same. The range stays the same, because the new value lies inside the existing extremes. The standard deviation decreases, because the sum of squared deviations is unchanged but is divided by a larger count.
import statistics
data = [2, 4, 4, 4, 5, 5, 7, 9]
with_mean_added = data + [statistics.mean(data)]
print(statistics.mean(with_mean_added)) # 5
print(statistics.pstdev(data)) # 2.0
print(statistics.pstdev(with_mean_added)) # less than 2.0The sum of squared deviations is 32 in both cases. The variance falls from 32/8 = 4 to 32/9, which is about 3.56, so the standard deviation falls from 2 to about 1.89.
The mode under changes
The mode follows the same transformation rules as the mean and median: it shifts with addition and scales with multiplication. For single-value changes, it changes only if the modified value creates a new highest frequency or breaks a tie. A set can have several modes or none, so check carefully before claiming the mode changed.
Summary of the traps
- Never add the shift constant to the range or standard deviation.
- Use the absolute value of a negative multiplier for range and standard deviation.
- Adding a value equal to the mean lowers the standard deviation but leaves the mean unchanged.
- Changing a value that stays on the same side of the median leaves the median unchanged.
- When the count changes, recheck whether the median is one value or the average of two.
Exercise
A data set has mean 12, median 11, range 20, and standard deviation 4. Every value is multiplied by −2 and then increased by 5. Find the new mean, median, range, and standard deviation.
Show answer
Mean: −2(12) + 5 = −19. Median: −2(11) + 5 = −17. Range: |−2| × 20 = 40. Standard deviation: |−2| × 4 = 8. The +5 shift affects only the center statistics.
Exercise
Five numbers have a mean of 12. One of the numbers, 12, is replaced by 22. What is the new mean? Is the standard deviation more likely to rise or fall, and why?
Show answer
The sum rises by 10, so the mean rises by 10/5 = 2, to 14. The standard deviation is likely to rise, because the replaced value moved from the old mean to a point well away from the new mean, which increases the typical distance from the center.
Exercise
The list 3, 6, 6, 9, 11 has a median of 6. A sixth value, 6, is added. What happens to the median, the range, and the standard deviation?
Show answer
The sorted list becomes 3, 6, 6, 6, 9, 11, so the median is the average of the third and fourth values, 6 and 6, which is 6. It is unchanged. The range stays 8, because 6 is between the extremes. The mean was 35/5 = 7 and the new value 6 is one unit from it, which is less than the original spread, so the standard deviation decreases slightly.