Thursday 12 March 2015

How Do You Round a Negative to the Nearest Whole Number?


How should you round -1.5 to the nearest whole number?

Almost anyone you ask this to will reply without thinking: -2, because 5 rounds up.

Spot the mistake!

Rounding -1.5 to -2 is not, in fact, rounding up, it is rounding down, because -2 < -1.5.

Of course, that doesn't mean rounding to -2 is necessarily wrong, but it does disobey the general rule that "5 rounds up". But this rule of thumb that we maths teachers use, have we actually thought it through?

For now, let's just consider positive numbers, and the reason we round things that have .5 up. Numbers whose decimal bit starts with .5 and then has loads of numbers after it, e.g. 3.532423765 would obviously round up, as they are more than half way between the two whole numbers. By deciding that 3.5 would also round up, it means if you are scanning a massive set of data, you only have to look at the first number after the decimal to know whether it will round up or down.

However, surely if we always round things ending in 5 up, we are creating an imbalance somewhere? This might seem minor, but if you consider all of the millions and billions of transactions that take place in, for example, bureaux de change, where currency is changed, this will add up to a lot of money that someone will be unfairly losing (or gaining).

I myself run into this problem every month when my husband and I sit down to pay off our shared credit card. Our Google Sheet halves the cost of all of our shared purchases and totals up how much we each have to pay. And when we share a purchase that is an odd number of pence, we run into a little problem. Google dutifully rounds our individual costs up, but then we would overpay our credit card by a penny for every such transaction. My husband, having the amazing qualities of both a mathematician and a computer scientist, fixed this so that one of the values rounds up and one rounds down. And my husband, also having the tight-fisted qualities of a Scotsman, fixed it so his costs always round down, and mine round up.

So always rounding .5 up (officially known as "Round Half Up") can be a bit of a problem. The whole ends up being less than the sum of the rounded parts. Maths teachers also know that this is incredibly annoying when it comes to pie charts and stratified sampling. You know exactly what I'm talking about.

There are some ways of fixing the unfairness of Round Half Up . A lot of these methods are actually used without you even being aware of them. I bet you didn't even know that the method you usually use has a name. I'd bet even more that you aren't aware their are eight types of commonly used rounding methods.

The Eight Main Rounding Methods

Round Half Up

When it's a 5 you round up. So 4.65 rounds to 4.7 and -2.5 would round to -2. This is known as "asymmetric rounding" because it is positively biased - that is, we round up slightly more often that we round down.

Round Half Down

When it's a 5 you round down. So 4.65 rounds to 4.6 and -2.5 rounds to -3. This is hardly ever used. This is also known (confusingly) as "asymmetric rounding".

Round Half Away From Zero

When it's a 5 you round away from zero. So 4.65 rounds to 4.7, and -2.5 rounds to -3. This is probably what most normal people probably assumes happens. This method is symmetric because half the time 5 rounds up and half the time 5 rounds down. However, this is only fair if positive and negative numbers are equally likely. There are some situations that deal only with positive numbers, and then the method would still be biased.

Round Half To Even

When it's a 5 you round towards an even number. So 3.5 rounds up to 4 but 6.5 rounds down to 6. -2.5 rounds to -2, -3.5 rounds to -4. This method of rounding should be unbiased because even and odd numbers are equally likely, right? But zero is even, so aren't there sort of more even numbers than odd? That's a debate for another post. This method of rounding is probably the most commonly used, as it is the default method used in IEEE 754 computing functions and operators.

Round Half To Odd

This should be obvious, having read the previous paragraph. This method, however, is almost never used.

Stochastic Rounding

When it's a 5, flip a coin, and use that to decide if it rounds up or down.This should be unbiased, as it really would be a 50/50 chance. However, if you let your students use this method in their maths homework, you would have thirty students with completely different sets of answers. Whilst the unbiasedness of this method appeals to me, the fact that you would get different answers every time would just be annoying. Some of my students (many of my year 11s) actually do apply this method of rounding, but without a coin. It's otherwise known as guessing. They have a 50% chance of being right, which is good enough for me.

Round Half Alternatingly

The first time you have a 5, you round up. The second time, round it down. So if you had this list of numbers: 3.5, 6.5, 2.5, -1.5, you would round these to: 4, 6, 3, -2. This will be free of bias as long as you have an even number of data that end in a 5.

So there you have it. Eight different rounding methods, six of which are commonly used (although some are more common than others). And many people (including many maths teachers) have absolutely no idea our money, our personal data, and the data we are presented with in newspapers, have been subjected to these methods. We could be missing out on half pennies all over the place!

Another method worth mentioning is Supermarket Rounding, which is where if something is half price, they always round the price up. So 99p becomes 50p when half price. Interestingly, when the same supermarket advertises 50% off, 99p still becomes 50p, even though the 50% that is taken off should be the bit that is rounded. Hey, these half pennies add up you know!


So back to my original question, how do you round -1.5 to the nearest whole number? The answer is either:
Round Half Up: -1
Round Half Down: -2
Round Half Away From Zero: -2
Round Half To Even: -2
Round Half To Odd: -1
Stochastic Rounding: *flips coin* -1
Round Half Alternatingly: -1
Supermarket Rounding: N/A

Simple.

Emma x x x














1 comment: