order of operations in a straight equation

tblaxland

O-F Administrator
Administrator
Addon Developer
Webmaster
Joined
Jan 1, 2008
Messages
7,320
Reaction score
25
Points
113
Location
Sydney, Australia
Incorrectly determining order of operations is very common in calculators. When using an unfamiliar calculator, I always do a simple test of 1+2*3 so I know what I am dealing with.
 

Fizyk

Member
Joined
Jun 20, 2008
Messages
285
Reaction score
1
Points
18
Location
Warsaw
Website
ebvalaim.net
Most simple calculators evaluate previous operation when you press the button for the next operation, so when you type "10+10*0=", it evaluates 10+10 the moment you press "*" and then multiplies the result by 0. If you want the correct result, you need to remember how it works and adjust what you type accordingly. It's not a problem with the calculator, it's a problem with the user :p
 

Artlav

Aperiodic traveller
Addon Developer
Beta Tester
Joined
Jan 7, 2008
Messages
5,790
Reaction score
780
Points
203
Location
Earth
Website
orbides.org
Preferred Pronouns
she/her
Calculator is a tool for arithmetics, not expression evaluation.
I wonder how many realize that or know the difference.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,616
Reaction score
2,336
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Mathematicians have an entirely coherent and logical language with which they can express their ideas to other people who understand the language. That is the only factor in it. If people don't understand the language, they can either learn it or sit there whining about it being too complicated whilst they sit there flipping burgers for a living.

Correction: The mathematical language is far from coherent and logical by itself. You can do a lot of evil there, by not following some basic conventions. What is pretty much legal mathematical text, can be impossible to understand correctly.

Take for example the popular word "trivial". In everyday language, you use trivial like it suits you, and might think it is the same in mathematical texts. But that is wrong. In mathematics, trivial is a very strictly defined attribute. It means that something is expressed already by the definition of something else. Contrary to what some math professors like to think, trivial is not meaning "Something so easily proven, that it is left to the student, I have no time for this"
 

JEL

Addon Developer
Addon Developer
Joined
Apr 23, 2008
Messages
674
Reaction score
0
Points
0
Location
in the cold Denmark
Website
www.jelstudio.dk
Incorrectly determining order of operations is very common in calculators. When using an unfamiliar calculator, I always do a simple test of 1+2*3 so I know what I am dealing with.

The default iPhone app calculator gives 7 as result, so apparently Apple's product works as it should :)

The windows default calculator is just one calculator and yet you get 2 different results based on which view you select in it. I can't think of any good reason why they wouldn't make sure their calculator uses the same rules in all views when it's obvious that it CAN do it right when used in scientific view?
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,616
Reaction score
2,336
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Because the windows calculator executes the operators as you enter them, in the order that you give it, because it thinks you are old enough to know what you are doing.
 

Izack

Non sequitur
Addon Developer
Joined
Feb 4, 2010
Messages
6,665
Reaction score
13
Points
113
Location
The Wilderness, N.B.
I just play it safe and go nuts with brackets. :)

It gets unreliable on Windows' what-do-you-mean-you-want-to-see-your-input calculator program, though.
 

JEL

Addon Developer
Addon Developer
Joined
Apr 23, 2008
Messages
674
Reaction score
0
Points
0
Location
in the cold Denmark
Website
www.jelstudio.dk
Because the windows calculator executes the operators as you enter them, in the order that you give it, because it thinks you are old enough to know what you are doing.

Why use 2 different math-rule-sets in the same piece of software?

Consider all those using it in school on their laptops. The kids using it in standard view get another result than those using it in scientific view, even though it's the same calculator. That has to be a stupid idea.

And those old enough to know what they're doing are probably already using it in the scientific view, where it does it correctly so you don't have to know what you're doing :lol:
 

jedimaster1214

CDR-LMP-CMP
Joined
Jul 23, 2009
Messages
386
Reaction score
0
Points
16
Here's another one i saw on Facebook:

1+1+1+1+1+1+1+1+1+1-1+1+1+1+1+1+1x0 =?

1,827,315 people answered Zero.
1,317,072 people answered 14.
378,602 people answered 16.
76,708 people answered 17.

I answered 16 because i know you multiply the 1 and the 0, then add the rest up to 16. Right?
 

Notebook

Addon Developer
Addon Developer
News Reporter
Donator
Joined
Nov 20, 2007
Messages
11,816
Reaction score
641
Points
188
Dosen't it come down to

10-6?

No it dosen't too late in the evening, I'll have a go tommorrow

N.
 

jedimaster1214

CDR-LMP-CMP
Joined
Jul 23, 2009
Messages
386
Reaction score
0
Points
16
:O i didn't see the minus in there!!! it is down to 10-6, which is 4. which isn't even a response :p
 

C3PO

Addon Developer
Addon Developer
Donator
Joined
Feb 11, 2008
Messages
2,605
Reaction score
17
Points
53
Here's another one i saw on Facebook:

1+1+1+1+1+1+1+1+1+1-1+1+1+1+1+1+1x0 =?

1,827,315 people answered Zero.
1,317,072 people answered 14.
378,602 people answered 16.
76,708 people answered 17.

I answered 16 because i know you multiply the 1 and the 0, then add the rest up to 16. Right?

1.8m people got the order wrong??? :facepalm:

And it's 14 if you're still not sure. :lol:
 

fireballs619

Occam's Taser
Donator
Joined
Nov 4, 2009
Messages
788
Reaction score
4
Points
33
14 is correct. Multiplication has higher precedence than addition and subtraction, so we do the 1x0 first, so that gets disregarded. Then we have 1+1+1+1+1+1+1+1+1+1-1+1+1+1+1+1, which you do left to right, thereby getting 14. The whole thing is still quite pointless, if you ask me.

EDIT: Wow, double ninja'd!
 

Fizyk

Member
Joined
Jun 20, 2008
Messages
285
Reaction score
1
Points
18
Location
Warsaw
Website
ebvalaim.net
fireballs619 said:
The whole thing is still quite pointless, if you ask me.
Agreed. Though I won't be surprised if some companies start to use this in prices :p ("Only 1000+1000*0 dollars!")
 

HarvesteR

Member
Joined
Apr 22, 2008
Messages
386
Reaction score
15
Points
18
Agreed. Though I won't be surprised if some companies start to use this in prices :p ("Only 1000+1000*0 dollars!")

It's probably gonna be the biggest thing to happen to marketers since the whole $99.99 thing...

Let's all keep quiet then, we don't want them marketers finding out about this.

Cheers
 

agentgonzo

Grounded since '09
Addon Developer
Joined
Feb 8, 2008
Messages
1,649
Reaction score
4
Points
38
Location
Hampshire, UK
Website
orbiter.quorg.org
Any thoughts on the windows calculator giving different results based on whether or not you use it in standard versus scientific view?
Whilst it may be an odd thing to return two different results based on the view, their logic behind it is entirely sound. The basic view looks like a simple calculator so they emulate that behaviour (1 + 2 * 3 = 9) otherwise it would confuse the user.
Similarly the scientific view emulates the behaviour of a scientific calculator with proper precedence (1 + 2 * 3 = 7).

This is a bit confusing returning a different answer based on the view, but then so would be getting the simple calculator to return 7. Personally I agree with their choice as everyone who wants a calculator to return 7 knows that most simple calculators do not do this and will perform a quick check like 1+2*3 to know what they are working with.

Microsoft have tried to go down the route of least confusion (which is a very good paradigm to work to). Personally I think they made the correct decision and was i bit surprised to find that the iPhone calculator app returned 7, but again can see why it does.

---------- Post added at 09:48 ---------- Previous post was at 09:46 ----------

Correction: The mathematical language is far from coherent and logical by itself. You can do a lot of evil there, by not following some basic conventions. What is pretty much legal mathematical text, can be impossible to understand correctly.

Take for example the popular word "trivial". In everyday language, you use trivial like it suits you, and might think it is the same in mathematical texts. But that is wrong. In mathematics, trivial is a very strictly defined attribute. It means that something is expressed already by the definition of something else. Contrary to what some math professors like to think, trivial is not meaning "Something so easily proven, that it is left to the student, I have no time for this"
No, you misunderstood me here. When I said the mathematical language, I was talking about the language of symbols (+²√∑∂ etc) and expressions used to write equations rather than the words (like trivial used as the example) to explain things.
 

JEL

Addon Developer
Addon Developer
Joined
Apr 23, 2008
Messages
674
Reaction score
0
Points
0
Location
in the cold Denmark
Website
www.jelstudio.dk
Whilst it may be an odd thing to return two different results based on the view, their logic behind it is entirely sound. The basic view looks like a simple calculator so they emulate that behaviour (1 + 2 * 3 = 9) otherwise it would confuse the user.
Similarly the scientific view emulates the behaviour of a scientific calculator with proper precedence (1 + 2 * 3 = 7).

This is a bit confusing returning a different answer based on the view, but then so would be getting the simple calculator to return 7. Personally I agree with their choice as everyone who wants a calculator to return 7 knows that most simple calculators do not do this and will perform a quick check like 1+2*3 to know what they are working with.

Microsoft have tried to go down the route of least confusion (which is a very good paradigm to work to). Personally I think they made the correct decision and was i bit surprised to find that the iPhone calculator app returned 7, but again can see why it does.

You really mean you prefer a calculator to return the wrong result when it's possible to construct it so it doesn't?

I'm really surprised to hear that from you.

I personally can't see how keeping calculators from progressing into better machines would help anyone.
Following that logic we should still be using the wooden abacus simply because it would be more confusing to start using the electronic calculator :)

I, for one, certainly want my calculator to be as advanced and fool-proof as it can be. If nothing else, then atleast for the sake of minimizing the dreaded HUMAN ERROR factor :)
 

agentgonzo

Grounded since '09
Addon Developer
Joined
Feb 8, 2008
Messages
1,649
Reaction score
4
Points
38
Location
Hampshire, UK
Website
orbiter.quorg.org
Again, not quite what I meant. I prefer using scientific calculators (indeed, programmable ones) but I'm not the general populous. If I was making calculators I'd have to make them how the general populous wanted or expected them or face a failed business model.
 
Top