Some facts!
PEMDAS is not math, it’s really nothing to do with mathematics proper, it’s actually just *convention* about mathematical *notation* (whereas “math proper” would be the actual process of manipulating what the symbols represent).
PEMDAS does not actually tell you the order of operations, it’s just a mnemonic to help you remember. Actually the M and D are at the same level of precedence, as are the A and S. That is, multiplication does *not* always come before division, and addition does *not* always come before subtraction.
There are two reasons order of operations was invented in the first place: to resolve ambiguity, and convenience.
Ambiguity can arise when an expression contains operations of *different associativities*. What is associativity? It means when you have an operator that takes two arguments, let’s say +, there are two ways to interpret it: Add the thing on the right to whatever’s on the left (“left associative”), or, add the thing on the left to whatever’s on the right (right associative”).
The difference is:
* left associative: `4 + 5 = (4) + 5`
* right associative: `4 + 5 = 4 + (5)`
For the example above, of course it doesn’t matter, but if the “thing” on either side is some more complicated calculation, then it does make a difference.
So what is the associativity of all of the operators in PEMDAS, listed in order of precedence?
* P – parentheses: a unary operator (meaning that it only takes one argument, whatever is inside the parens), so no associativity.
* E – exponentiation: right associative, e.g.: `3^4^5 = 3^(4^(5))`
* M, D – multiplication and division, both left associative, meaning that the operators should be applied in order from left-to-right, e.g.: `1 * 2 / 3 * 4 / 5 * 6 = (((((1) * 2) / 3) * 4 / 5) * 6)`
* A, S – same as multiplication and division, e.g.: `1 + 2 – 3 + 4 – 5 + 6 = (((((1) + 2) – 3) + 4 – 5) + 6)`
In fact, PEMDAS only references the most commonly used operations in algebra, but there are lots more operators in math and all of them have some precedence assigned to them.
Okay, so that explains how order of operations resolves ambiguities—by placing operators of different associativity at different precedence levels, you can mix a right associative operator like exponentiation with left associative operators like multiplication and it’s clear what is meant.
But if that’s the only reason to have order of operations, why are addition and subtraction at a different level than multiplication and division? These are all left associative, so they could just be executed left to right with no ambiguity, so why not put them all at the same level?
You could do that, but there’s another reason to use order of operations, which is convenience. If we did put all of these left associative operators at the same precedence, then whenever we wanted to write a polynomial like `a*x^2 + b*x + c` we would always have to parenthesize the multiplications to indicate that those should be done first (because the calculation we’re trying to express didn’t change, just the notation we’d be using).
That’s annoying, we’d have to put parens everywhere for the most commonly written equations. Math prizes notation that economical because once you become fluent in reading equations, the more we can reduce the symbols we have to write, the less chaff we have to plough through to get to the wheat. So, for convenience, we simply set the convention that M and D are at the same level, and A and S are one level below.
Now, it’s important to note that when using division, it’s possible to *imply* the presence of parentheses if we are able to typeset the equation, and put the numerator directly above the denominator, separated by a horizontal line. However, when we don’t have the ability to typeset the equation and everything must be put on the same line as is sometimes the case in a computer terminal, then we wouldn’t be able to use implicit parens, we’d have to explicitly parenthesize the numerator and denominator: `(a + b + c)/(d – e)`.
An important thing to realize about all of this is that this is a discussion only about how we represent an expression and nothing at all to do with the calculation itself. The whole reason we decided that we should represent an operator with a symbol that has a property called associativity, and the reason we invented order of operations, is simply for convenience. Math doesn’t require these things at all, we could simply have no concept of associativity or order of operations and we could just fully parenthesize every single operation in the way we mean it to be carried out. Again, we’ve only invented these things to resolve ambiguity and make notation more convenient, that’s it.
With that in mind: **It is absolutely ridiculous for anyone to assert that order of operations and associativity do not resolve ambiguity**. That is one of the main reasons they exist! If it were possible to use current mathematical notation to write something ambiguous, that means we failed, and we should do another iteration on the rules to clarify those cases! No other approach makes any sense at all.
That being the case, the rules work just fine as is, and the only ambiguity in people’s minds does not arise from the notation, but nothing more than a lack of understanding about what it means.
If we apply the rules as they are to the example, we can rewrite it:
1000/5(4-2)
// Follow the rules of associativity and order of operations to fully
// parenthesize the above expression.
= ((1000 / 5)(4-2))
// Now we can actually apply the operators.
= ((200)(2))
= (400)
= 400
We can check by putting this into [Google](https://www.google.com/search?q=1000+%2F+5(4-2)) and [Wolfram Alpha](https://www.wolframalpha.com/input?i=1000+%2F+5%284-2%29) and we see that everyone agrees, so we’re all good!
Latest Answers