Jump to content
  • Advertisement
Sign in to follow this  
Cibressus

were does order of operations come from?

This topic is 5174 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Well, the basic ones are a derived from mathematics itself:
Parenthesis(sp?),Exponents,Multiplication,Division,Addition,Subtracion. Easily remembered by "Please excuse my dear Aunt Sally." The other ones, I am not so sure about at the moment(it is kinda late).

Share this post


Link to post
Share on other sites
In algebra terms, order of operation comes from topology.
Take your favourite algebra book and look up "semigroups", "groups", "rings" and "fields".

In short, you use two basic operations (like addition and multiplication) and define a set of rules for combining them.
The order of operations is a consequence of fullfilling these rules, which define the topology of the space they are defined in.

I hope this gets you started, if not - feel free to ask.

Pat.

Share this post


Link to post
Share on other sites
Tradition, I believe. Standard order of operations seems to have come about over time rather than any hard logical reason. It generally makes sense, but there might be a couple more rules than the minimum necessary, like the precedence of multiplicative operators over additive ones. Realise, though, that there are a number of different standards, reverse polish being one, that do not necessarily have this rule (or other rules the standard form has).

Share this post


Link to post
Share on other sites
Quote:
Original post by Doc
Tradition, I believe. Standard order of operations seems to have come about over time rather than any hard logical reason. It generally makes sense, but there might be a couple more rules than the minimum necessary, like the precedence of multiplicative operators over additive ones. Realise, though, that there are a number of different standards, reverse polish being one, that do not necessarily have this rule (or other rules the standard form has).

But isn't reverse polish notation just what the name states - a notation (and a very convenient one in some cases) rather than a set of rules? After all it's just a question of definition - as long as the rules are sound you might as well use non-standard order of operation.

Share this post


Link to post
Share on other sites
Quote:
Original post by Luke Thompson
Well, the basic ones are a derived from mathematics itself:
Parenthesis(sp?),Exponents,Multiplication,Division,Addition,Subtracion.

Your list is redundant: Substracting a from b is the same as adding the (additive) inverse of b to a. Dividing a by b is equal to multiplying a by the (multiplicative) inverse of b.

a - b ≡ a + -b

a / b ≡ a * b-1

Furthermore, multiplication can be defined as addition as well:

4*a ≡ a + a + a + a

though this only holds for natural numbers [wink].

Additionally, the proper term is powers, not 'exponents'.
Exponents are parts of powers [smile].

Cheers,
Pat.

PS: I admit this is a bit pendatic[smile].

Share this post


Link to post
Share on other sites
Yes and no. IIRC, polish (reverse or not, I'm not sure) notation:

2 3 4 + * is equivalent to 2 * (3 + 4). You'll note that I must put the barckets in for the order of operations to be correct, but the order is different in polish notation. Order of operations is pretty much a consequence of the notation used, that's why I thought it could be rooted in tradition (though Group etc. theory is possible).

2 3 4 * + => 2 + 3 * 4

No parentheses necessary. Notice that polish notation does not require parentheses to describe any weird combniations of ops. (I haven't studied much polish notation, so I could be talking uot my arse, but from what I understand of it seen this is the case.)

(8 + 7 * 10) * (2 + 3 + 4 + 5) * (4 + 1)
in standard math notation becomes
8 7 10 * + 2 3 4 5 + + + * 4 1 + *
in polish. Not easy to read unless you've practiced, but very easy for a computer to parse, and parentheses are redundant.

Sure you could rearrange the numbers, but I'm illustrating something here. Besides, you can only do that if the operations commute, which is not he case in general. Anyway, my point is the order of operations very much depends on the notation used.

Share this post


Link to post
Share on other sites
Doc: You're right about notation (btw. your examples are reverse polish notation[smile]).
Though it doesn't affect the general of the order of precedence as defined by the rules of addition and multiplication. IMO it's a very convinient way to express explicit statement (e.g. getting rid of parenthesis). It's more of a transformation rule that offers obvious advantages over Peano-Russell-Notation in first order logic for example (e.g. when building syntax trees).

[side note]
Interestingly reverse polish notation was introduced by HP because it was the only simple way to input complex formulas into the their first calculators and is rumored to be still around in some models [grin].
[/side note]

But with regards to the OP's question you are of course 100% correct - order of operations is defined by the notation that is used.

[edit]
Historically, order of operation rooted in notation and was later formalised into modern mathematical concepts like group theory. This did not take happen until the midddle of the 19th century, though.
[/edit]

Share this post


Link to post
Share on other sites
Well most math comes from concepts in the physical world, so I'd think the order is based upon the fact that it JUST DOESNT WORK any other way. I don't know, I ain't no math major.

Which brings up the question, could you derive equations for things like velocity, acceleration, etc, where it would always give the correct outcome if you did addition before multiplication? What about if you had to then re-arrange the equation algebraically and solve for something else, would the system still work?

Perhaps the order of ops we have is the only possible way to do it?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!