The question you opened
Two classes, one average
Ten students in the morning class average 90. Thirty in the evening class average 70.
What is the average across all forty students?
75
The two classes contribute 900 and 2,100 points, so 3,000 points are spread over 40 students. That comes to 75.
Turn the averages back into totals. Ten students averaging 90 scored 900 points between them. Thirty averaging 70 scored 2,100. Together that is 3,000 points held by 40 students, so the combined average is 3,000 over 40, which is 75. The answer 80 comes from averaging the two averages, and that is only correct when the groups are the same size. Here the evening class is three times larger, so its 70 carries three times the weight.
The combined figure lands three quarters of the way from 90 down to 70, which is exactly 75. The general formula is a weighted average: multiply each group average by its size, add, and divide by the total size. A shortcut for two groups is to move from one average toward the other by the fraction the second group represents.
Thirty out of 40 is three quarters, so travel three quarters of the 20 point gap, which is 15 points down from 90. Averaging averages is one of the most common ways a correct set of numbers produces a wrong summary. A company with a 5 percent margin on 10 million of revenue and a 40 percent margin on 100,000 does not average 22.5 percent.
A driver with 20 miles per gallon over 300 miles and 40 over 100 miles does not average 30. The check that catches it every time is to ask what the average is an average of. If the underlying units are people, dollars, or miles rather than the group averages themselves, the totals have to be rebuilt before dividing.
Technique: Weight each group by its size