# How to explain that the sums of numerators over sums of denominators isn't the same as the mean of ratios?

I am a teaching assistant for an intro programming course. One assignment asked for the averages of a certain ratio, but most students, rather than returning $$\frac{\text{sum of all ratios}}{\text{total ratios}},$$ gave $$\frac{\text{sum of the numerators used to calculate those ratios}}{\text{sum of the denominators used to calculate those ratios}}.$$ That isn't the same, but I can't put to words why it isn't the same; I just know not to do it and can't explain to these students why it gives the wrong result. What's the intuitive way to explain it?

The ratios in question were mileages per gallon. The question wanted the average mpg of all trips, and asked for miles driven and gallons of fuel used separately.

• I wonder if the error is more blindly coding while ignoring the meaning? Would the same misunderstandings arise were this a hand-calculation exercise? – Joseph O'Rourke Sep 28 '19 at 0:18
• Google for "Simpson's paradox" and find a lot of interesting examples. – Gerald Edgar Sep 28 '19 at 1:15
• Just a side comment: Guest's answer below shows that this is a good counter-example to the idea that one should give "real life" context to math questions. If the point was to measure the capacity to manipulate fractions, then the exercise failed by making the interpretation of the question the critical step. – Benoît Kloeckner Sep 28 '19 at 8:25
• @BenoîtKloeckner It isn't a counterexample! It is a beautiful example of how providing a real world context allows for open ended conversation about the meaning of the computations, and will prepare students to select meaningful computations in the future. Along the way they can get practice "drilling" both interpretations just by answering questions which naturally arise from the discussion. They might even remember something, since there was a lively debate! – Steven Gubkin Sep 28 '19 at 21:20
• @StevenGubkin: it is really depending on one's goal. While it is a commendable goal to work on interpretation of a somewhat informal problem into mathematics (modelling), it is too often the case when one's goal is to practice a given mathematical task, and this goal is messed up with by a sloppy real word context. – Benoît Kloeckner Sep 29 '19 at 7:57

The problem is with the question, not with the students' answers. The question is ambiguous and I think the students' answer is actually much better than yours.

Suppose I drive a thousand miles at 25mpg and you drive one mile at 35mpg. What's the average fuel efficiency? Your answer is 30mpg but I honestly can't think of any situation in which that is a meaningful or useful number. The students' answer is 25-and-a-bit mpg, which is a good measure of how far it can be expected to travel on one gallon of fuel.

Analogously, if I buy a thousand apples at 50c each and you buy one apple at 40c, you're claiming that the average price per apple is 45c, and your students are claiming that it's a hair under 50c.

One observation is that (sum of numerators) divided by (sum of denominators) is not well defined.

For example, let's work with the two ratios $$a=\frac01$$ and $$b=\frac11$$.

The ratio of the sum of numerators to sum of denominators is $$\frac12$$.

However, we can also write $$a=\frac03$$ and $$b=\frac22$$. Now the ratio is $$\frac25$$, which is not equal to $$\frac12$$!

• Nice counterexample. Note also that $\displaystyle \dfrac{a}{b}\leq \dfrac{a+c}{b+d}\leq \dfrac{c}{d}$. – user5402 Sep 28 '19 at 14:26
• You're changing the weights by doing so, which shouldn't be allowed. Especially if you're describing physical quantities. A 200 mile trip in 2h shouldn't be replaced by a 100 mile in 1h simply because they have the same average speed. – Eric Duminil Sep 28 '19 at 18:27
• @EricDuminil: if you read the OP, there is hardly any mention of weights and physical quantities. On a side note, the method of dividing the two sums (as opposed to averaging the individual ratios) is used in calculating the "earned run average" in baseball. – user52817 Sep 28 '19 at 18:34
• @JiK: I see what you mean: 30 mpg, right? In that case, it makes sense to calculate the average like OP proposed. – Eric Duminil Sep 28 '19 at 22:14
• @Paracosmiste You're claiming that, for arbitrary $a$, $b$, $c$, $d$, $\tfrac{a}b\le\tfrac{c}d$. That's simply not true. – David Richerby Sep 30 '19 at 7:48

It actually depends on exactly what you're asking. Or even what you SHOULD be asking.

If you want the average profitability of all the 500+ operators in the Permian, you could just average all the profit margin percentages. This is taking the ratios (profit/revenue) for each company and averaging them. It corresponds to your expected (mean) profit margin if you just picked an operator at random.

If instead, I take all the profits and divide by all the revenues, this would give me the average profitability of the INDUSTRY (operators in the Permian). Often this is actually the question you are asking, or should be asking. IOW, you want the revenue-weighted average profit margin.

The same point would apply if you were, say doing sampling of different size demographic categories and were interested in the total population polling estimate. You need to weight by size of the buckets. (Or just take the totals, which is mathematically equivalent.)

Since we don't know exactly what you asked, or how precise you were, it's hard to say if the students were wrong. Of course, they may have been. But I would just check.

EDIT:

Responding to your edited-in update on the question. There's actually still some ambiguity about what you are (or should be) asking. But if I had to guess, the student's way is more likely giving the desired answer. (IOW, ratio the totals, rather than average the ratios.) IOW, "average fuel efficiency" should be "gallon" weighted. That's the one impacting your pocketbook.

In addition, you may find that there's some correlation of fuel efficiency with trip length. The engine being warmed up, operates more efficiently. Also, highway speeds may be more efficient than slow speeds. Also the issue of frequent stops and starts.

So if I were selecting a car, I would want the one that has the better average fuel efficiency (total miles/total gallons). Ideally with something approximating my type of usage. But I definitely wouldn't want to skew things by saying one "10 mile, 1 gallon" trip mean the same as one "100 mile, 5 gallon" trip in terms of the importance to my pocketbook.

• Yes. The OPs answer is good if you care about which kind of car to buy (you can compare to the average efficiency of the cars). The student's answer is good if you want to keep track of how efficiently gasoline is being used across the whole economy. – Steven Gubkin Sep 27 '19 at 15:57

I like guest's answer. To elaborate, here is a possible question to ask them.

You take two trips in your car:

• Trip 1 is a 100 mile drive that takes you 2 hours.

• Trip 2 is a 200 mile drive that takes you 1 hour.

(a) What is the average speed of your car?

(b) What is the average speed on an average trip?

The answer to (a) is $$\frac{100 \text{ miles} + 200 \text{ miles }}{2 \text{ hours } + 1 \text{ hour }} = \frac{300 \text{ miles }}{3 \text{ hours }} = 100 \text {mph}$$.

The answer to (b) is $$\frac{\frac{100 \text{ miles }}{2 \text{ hours }} + \frac{200 \text{ miles }}{1 \text{ hour }}}{2} = \frac{50 \text{ mph} + 200 \text{ mph} }{2} = 125 \text {mph}$$.

You need to be very clear about the question if you prefer one of these answers.

• The premise of (b) being misused scares me. It would offer a coach the math showing his track team running speeds that routinely blow away a 4 minute mile. i.e. 100m sprints are far faster than actual mile runs. 9 instances of that data with one instance of the mile run makes for odd results. This is why I was hoping OP would offer the example, and not blindly use the math. Either way. – JTP - Apologise to Monica Sep 28 '19 at 12:57
• (b) is wrong. What does "average speed of a trip" even mean? We speak of a speed of a particle. The average speed is the weighted arithmetic mean of the 2 speeds : $\displaystyle v=\dfrac{t_1v_1+t_2v_2}{t_1+t_2}=\dfrac{2\times\dfrac{100}{2}+1\times\dfrac{200}{1}}{2+1}$ which gives the same answer as (a). – user5402 Sep 28 '19 at 14:24
• Does this sound better to you @EricDuminil ? "Here are 100 players and their hits and at-bats. (a) What is the overall batting average for the league? (b) What is the batting average of an average player?" – Chris Cunningham Sep 28 '19 at 20:36
• @ChrisCunningham: I have no clue whatsoever about baseball (that's a baseball example, right?), but this does sound more appropriate, yes. – Eric Duminil Sep 28 '19 at 21:03
• OK, hopefully these comments combined with my edit to include the phrase "an average trip" improve the answer a bit. The whole situation is still a bit wonky. – Chris Cunningham Sep 29 '19 at 2:16

Allow me to offer another example:
Imagine you and your best friend both want to buy a new smart phone. The phone you have chosen will cost you 300€ but your friend chooses a phone that will cost as much as 600€! Luckily, you have two vouchers that will give you a discount:
The second voucher will give you 50% off your entire purchase.

Which voucher do you choose?

Ratios are a tricky thing, because the ratio of two large numbers can be the same as the ratio of two small numbers. But in most real life applications, the number of elements used to determine these ratios (i.e. averages) are just as important. Because an average over a great number of elements (e.g. people in a survey) is more meaningful than an average over a select few. Therefore, they can not always be compared one-to-one.

Think of an example with two ratios: 1/3 and 4/5.

When you add the numerators, and divide this by the sum of the denominators, you get (1 + 4)/(3 + 5) = 5/8. Now, think about what is happening with the denominators - the denominator of the first ratio should only act on the first numerator. But instead, when you add the ratios in this way, the denominator of the first ratio is acting on both numerators. Likewise for the second denominator.

However, when you average the two ratios, like this

(1/3 + 4/5) / 2 = (5/15 + 12/15) / 2 = 17/30

the denominators of the ratios work together to act on the numerators.

Division has a higher order of precedence than addition. Thus, division should be carried out first, rather than combining the ratios.

Hope this makes sense and helps you assist them.

Do you want students to think or not? According to your logic, when I do a 300 mile trip with a car and a day later reverse it in the drive way, the average mpg value of those two days can be calculated by taking the mpg value of the first day and averaging it with the (likely much higher) mpg value of the second day that saw almost no mileage and almost no gas use.

Don't use "textbook examples" for meaningless calculations and then complain that the students were unable to make the calculations as meaningless as you wanted them done. That's teaching them neither mathematics nor its proper application.

• Sometimes the correct answer to a question is to ask a different question. This is one of those times. If the 'customer' wants an average of ratios, then the only responsible thing to do is ask for clarification. – Mike Spivey Sep 28 '19 at 13:12
• -1, This is needlessly hostile to the questioner. Edit your answer from the point of view of helping an educator, or delete it. – Chris Cunningham Sep 28 '19 at 16:50

I think that the most interesting application of (sum of numerators/sum of denominators) “addition” is to continued fractions. For example, if you want to calculate the continued fraction expansion of the square root of 2,start with 1/0 and 0/1 and “add” them in the following way:

In the top row you put the results of the “adding” that are greater then the square root of 2 , in the bottom row the results that are less then the square root of 2, and you always “add” the last two results from the different sides of the square root of 2 . The pattern of 1 down, 2 up, 2 down, 2 up, 2 down, 2 up, … is the continued fraction expansion of the square root of 2 :