do a simple maths problem
Moderator: Forum Moderators
Well I did electronics for years and ended up doing IT, so my education hasn't helped me much either. Such is life, it still looks good on your CV.Baliame wrote:But I find it a troubling question now that I think about it, I think I wasted 12 years of my life so far learning things I most likely won't even want to remember.
In the end arithmetic is just the sum of various positive and negative numbers. Erm, maybe not division. But then I never did learn how to divide properly. Luckily by the time I was studying Laplace and Fourier it was largely irrelevant.
The rules may seem arbitrary because...well, they're conventions rather than rules. It's an accepted way of doing things in order to avoid confusion. Maths geeks get terribly upset if you tell them to abide by rules (philosophically, pure maths is meant to write the rules not the other way round).
Whilst the precedents have been clearly explained in this thread, what remains it that whoever set the original equation is being deliberately ambiguous and would be much nicer to have used brackets or put the variables in a more customary sequence.
Whilst the precedents have been clearly explained in this thread, what remains it that whoever set the original equation is being deliberately ambiguous and would be much nicer to have used brackets or put the variables in a more customary sequence.
this see new math, which coincidentally is about 50 years old nowfriznit wrote:The rules may seem arbitrary because...well, they're conventions rather than rules. It's an accepted way of doing things in order to avoid confusion. Maths geeks get terribly upset if you tell them to abide by rules (philosophically, pure maths is meant to write the rules not the other way round).
Whilst the precedents have been clearly explained in this thread, what remains it that whoever set the original equation is being deliberately ambiguous and would be much nicer to have used brackets or put the variables in a more customary sequence.
-
- Berk
- Posts: 10353
- Joined: December 7th, 2004, 17:02
- Location: Oklahoma City, OK, USA
- Contact:
The point of this exercise is to test people's recollection of the convention, to be sure. While putting the parenthesis would make it obvious, it would make the test pointless.friznit wrote:The rules may seem arbitrary because...well, they're conventions rather than rules. It's an accepted way of doing things in order to avoid confusion. Maths geeks get terribly upset if you tell them to abide by rules (philosophically, pure maths is meant to write the rules not the other way round).
Whilst the precedents have been clearly explained in this thread, what remains it that whoever set the original equation is being deliberately ambiguous and would be much nicer to have used brackets or put the variables in a more customary sequence.
I think where people are getting led astray is when they're trying to do addition before subtraction. In truth addition and subtraction are the exact same operation, it's just that one case has a negative operand. Wee don't learn it this way because the idea of a negative value of objects doesn't make much sense. However, when you look at it like that, you can see that:
1 - 3 x 4 + 7 is equal to 1 + (-(3x4)) + 7.
So yes the answer is indeed -4. You can verify that using Google Calculator and Wolfram Alpha if you like.
Interestingly though, Bali was wrong about C++ because it will do a strict left-to-right interpretation simply because of the nature of the language and the way it's set up. It's too hard/complicated to get a low level compiler to be able to read an expression completely in order to determine the correct order to do a calculation, so the code author needs to make it explicitly execute code in the right order. The correct syntax for this expression in C++ would be:
1 - (3 * 4) + 7.
The way the computer would execute it would be it first takes the 1 and then sees the subtraction operator and the parenthesis, and puts the subtraction on hold while it figures out whatever you put in the the parenthesis. So in this case it would go "1 minus oh we gotta figure out this other expression" and solve the (3 * 4) bit before finishing the 1 minus... part. Without the parenthesis, C++ would spit out -1 to you because it would do this:
((1 - 3) * 4) + 7
-
- Berk
- Posts: 10353
- Joined: December 7th, 2004, 17:02
- Location: Oklahoma City, OK, USA
- Contact:
That is exactly the reason. An expression is no good if it could mean -22, -18, -4, and -1. And yes it is better to be explicit about it using parenthesis, it's not necessary because of the convention.spoodie wrote: My thinking was:
1 - 3 = -2
-2 x 4 = -8
-8 + 7 = -1
I can only guess that the reason for the convention is to make sure that everyone gets the same result.
-
- Throbbing Cupcake
- Posts: 10249
- Joined: February 17th, 2007, 23:05
- Location: The maleboge
-
- Berk
- Posts: 10353
- Joined: December 7th, 2004, 17:02
- Location: Oklahoma City, OK, USA
- Contact:
I don't even understand how this is a problem. Even if you did these out of order, you'd not be adding 4 + 8, you'd be adding -4 + 8. I just don't understand how people can make that kind of error. It's like there is a fundamental misunderstanding of arithmetic or something. The subtraction part can never extend to the 8 in this situation. The very idea of that is ludicrous.THE VERY IMPORTANT EXCEPTION
There is an exception to BIDMAS, and it is found right at the end when only additions and subtractions remain. When there are ONLY, I repeat, ONLY additions and subtractions remaining then you can work left to right. I'll show you why.
Suppose I get an expression 4+6-4+8. If I do the additions first I will replace 4+6 with 10 and 4+8 with 12, to get the expression 10-12. The answer to which is -2. Now working from left to right, I start off with 4 units and add to that 6 units. This gives me ten units. I now take away 4 units to leave me with 4 units. Finally I add another 8 units. This gives me 14 units in all.
Well, that's exactly what it is. Not here, necessarily, that's probably people either not paying attention because they don't really care or ignoring the correct answer on the assumption it's a trick question. People in general though don't like maths, and so aren't very good at anything other than basic stuff.deject wrote:It's like there is a fundamental misunderstanding of arithmetic or something.
-
- Robotic Bumlord
- Posts: 8475
- Joined: October 24th, 2004, 0:27
- Location: Manchester, UK
I see no reason at all to present this without parentheses. It's like missing out commas from text and expecting people to get the original meaning, e.g.
"...his global tour included encounters with Nelson Mandela, an 800-year-old demigod and a dildo collector"
This can be implied to mean that Mandela is a dildo collecting demi-god (see serial/Oxford comma for further details).
"...his global tour included encounters with Nelson Mandela, an 800-year-old demigod and a dildo collector"
This can be implied to mean that Mandela is a dildo collecting demi-god (see serial/Oxford comma for further details).
-
- Berk
- Posts: 10353
- Joined: December 7th, 2004, 17:02
- Location: Oklahoma City, OK, USA
- Contact:
Actually it isn't because there is a well a established convention to interpret such expressions, unlike the English language. The problem is a test of people's knowledge of the convention, yes, but it is part of arithmetics.Roman Totale wrote:I see no reason at all to present this without parentheses. It's like missing out commas from text and expecting people to get the original meaning, e.g.
"...his global tour included encounters with Nelson Mandela, an 800-year-old demigod and a dildo collector"
This can be implied to mean that Mandela is a dildo collecting demi-god (see serial/Oxford comma for further details).
-
- Morbo
- Posts: 19676
- Joined: December 10th, 2004, 21:53
- Contact:
Re: do a simple maths problem
No.deject wrote:Do this maths problem.
Re: do a simple maths problem
We have a winner.Dr. kitteny berk wrote:No.
Interestingly though, Deject was wrong about C++ because it will do the interpretation of maths correctly simply because of the way it's set up.deject wrote: Interestingly though, Bali was wrong about C++ because it will do a strict left-to-right interpretation simply because of the nature of the language and the way it's set up. It's too hard/complicated to get a low level compiler to be able to read an expression completely in order to determine the correct order to do a calculation, so the code author needs to make it explicitly execute code in the right order. The correct syntax for this expression in C++ would be:
1 - (3 * 4) + 7.
The way the computer would execute it would be it first takes the 1 and then sees the subtraction operator and the parenthesis, and puts the subtraction on hold while it figures out whatever you put in the the parenthesis. So in this case it would go "1 minus oh we gotta figure out this other expression" and solve the (3 * 4) bit before finishing the 1 minus... part. Without the parenthesis, C++ would spit out -1 to you because it would do this:
((1 - 3) * 4) + 7
Please do ignore all the other code, I injected the equation into a random thing I'm working on right now.
Environment: MSVC++ 2010
I'd like to re-refer you to the following page: http://en.wikipedia.org/wiki/Order_of_o ... _languages
If languages didn't use order of operations it'd be just plain wrong, considering without it "5 > 3 + 4" would evaluate to 5.
Last edited by Baliame on June 18th, 2010, 20:50, edited 1 time in total.