• Our new ticketing site is now live! Using either this or the original site (both powered by TrainSplit) helps support the running of the forum with every ticket purchase! Find out more and ask any questions/give us feedback in this thread!

Maths question

Status
Not open for further replies.
Sponsor Post - registered members do not see these adverts; click here to register, or click here to log in
R

RailUK Forums

SS4

Established Member
Joined
30 Jan 2011
Messages
8,589
Location
Birmingham
What is -0.5 rounded to the nearest whole number?

We have had some big debates!!!

0

The set of whole numbers isn't well defined mathematically but I would say it's the same as the set of integers.

Rounding rules dictate it is rounded up because 0 > -1
 

455driver

Veteran Member
Joined
10 May 2010
Messages
11,329
-1


If it was +0.5 then it would be rounded up to 1 because
0.0 to 0.4 get rounded down
0.5 to 0.9 get rounded up

But as you are below zero then the rules get reversed.
0.0 to -0.4 gets rounded up to 0
0.5 to -0.9 gets rounded down to -1.
 

hairyhandedfool

Established Member
Joined
14 Apr 2008
Messages
8,837
There are no set rules for rounding unless preference is specified in the particular query. The most common rules are:

Rounding Up (0)
Rounding Down (-1)
Rounding Towards zero (0)
Rounding away from zero (-1)

At school I was always taught to 'Round up'.
 

deltic

Established Member
Joined
8 Feb 2010
Messages
3,713
my initial thought would be to round up to 0 but as I would round -1.5 to -2, so I would have to agree you should round to -1. Excell rounds to -1
 

richw

Veteran Member
Joined
10 Jun 2010
Messages
11,528
Location
Liskeard
Microsoft Excel rounds -0.5 to -1, if you select to round to 0decimal places.
 

edwin_m

Veteran Member
Joined
21 Apr 2013
Messages
28,602
Location
Nottingham
Another option is to round halves to the nearest even number, which would give zero. This can be useful if the numbers are later averaged, since the average of the rounded numbers will be closer to the average of the originals.
 

richw

Veteran Member
Joined
10 Jun 2010
Messages
11,528
Location
Liskeard
Another option is to round halves to the nearest even number, which would give zero. This can be useful if the numbers are later averaged, since the average of the rounded numbers will be closer to the average of the originals.

zero isn't an even number. An even number is a number that can be split evenly by 2. Zero can not be divided by 2.
 

TheKnightWho

Established Member
Joined
17 Oct 2012
Messages
3,183
Location
Oxford
zero isn't an even number. An even number is a number that can be split evenly by 2. Zero can not be divided by 2.

Yes it is! Don't confuse 0 with 'nothing'. There're whole books written on things like this ;)
 

bb21

Emeritus Moderator
Joined
4 Feb 2010
Messages
24,445
zero isn't an even number. An even number is a number that can be split evenly by 2. Zero can not be divided by 2.

Zero is most definitely even.

By your own definition: 0 ÷ 2 = 0 with no remainder, hence zero is even.

The question in the OP is meaningless without context. Both zero and -1 are correct. Neither is closer to -0.5 than the other. It comes down to common practice. With positive numbers, common practice is rounding halves up, but there is no such thing for negative numbers AFAIK so both can be the correct answer.

I am surprised that so many people are sure that the answer is -1 and not 0.
 

richw

Veteran Member
Joined
10 Jun 2010
Messages
11,528
Location
Liskeard
Yes it is! Don't confuse 0 with 'nothing'. There're whole books written on things like this ;)

Zero is most definitely even.

By your own definition: 0 ÷ 2 = 0 with no remainder, hence zero is even.

The question in the OP is meaningless without context. Both zero and -1 are correct. Neither is closer to -0.5 than the other. It comes down to common practice. With positive numbers, common practice is rounding halves up, but there is no such thing for negative numbers AFAIK so both can be the correct answer.

I am surprised that so many people are sure that the answer is -1 and not 0.

your both incorrect, zero is not an even number. I will provide supporting evidence when I am at my laptop rather than my phone, you can not divide zero by any number. Go stick zero divide by any number into excel or a scientific calculator you will get a !div0! Error.

(I am currently studying a maths degree and the module currently working goes into extensive detail why zero is not an even number and also why zero cannot be divided by any number)
 

Searle

Established Member
Joined
4 May 2012
Messages
1,580
Location
Ladbroke Grove
Would just like to point out that excel proves that the algorithms used behind Excel prove/disprove something, it's not a way of proving something is/isn't right
 

anme

Established Member
Joined
8 Aug 2013
Messages
1,777
your both incorrect, zero is not an even number. I will provide supporting evidence when I am at my laptop rather than my phone, you can not divide zero by any number. Go stick zero divide by any number into excel or a scientific calculator you will get a !div0! Error.

(I am currently studying a maths degree and the module currently working goes into extensive detail why zero is not an even number and also why zero cannot be divided by any number)

0 / x = 0, if x != 0.
Excel or a scientific calculator will give this result, although that doesn't prove anything, of course.
Are you thinking of *dividing* by zero? That indeed gives an undefined result.
 

edwin_m

Veteran Member
Joined
21 Apr 2013
Messages
28,602
Location
Nottingham
your both incorrect, zero is not an even number. I will provide supporting evidence when I am at my laptop rather than my phone, you can not divide zero by any number. Go stick zero divide by any number into excel or a scientific calculator you will get a !div0! Error.

(I am currently studying a maths degree and the module currently working goes into extensive detail why zero is not an even number and also why zero cannot be divided by any number)

Wrong way round. You can't divide anything by zero but you can divide zero by anything.
 

hairyhandedfool

Established Member
Joined
14 Apr 2008
Messages
8,837
your both incorrect, zero is not an even number. I will provide supporting evidence when I am at my laptop rather than my phone, you can not divide zero by any number. Go stick zero divide by any number into excel or a scientific calculator you will get a !div0! Error.

(I am currently studying a maths degree and the module currently working goes into extensive detail why zero is not an even number and also why zero cannot be divided by any number)

Tell me something, which came first, maths? Or Excel/scientific calculators?

Wrong way round. You can't divide anything by zero but you can divide zero by anything.

Absolutely. If you had a cake and no-one wanted any you'd be left with a cake (one divided by zero equals one????). If 5 people wanted cake but no-one had baked one, none of the five would get any (zero divided by five equals zero).
 

edwin_m

Veteran Member
Joined
21 Apr 2013
Messages
28,602
Location
Nottingham
Tell me something, which came first, maths? Or Excel/scientific calculators?



Absolutely. If you had a cake and no-one wanted any you'd be left with a cake (one divided by zero equals one????). If 5 people wanted cake but no-one had baked one, none of the five would get any (zero divided by five equals zero).

Mmmm, a cake post! Can I have it and eat it too?

Actually, both Excel and calculators will allow zero to be divided by something. The DIV/0 error arises only when dividing by zero.
 

TheKnightWho

Established Member
Joined
17 Oct 2012
Messages
3,183
Location
Oxford
your both incorrect, zero is not an even number. I will provide supporting evidence when I am at my laptop rather than my phone, you can not divide zero by any number. Go stick zero divide by any number into excel or a scientific calculator you will get a !div0! Error.

(I am currently studying a maths degree and the module currently working goes into extensive detail why zero is not an even number and also why zero cannot be divided by any number)

Forgive me if I'm a little sceptical, as I was myself doing a maths degree for a while before I decided to change to something else. I haven't heard of anyone saying that you can't divide 0 by anything, but anything divided by 0 is undefined.

It's the difference between 0 and NULL in C++, for example.
 

455driver

Veteran Member
Joined
10 May 2010
Messages
11,329
I split the decimal places up evenly so
0.0 to 0.4 (5 decimal places) get rounded down (to 0)
0.5 to 0.9 (5 decimal places) gets rounded up (to 1)

Because -0.5 is below zero then it becomes
0.0 to -0.4 gets rounded up (to 0)
0.5 to 0.9 gets rounded down (to -1)

Its all a question of trying to keep things averaged as evenly as possible.
 

richw

Veteran Member
Joined
10 Jun 2010
Messages
11,528
Location
Liskeard
From my Degree text book:

Rounding should always be done in context
, for example if you were decorating and need 7.2 rolls of wallpaper you'd round this up. If you were measuring for how many cupboards would fit along a wall, and you came out with 7.8 you'd round to 7 as 8 will not fit. This applies to positive and negative numbers so there is no correct answer without context.
I have read on a bit since my previous post, and now found it is highly disputed whether zero is odd or even, the text book gives both arguments. Its argued it is even because splitting 0 between 2 they both get zero. The other side uses the cake example that if you have no cake you cant split it between two people as there is nothing to split so therefore can not possibly be even, as to be even 2 people should both get a portion.
 

Murph

Member
Joined
16 Feb 2010
Messages
728
For the purposes of rounding .5 to the nearest even number, treating zero as even is required if the context is to ensure that the rounding errors statistically cancel out over a large set of linearly distributed data (which is usually the reason for choosing to round to nearest even number).

Whether it's treated as even in other contexts doesn't really matter.
--- old post above --- --- new post below ---
I split the decimal places up evenly so
0.0 to 0.4 (5 decimal places) get rounded down (to 0)
0.5 to 0.9 (5 decimal places) gets rounded up (to 1)

Because -0.5 is below zero then it becomes
0.0 to -0.4 gets rounded up (to 0)
0.5 to 0.9 gets rounded down (to -1)

Its all a question of trying to keep things averaged as evenly as possible.

Statistically, that method will give an always increasing cumulative rounding error, as it's incorrect to include 0.0 in the set. There's essentially 4 cases:

.00 - no rounding required
.01 to .49 - round towards 0
.50 - round towards even
.51 to .99 - round away from 0

I used 2 decimal places there, as it sometimes helps to look at it that way.

As previously stated, however, context is everything, that's just a useful default way of handing data which often eliminates cumulative error.
 

D6975

Established Member
Joined
26 Nov 2009
Messages
3,045
Location
Bristol
Rounding has conventionally been always to the modulus of the number.
Ie you ignore totally whether the number is negative or positive.
So rounding a negative number yields the same output value as rounding the equivalent positive number, but negative.
This also means that rounding up -0.5 gives an answer of -1, rather counter intuitively.

Another way of looking at this is that rounding up means moving away from zero, rounding down means moving towards zero.
 

PaxVobiscum

Established Member
Joined
4 Feb 2012
Messages
2,410
Location
Glasgow
I have read on a bit since my previous post, and now found it is highly disputed whether zero is odd or even, the text book gives both arguments. Its argued it is even because splitting 0 between 2 they both get zero. The other side uses the cake example that if you have no cake you cant split it between two people as there is nothing to split so therefore can not possibly be even, as to be even 2 people should both get a portion.

How typical of these forums - someone asks a reasonable question and in no time we're arguing about nothing! :D
 

maniacmartin

Established Member
Fares Advisor
Joined
15 May 2012
Messages
5,437
Location
Croydon
I have read on a bit since my previous post, and now found it is highly disputed whether zero is odd or even

It's not highly disputed. You are the only one claiming it is not even. The rest of the world looks to see if there is any remainder after dividing by 2, and if not then it is even.
 

richw

Veteran Member
Joined
10 Jun 2010
Messages
11,528
Location
Liskeard
It's not highly disputed. You are the only one claiming it is not even. The rest of the world looks to see if there is any remainder after dividing by 2, and if not then it is even.

As mentioned I am quoting a degree level text book. there is nothing to divide by 2,
 

Murph

Member
Joined
16 Feb 2010
Messages
728
As mentioned I am quoting a degree level text book. there is nothing to divide by 2,

For cakes, maybe, but for numbers, 0/x = 0, for all x != 0. Or, if you really don't like seeing it written that way, 0 * 1/x = 0 for all x != 0. You really don't need a degree level text book for that.
 
Status
Not open for further replies.

Top