do a simple maths problem

News and important info, general banter, and suggestions for 5punk

Moderator: Forum Moderators

Baliame
Tremors Worm
Tremors Worm
Posts: 3491
Joined: October 13th, 2007, 23:43
Location: Hungary

Post by Baliame »

I think it has something to do with the fact how one "higher" operation can be substituted by another "lower" one, like multiplication is a lot of additions and exponential is a lot of multiplication, therefore a lot of a lot of additions.
Dog Pants
Site Moderator
Site Moderator
Posts: 21653
Joined: April 29th, 2005, 13:39
Location: Surrey, UK
Contact:

Post by Dog Pants »

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.
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.

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.
friznit
Heavy
Heavy
Posts: 5147
Joined: October 3rd, 2005, 21:51
Location: South of England
Contact:

Post by friznit »

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.
shot2bits
Zombie
Zombie
Posts: 2082
Joined: February 7th, 2005, 17:40
Location: england

Post by shot2bits »

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.
this :above: see new math, which coincidentally is about 50 years old now
deject
Berk
Berk
Posts: 10353
Joined: December 7th, 2004, 17:02
Location: Oklahoma City, OK, USA
Contact:

Post by deject »

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.
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.

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
spoodie
Site Moderator
Site Moderator
Posts: 9246
Joined: February 6th, 2005, 16:49
Location: Essex, UK

Post by spoodie »

deject wrote:I think where people are getting led astray is when they're trying to do addition before subtraction.
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.
deject
Berk
Berk
Posts: 10353
Joined: December 7th, 2004, 17:02
Location: Oklahoma City, OK, USA
Contact:

Post by deject »

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.
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.
amblin
Zombie Spanger
Zombie Spanger
Posts: 2663
Joined: October 22nd, 2004, 11:50

Post by amblin »

.
Last edited by amblin on May 5th, 2014, 17:28, edited 1 time in total.
Dog Pants
Site Moderator
Site Moderator
Posts: 21653
Joined: April 29th, 2005, 13:39
Location: Surrey, UK
Contact:

Post by Dog Pants »

I think the convention probably happened the other way round. I suspect multiplication was discovered before algebra. However, I refuse to be drawn into an argument about maths. I don't consider myself geeky enough.
deject
Berk
Berk
Posts: 10353
Joined: December 7th, 2004, 17:02
Location: Oklahoma City, OK, USA
Contact:

Post by deject »

amblin wrote:multiplication isn't normally signed
With variable this works since the different variables represent different objects, whereas you can't do that with numerals since they'd just look like one number.
HereComesPete
Throbbing Cupcake
Throbbing Cupcake
Posts: 10249
Joined: February 17th, 2007, 23:05
Location: The maleboge

Post by HereComesPete »

BIDMAS bitches!
amblin
Zombie Spanger
Zombie Spanger
Posts: 2663
Joined: October 22nd, 2004, 11:50

Post by amblin »

.
Last edited by amblin on May 5th, 2014, 17:28, edited 1 time in total.
deject
Berk
Berk
Posts: 10353
Joined: December 7th, 2004, 17:02
Location: Oklahoma City, OK, USA
Contact:

Post by deject »

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.
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.
Dog Pants
Site Moderator
Site Moderator
Posts: 21653
Joined: April 29th, 2005, 13:39
Location: Surrey, UK
Contact:

Post by Dog Pants »

deject wrote:It's like there is a fundamental misunderstanding of arithmetic or something.
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.
Roman Totale
Robotic Bumlord
Robotic Bumlord
Posts: 8475
Joined: October 24th, 2004, 0:27
Location: Manchester, UK

Post by Roman Totale »

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).
Dog Pants
Site Moderator
Site Moderator
Posts: 21653
Joined: April 29th, 2005, 13:39
Location: Surrey, UK
Contact:

Post by Dog Pants »

Roman Totale wrote:This can be implied to mean that Mandela is a dildo collecting demi-god (see serial/Oxford comma for further details).
Whaaa? He isn't?
deject
Berk
Berk
Posts: 10353
Joined: December 7th, 2004, 17:02
Location: Oklahoma City, OK, USA
Contact:

Post by deject »

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).
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.
Dr. kitteny berk
Morbo
Morbo
Posts: 19676
Joined: December 10th, 2004, 21:53
Contact:

Re: do a simple maths problem

Post by Dr. kitteny berk »

deject wrote:Do this maths problem.
No.
spoodie
Site Moderator
Site Moderator
Posts: 9246
Joined: February 6th, 2005, 16:49
Location: Essex, UK

Re: do a simple maths problem

Post by spoodie »

Dr. kitteny berk wrote:No.
We have a winner.
Baliame
Tremors Worm
Tremors Worm
Posts: 3491
Joined: October 13th, 2007, 23:43
Location: Hungary

Post by Baliame »

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
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.

Please do ignore all the other code, I injected the equation into a random thing I'm working on right now.
Image
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.
Post Reply