Sub topic 7
How an Average Moves When Items Are Added, Removed or Replaced
This chapter assumes you are comfortable with the arithmetic mean as total divided by count, and with solving a linear equation in one variable. You do not need alligation yet. The key habit from the previous chapter carries over: always think of an average as a sum of values.
The core idea: track the total, not the average
An average hides a total. If the mean of n items is A, the total is n × A. Every change to the group (an item joins, leaves or is swapped) changes the total in a way you can state exactly. The new average is then the new total divided by the new count.
This gives a three-step routine that works for every problem in this chapter:
- Convert each average into a total (average × count).
- Apply the change to the total and to the count.
- Convert back to an average, or solve for the unknown item.
The routine is slower than the shortcuts below, but it is always correct. Use it whenever a shortcut leaves you unsure.
Adding one item
Suppose 5 numbers have an average of 20. A sixth number is added and the average becomes 22. The old total is 5 × 20 = 100. The new total is 6 × 22 = 132. The added number is 132 − 100 = 32.
n = 5
avg = 20
new_avg = 22
new_item = new_avg * (n + 1) - avg * n
print(new_item) # 32
# Shortcut: the new item exceeds the old average by (n + 1) * (rise in average)
print(avg + (n + 1) * (new_avg - avg)) # 32The shortcut has a clear reason. The new item first has to bring itself up to the old average of 20. Then it must supply an extra 2 to each of the 6 members, which is 6 × 2 = 12. So the item is 20 + 12 = 32.
In words: the new item equals the old average plus (new count) × (rise in average). If the average falls, the same formula works with a negative rise, so the item is below the old average.
Removing one item
Removal is the mirror image. Five numbers average 20, and removing one leaves an average of 18 for the remaining 4. The old total is 100. The new total is 4 × 18 = 72. The removed item is 100 − 72 = 28.
The shortcut view: the removed item was 20 plus whatever it was holding up. The 4 remaining members each lost 2 from their average, so the item was 20 + 4 × 2 = 28.
The removed item equals the old average plus (remaining count) × (fall in average). Notice that the count used here is the remaining count. When an item is added, you use the new count, which is also the count after the change. In both cases the count after the change is the multiplier.
Replacing one item
When one item is swapped for another, the count does not change. Only the total changes, by the difference between the two items.
The change in the total is (new item − old item). The change in the average is that difference divided by n.
For example, 8 people have an average weight of 60 kg. One person weighing 52 kg is replaced by a new person, and the average rises by 1.5 kg. The total rises by 8 × 1.5 = 12 kg. So the new person weighs 52 + 12 = 64 kg.
n = 8
old_item = 52
rise_in_avg = 1.5
new_item = old_item + n * rise_in_avg
print(new_item) # 64.0The rule: new item = old item + n × (change in average). This one is the simplest of the three because n never changes.
Summary table of the three moves
| Change | Count after | Unknown item equals |
|---|---|---|
| One item added | n + 1 | old average + (n + 1) × (change in average) |
| One item removed | n − 1 | old average + (n − 1) × (fall in average) |
| One item replaced | n | old item + n × (change in average) |
For a removal where the average rises, the sign flips. If removing an item makes the average go up, the removed item was below the old average, so subtract: old average − (n − 1) × (rise).
A picture of what happens
The diagram shows the three operations as changes to the total and the count.
Multiple items and groups
The same routine handles several items at once. Only the totals change.
Suppose the average of 10 numbers is 40. Two numbers, 25 and 35, are removed. What is the average of the remaining 8?
- Old total: 10 × 40 = 400.
- Removed total: 25 + 35 = 60.
- New total: 340, over 8 items, giving an average of 42.5.
You can also combine two groups. If a class of 30 has an average of 60 and a class of 20 has an average of 70, the combined total is 1800 + 1400 = 3200 over 50 students, so the average is 64. This is a weighted average, where the class sizes act as weights. The result sits closer to 60 because that group is larger.
groups = [(30, 60), (20, 70)] # (count, average)
total = sum(n * a for n, a in groups)
count = sum(n for n, a in groups)
print(total / count) # 64.0Consecutive changes and the "shift per member" view
Many CAT problems describe a change in terms of how much each member's value moves relative to the average. A useful way to think is that the average is a balance point. An item above the average pulls the mean up, and an item below pulls it down. The size of the pull is the gap divided by the new count.
For example, when an item 12 above the average is added to a group of 5 (so the new count is 6), the average rises by 12 ÷ 6 = 2. This is the shortcut run in reverse. When you know the gap between the new item and the old average, you get the change in average by dividing by the new count.
def new_average_after_adding(old_avg, n, item):
"""Average after adding one item to a group of n items."""
return old_avg + (item - old_avg) / (n + 1)
print(new_average_after_adding(20, 5, 32)) # 22.0This form is the fastest in practice. You compare the new item with the current average, divide that gap by the new count, and shift the average by the result.
Edge cases and common errors
Using the wrong count
The most frequent error is multiplying by n when the problem needs n + 1 or n − 1. Before you apply a shortcut, write down the count after the change and check it against the table above.
Mixing up the direction of the sign
If an item is added and the average rises, the item is above the old average. If an item is removed and the average rises, the item was below the old average. Ask yourself which direction makes sense before you compute.
Ages and the passage of time
Age problems add a twist. After t years, every member of a group of n people is t years older, so the total rises by n × t and the average rises by exactly t. If a member leaves or joins, the new person's age is measured at the new time. For example, the average age of a family of 5 is 30 today. Three years ago, a baby was not yet born, so the average age of the other 4 members three years ago was (150 − 4 × 3 − 3 ... ) and so on. Always compute the total at one fixed moment first, then adjust.
A clean example: the average age of 4 people is 25. A fifth person joins and the average becomes 27. The fifth person is 25 + 5 × 2 = 35 years old. Five years later, the average of all five is 27 + 5 = 32, because each person is 5 years older.
Replacement of several items by items with a known average
If 3 items with an average of 50 are replaced by 3 items with an average of 56, the total rises by 3 × 6 = 18, and the group average rises by 18 ÷ n. Do not forget to divide by the full group size, not by 3.
Impossible or unusual results
A solved item can be negative or fractional. Whether that is allowed depends on the problem. A negative weight or a fractional number of people signals an arithmetic slip, so recheck the totals.
Worked example: a mixed problem
The average score of 12 students in a test is 64. When the teacher's marks for two students are corrected, one score goes from 48 to 60 and the other from 70 to 58. What is the new average?
- Old total: 12 × 64 = 768.
- Change in total: (60 − 48) + (58 − 70) = 12 − 12 = 0.
- New total: 768, so the average stays 64.
Here the two corrections cancel out. Checking whether the net change is zero is a quick test before doing any division.
A second example uses a removal and an addition in one step. A cricketer has an average of 40 over 9 innings. In the 10th innings he scores enough to raise the average to 44. Using the formula, the score is 40 + 10 × 4 = 80. If instead he wanted the average after 10 innings to be 45, the score would be 40 + 10 × 5 = 90.
def score_needed(avg, innings, target_avg):
return avg + (innings + 1) * (target_avg - avg)
print(score_needed(40, 9, 44)) # 80
print(score_needed(40, 9, 45)) # 90Choosing between the total method and the shortcut
| Situation | Best method |
|---|---|
| One item added or removed, change in average given | Shortcut formula |
| Several items changed at once | Total method |
| Two groups merged | Weighted average |
| Averages given for sub-groups that overlap | Total method with a careful list of who is in each group |
| You are unsure of the sign | Total method, then check the sign |
On a timed test, the shortcut saves about 20 seconds per question. A wrong sign costs the whole question, so run a quick sanity check: the item you found must lie above the old average if the average rose on adding, and below it if the average fell.
Exercise
The average of 7 numbers is 30. One number is removed and the average of the remaining numbers becomes 28. What was the removed number? Then, if instead a new number replaced one of the original 7 and the average rose to 33, how much larger was the new number than the one it replaced?
Show answer
Removal: old total = 7 × 30 = 210. New total = 6 × 28 = 168. Removed number = 210 − 168 = 42. Replacement: the total rises by 7 × (33 − 30) = 21, so the new number is 21 larger than the one it replaced.
Exercise
A group of 15 workers has an average age of 32. Five years later, 3 of them retire at ages that were 40, 44 and 48 at the time of retiring. What is the average age of the remaining 12 workers at that time?
Show answer
After 5 years, the average age of all 15 is 32 + 5 = 37, so the total is 15 × 37 = 555. The retirees' total is 40 + 44 + 48 = 132. The remaining total is 555 − 132 = 423, and the average is 423 ÷ 12 = 35.25.
Exercise
A batsman has an average of 48 after 11 innings. In the 12th innings he scores 36. What is his new average? Then find the score he would need in the 13th innings to bring the average back to 48.
Show answer
After 11 innings the total is 11 × 48 = 528. After the 12th innings the total is 564 over 12 innings, so the average is 47. To return to 48 after 13 innings the total must be 13 × 48 = 624, so the 13th score is 624 − 564 = 60.