Order of operations

I was taught that when you have an equation with varying operands that you perform them in a particular order : multiplication, division, addition, subtraction.

Why is that so? Is there a mathematical reason for this? Or is it just a custom that has persisted throughout the years?
And did I remember the order incorrectly?

Yes, I do know that parentheses change the situation.

It’s generally just a custom, though the most generally useful order was chosen when the custom was created.

Actually, multiplication and division have equal priority and are evaluated in the order that they appear before addition and subtraction which also have equal priority, and are evaluated in the order that they appear.

So M&D before A&S is the rule.

Now, why is that the rule?

Don’t know. It’ll be interesting to see if anyone comes up with that.

It makes sense to do it that way, but maybe that’s because I learned it that way.

The problem with numbers is that they make everything abstract. If you rephrase it as a word problem it becomes obvious. Precendence of operations go very far back.

Let’s hop in the way-back machine and go back a few thousand years to the local market where we want to buy two sheep and 5 bushels of grain. Sheep are worth 10 gold coins and a bushel of grain is worth 2 gold coins. How many gold coins do I need?

Well, the answer is 2 sheep times 10 coins plus 5 bushels times 2 coins. Total, 30 coins.

Note that you would never add the 10 coins to the 5 bushes. That wouldn’t make sense.

Expressed using pure numbers, the equation is 2 x 10 + 5 x 2. Here, there is no obvious reason for not adding the 10 and the 5 but if you think of what the numbers actually represent, the answer is obvious.

“Drink your coffee! Remember, there are people sleeping in China.”

Dennis Matheson — dennis@mountaindiver.com
Hike, Dive, Ski, Climb — www.mountaindiver.com

The rule I learned was:

Pretty Please
My Dear
Aunt Sally

Powers (exponents) and (completed) Parentheses come first

then Multiplication and Division

then Adding and Subtracting.

As to why this is the rule, I’m not really sure. I suppose it is because you add products more often than you multiply sums. For example, you might say, that convoy has four cars with three people each and five motorcycles with two people each … 4x3+5x2.

That type of equation might be more common than saying: there are five red sedans and two blue sedans, and each sedan has three people in the seats and one in the trunk … (5+2)x(3+1).

Although there are more reasonable examples of the latter type of equation, I think in general, it holds true.

It’s obvious why parentheses should be first. Exponents are first, I think, because in polynomial math, single numbers or variable are raised to higher powers much more often than sums or products. Like in the Pythagorean theorem, for example.

Nothing I write about any person or group should be applied to a larger group.

  • Boris Badenov

I’m glad to see that everyone jumped on this one quickly. I was really hoping for a complex, abstract mathematical reason. Sometimes though, it seems that simplest is best.
I’m also glad that someone else was taught the mnemonic for the order of operations as I was (by my very bad 9th grade algebra teacher).

I just taught this to my students the other day. Please Excuse My Dear Aunt Sally, or P.E.M.D.A.S.

Multiplication or Division (left to right)
Addition or Subtraction (left to right)

I don’t know who invented the rule, but I told my students that one day a couple of guys were sitting around and trying to solve math problems. They came across this one:


One of them got 24 by multiplying first, then adding the results. The other got 64 by doing the operations left to right. When they realized that by doing the problem two different ways that they got two different answers, they decided that they needed some guidelines so that when others did the problem they got the same answers and hence came up with the Order of Operations.

could it have something to do with the way roman numerals are written?


3(10) + (5-1)= 34

or was roman numerals done that way because of order of operation?

If I came up with something, call it metroshane’s theory (not law).

Mmm hehe um yah jack am coke, yah yah, vodka- Keith Richards

I doubt Roman numerals has anything to do with it.

XXXIV is not 3(10) + (5-1)

but rather it is: 10+10+10-1+5

Ya know, now that I wrote it out myself, I see whatcha mean. But I still think it has nothing to do with it.

Um . . . this has already been answered. The order of precedence is a facet of written equations, not of number theory. It has no relationship to and no dependency on numbers or their representations. The rules are arbitrary in the sense that any self-consistent set of guidelines would function just as well (rigorously) to allow equations to be evaluated unambiguously.

The particular set of “rules” the modern world has settled upon almost certainly developed organically from the nature of the problems that the early mathematicians were solving – see tanstaafl’s post above.

The best lack all conviction
The worst are full of passionate intensity

Boris is right. Only I learned

Please Pass
My Doritos
And Salsa

As far as I know, it’s the same principle as the PMS, or Pantone Matching System in graphic arts. It’s so the same operation can be done in any part of the world and get the same results, like good science.

I learned it as BEDMAS: Brackets, Exponents, etc.

Computers throw something new into the mix: modulus. Modulus is the remainder of the division of two numbers (11 mod 5 = 1, 24 mod 2 = 0, etc.). For obvious reasons, it is grouped with multiplication/division in the order of operations.

Unfortunately, WIGGUM’s excellent acronym P.E.M.D.A.S. now becomes the barely pronouncable abbreviation P.E.M.D.M.A.S. or Please Excuse My Dear Mom’s Aunt Sally. Or something :).

It’s all a conspiracy by math professors to get you to believe this crap that math is an “exact” science. Exact science, my eye. If everyone was allowed to work the problem in any order they wanted to, you’d get dozens of different answers------which would, of course, put the lie to this bilge about this so-called “exact” science. So they set up this little system where only “this” answer is right, and all the rest of them are wrong. And if you ask them why, they will say, “Have faith, my son. Skepticism is the tool of the devil, and therefore, you must accept what you are told.” Exact science. Right. If math were an exact science, we wouldn’t have space probes smashing into the surface of Mars, now would we??? I rest my case.

No. Math is not a science. It IS an extremely rigorous symbolic language which is capable of answers far more accurate and “exact” than any other system of reasoning man has designed.

To reiterate: Order of precedence affects only the written form of a problem.

Wrong. The solution set of a problem is set by the definition of that problem. If I choose to delineate it in an equation, then the order of precedence is part of the grammar of that equation. The equation is not the problem, it is a representation of the problem. Numbers, symbols and operators are the syntactical elements. Precedence is one of the grammatical bases. You cannot “read” the equation without understanding all of them. However, if you changed the OOP it affects neither the problem nor the solution set. It simply means the equation which accurately represents the problem would look different.

The best lack all conviction
The worst are full of passionate intensity

The rules of predcedencs are arbitrary. They could be different. There is nothing in the nature of math that requires the system in use. It is just something everybody agrees on.

Virtually yours,

J Matrix

The order of operations is most usefully required when addressing equations that leave some doubt. An endeavor that was not envisioned when I was at that stage of my introduction to math is the writing of equations for spreadsheets. There you cannot leave any doubt and it is all addressed by parentheses. That’s probably the, if in doubt when you’re writing the equation, answer to the problem for the generator of an equation. Make it painfully clear how to segregate the operations.

You’ve still got to deal with the equations you read and must percolate. Generally, I’d say stick w/the rules of precedence if the total operation gives realistic answers. Otherwise, try it again w/your own analysis of the OOO or seek a different source or reinvent the wheel.

I like the World Spirit’s responses: the order convention is part of the notation convention.

All these mnemonic sayings! When I learned all these things, I just learned them as part of the scene. Who needs all those silly things like. . .uh oh, I guess I forgot it, but I remember the resistor code"

0 - black
1 - brown
2 - red
3 - orange
4 - yellow
5 - green
6 - blue
7 - violet
8 - gray
9 - white

So now, maybe I can covert that back to that old mnemonic. . .oh, yeah:

“Bad boys rape our young girls, but Violet gives willingly.”

Gee, now, if I can wire up the right resistor networks, I can probably write things better’n ole Willy with the shaky spear.

So how would I know whether ‘bad boys’ meant ‘black, brown’ or ‘brown, black’? Or whether ‘girls’ and ‘gives’ meant ‘green’ and ‘gray’ respectively or vice versa? I mean, if you had to have a mnemonic, it would be: I start in the dark and head for the light, and after 2 colors, I go through a rainbow, red-first, to get there. That would mean from black to a non-pure-spectral color heading for red, i.e., brown, to red-rainbow-violet, and the lighten through gray to white. But, no, the mnemonic people want you to keep your mind in the gutter. :wink:

But those were the days before software ruined everything. . .and I can’t remember a dang thing anymore, no matter how you frame it.

Ray (Resistors of the world unite. Uniters of the world resist. Or your family multiples before it divides, but the bills always add up, or something like that, +/-, as in any nonexact nonscience.)