# Why is 33 1/3% of 240 = 79.992 wrong?

I'm embarrassed to ask this fundamental question among questions of particle filters but : my daughter just had this marked wrong on a test.

The teacher said the answer was 1/3 of 240 = 80.

On one level I understand this using fractions (80 * 3 = 240) -- and at another level, typing this into a calculator (since we don't have infinite numbers) yields 79.9999999992. Doing this using fractional math makes sense but that's only because 240 "cleanly" has 3 pieces -- but how does this work decimally when we can't have infinite numbers and have to round up (which to me seems more an approximation than 79.992)

Why is my daughter's answer wrong? Can't they both be correct at different levels of precision? Is one answer fundamentally the correct one and why?

I hope I have the gist of my question down and thanks in advance for your answers.

-
Forgot to mention: Wolframalpha says it's 80 wolframalpha.com/input/?i=33+1%2F3%25+of+240 –  amoricai Jun 14 '11 at 17:43
The moral is - don't use a calculator unless you have to. –  Yuval Filmus Jun 14 '11 at 18:27
I'm not sure what you mean by "we don't have infinite numbers" and "we can't have infinite numbers". The only way to represent the number $1/3$ exactly using decimal digits is $0.333333\dots$, with an infinite number of $3$s. This doesn't mean that the number $1/3$ is somehow more suspect or has less of an existence than $1/2$ or $1/5$; it just means that the decimal representation is not the best way to represent this number. And if you do not correctly do arithmetic on infinite strings of digits (which is sometimes possible, BTW, as it is here), then you will get a wrong answer. –  ShreevatsaR Jun 14 '11 at 19:15
Besides, in base 3, 1/3 doesn't repeat. It's $0.1$. Just do all your divisions by 3 in base 3: it's easier! –  trutheality Jun 14 '11 at 21:06

$33\frac{1}{3} \%$ is one-third (exactly)... One-third of 240 is 80, exactly. You computed an approximation to that answer. But why use such an ugly approximation when the exact answer is easy to compute, even without a calculator?

The calculator found 79.9999992, say, but the correct way to round that to 3 decimals is not 79.992 but 80.000 .

79.992, it turns out, is what you get if you use $33.33$ instead of $33\frac{1}{3}$

-

One of the earliest introductions to "word problems" in school is the use of "and" and "of". I was taught (back in the 1970s) that "and" usually means plus and "of" usually means times.

So "one third of 300" would be $1/3 \times 300 = 100$.

Now you ask, "what if the number isn't a multiple of 3?" Then we use fractions to express the left-over part. "One third of 10" is $3~1/3$. A calculator might instead tell you that it is "3.333332" but that is because the calculator has a limited number of storage cells (aka memory) whereas math has no artificial limits like this. So the calculator's answer is wrong if you want an exact answer.

Any time you see a calculator output "79.9999999992" you should strongly suspect that the answer is "80" and that the approximation is off by a little bit. This is not certain, but it's always worth investigating.

So, to answer your last question, yes your daughter's answer is wrong. Most teachers won't accept "correct to different levels of precision" since they will deem this problem simple enough that approximation isn't necessary and an exact answer should be given.

If you daughter had written "1/3 of 240 $\approx$ 79.9999992" she would be correct, but likely would still lose points due to the fact that an exact answer is within her ability.

-

Honestly, neither $79.9999999992$ nor $79.992$ are correct at any level of percision if you're doing decimal (base 10) math. That 2 shouldn't be there. It could be a 9 if you forgot to round, but not a 2.

Besides, $79.9999999992$ should round to 80.000 anyway.

The reason that 2 is there is because the calculator, being a calulator, has to do all its math in base 2. So let's see:

$1/3$ in binary is $0.01010101\ldots$. Suppose I have a really cheap calculator that only keeps 8 binary digits after the decimal. It would store $1/3$ as $0.01010101$ which actually equals exactly $0.33203125$ in decimal.

$240$ in binary is $11110000$.

Multiplying those binary numbers gives $1001111.1011$ in binary, which is $79.6874$ (even worse than your case, which is expected).

The lessons to take away from this:

• Don't trust calculators (especially that calculator) with repeating fractions
• Remember to round correctly
• If you ever need to do very high precision calculations on a computer, you'll run into this problem again.
-
Of course, even the hypothetical really cheap calculator that keeps only seven significant bits of $1/3$ (as in your example) would probably round $1001111.1011$ to seven significant places as well, giving $1010000$ which is exactly $80$ (unless its "rounding" was truncation, in which case it would give $1001111$ or $79$). The calculator wouldn't say $79.6874$ in any case. :-) –  ShreevatsaR Jun 14 '11 at 20:59
@ShreevastaR: Good point, unless it's a fixed-point calculator that has at least eight bits for the integer part and eight bits for the fractional part. –  trutheality Jun 14 '11 at 21:03

Well, this is just being extremely picky about the solution to this problem (Personally). But the only difference is the truncating error in the calculator. For calculators, since they don't store decimal numbers in fraction forms, they use decimals to approximate until the allocated memory is full for that number. In this sense, a 'good' calculator should return '79.999999999999999' without the 2 on the end. Also, as a side note, $$79.\overline{9} = 80.$$

-
a "good" calculator would give 80 because those have higher precision than they ever display, the result is rounded, and in this case it would be rounded correctly. –  trutheality Jun 14 '11 at 17:59
@trutheality Hence the quotations around the word 'good'... –  Nicolas Villanueva Jun 14 '11 at 18:41
It's not about being picky. It's a simple question, therefore they expect an exact answer -- not an estimation. The question was probably asked to teach the students to think for themselves and solve question like these the right way. That is, without using a calculator. I doubt they would be as picky if it was a question about calculating the area under $f(x)=x^{2}+\log(\sqrt(x))$ where $0 \le x \le 5$ and she was a few decimals off. –  kba Jun 15 '11 at 0:03

It is common for floating point number to exhibit "fairy dust" out in the insignificant digits. Computers store numbers in binary format. Only dyadic rationals (integer/2**n) are stored exactly; even these are limited by the word size of the machine.

One must pay attention in scientific calculations to significant figures.

This reminds me of another important principle: do not test for equality of floating point numbers.

-