why does double rounding 9.46 give 10 but "regular" rounding gives 9?

$\begingroup$

What's the correct way to round, or estimate, a number to a specified precision?

Starting with wikipedia:

Rounding a number twice in succession to different precisions, with the latter precision being coarser, is not guaranteed to give the same result as rounding once to the final precision except in the case of directed rounding. For instance rounding 9.46 to one decimal gives 9.5, and then 10 when rounding to integer using rounding half to even, but would give 9 when rounded to integer directly.

That just makes no sense to me. What's the justification for different results? If 9.46 rounds to 9.5 why doesn't it then round to 10?

edit

I didn't ask the question correctly. The question, I think and hope I mean to ask, is why, or how, perhaps, double rounding and regular rounding can give different results (using half to even), and I suppose the answer is that there are different rounding algorithms which give different results.

I was thinking there should be one, correct answer as to what 9.46 rounded to the nearest integer rounds to. Double rounding, apparently, gives ten while "regular" rounding gives 9. Guess it just seems odd or weird to me to not double round.

$\endgroup$ 16

3 Answers

$\begingroup$

That's exactly what Wikipedia is saying:

As you note: If you round first to one decimal place, then $9.46$ first rounds to $9.5$. If you round then to the nearest integer, it rounds to $10$.

But if you round $9.46$ directly to the nearest integer, then since $0.46 < 0.5$, $9.46$ rounds to $9$.

The point of the Wikipedia article is to show that rounding successively, first to one decimal place, and then to the nearest integer, can yield different results than rounding directly to the nearest integer, in this case.


Another way to look at why, when rounding directly from $9.46$ to the nearest integer results in $9$, note the following:

The "distance" of $9.46$ from $10$ is $.54$. The "distance" of $9.46$ from $9$ is only $.46$. So $9.46$ is closer to $9$ than it is to $10$. So, when rounding directly to the nearest integer, $9.46$ rounds to $9$.

$\endgroup$ 9 $\begingroup$

Another approach is to think of "rounded numbers" as a different sort of object than real numbers. So $9.5(1\text{dp})$ is not the same as $9.5$, it's not quite a number at all.

On this understanding, the rules for rounding off "rounded numbers" have a hole in them. If $x = 9.4 (1\text{dp})$ then $x = 9 (\text{nearest int.})$. If $x =9.6 (1\text{dp})$ then $x = 10 (\text{nearest int.})$. But if $x = 9.5 (1\text{dp})$, then we can't know whether whatever real number $x$ is would be closer to $9$ or to $10$, so the nearest integer to $x$ is undefined. Double rounding isn't always allowed.

Using set notation, we would define $9.5(1\text{dp}) := \{y \in \mathbb{R}: 9.45 \leq y < 9.55\}$. Conventionally, $\mathbb{R}$ means the set of real, unrounded numbers.

Then in the formula $9.46 = 9.5(1\text{dp})$ the equals sign is actually standing in for set membership $\in$. The rules for arithmetic with "rounded numbers" are just that a formula is true exactly if it would be true for every real number in the set. So sometimes we get undefined results.

For example $2 \times 9.46(2\text{dp}) = 18.9(1\text{dp})$, but $2 \times 9.46(2\text{dp})$ is undefined to 2 d.p., because depending on what the real number chosen from the set was, we might get either $18.92 (2\text{dp})$ or $18.93 (2\text{dp})$. This is why in practical calculations you always need to measure, where possible, to more digits of precision than you need in your answer.

$\endgroup$ 1 $\begingroup$

To summarize info from comments and answers and provide a slightly different twist ...

Consider that you are on an island located at 9.46 and you are asked to jump to a nearest island located at each tenth (0.1). You look around and see two islands around you. One at 9.4, one at 9.5. One closest to you is at 9.5, so you jump there.

Next, you are asked to jump to the closest island located at a whole number. You look around and see that there are two, one at 9, one at 10 and both are equally close. Convention states for you to jump to one that is higher in value. There is a 50% chance that this convention is wrong and it happens to be wrong here.

Convention did not take into consideration the fact that you just came from a different island in a specific direction. Convention did not take into consideration the previous direction of rounding, and it sent you in the wrong direction.

What we see here is

  • Convention does not take into consideration direction of the previous rounding
  • Convention is 50% wrong in the case of rounding on a one-dimensional number line
  • Convention happened to be wrong here.

How to mitigate

If you want to be more precise, i.e. if you double-round numbers in some algorithm, then implement directional rounding. Remember direction of the previous rounding and when you come to the 50/50 decision, make you rounding direction to go in the opposite direction from the previous one. i.e. first jump from 9.46 to 9.5 was in the positive direction. Next jump should be from 9.5 to 9, in the negative direction.

Alternatively, store more significant digits for precision and round once, whenever needed.

$\endgroup$

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like