Contrary to what the others say, it kinda does matter (although not explicitly to the letter).
Consider if you go to buy some drinks from the store but the shelves are nearly bare so all you can get are a couple of six-packs and a few singles.
These are some ways to write how many you got in total:
Using parentheses to group:
* (2×6)+3 = 15
* 3+(2×6) = 15
Using PEMDAS to know to do multiplication first:
* 2×6+3 = 15
* 3+2×6 = 15
Just evaluating left-to-right *without* using precedence:
* 2×6+3 = 15
* 3+2×6 = 30
Note how, in the case without using either the parentheses or precedence, you get different answers depending on the order, one of which is clearly wrong. This is because multiplication and division are higher-order operations than addition and subtraction.
More specifically, multiplication is just repeated addition and division is repeated subtraction. Now see if you did the repetition first:
* 6+6+3 = 15
* 3+6+6 = 15
They’re both the same, regardless of the order! (Since you’ve reduced it to a single level of precedence, the order doesn’t matter.)
(Also, exponentiation goes in front of the others because it’s a yet higher-order (repeated multiplication).)
.
So, we can either agree to do higher-order operators first, which applies the repetition to reduce the levels of precedence, or we can use a lot of parentheses to specify the order.
But when I said at the start they don’t have to be explicitly to the letter, that’s because within a given level of precedence it doesn’t matter.
Suppose after you got those drinks you drank two, now how many are left?
* 6+6-2+3 = 13
* 3+6+6+(-2) = 13
Because subtraction and addition are just inverses of each other, which is to say subtraction is just addition of a negative number, they’re at the same level of precedence – it doesn’t matter what order you do them in within that single level of precedence.
And while multiplication and division are a higher precedence, they’re just repeated addition and repeated subtraction, so they are also inverses of each other, and on the same level as each other, so it doesn’t matter which order you do them in within that level of precedence.
It’s easier to just say always do them in PEMDAS order. But kinda useful to see how the orders of precedence arise. It might be a little more clarified by noting it with precedence levels: (P)(E)(MD)(AS).
While the standard is just an agreed convention, it’s not really arbitrary. It can be summed up by saying “do the higher-order (more difficult/complicated) operations first”. Addition and subtraction, essentially the opposite of each other, are treated as equal and, within those two, the order of operation doesn’t matter. The same goes for multiplication and division. It’s only when you get to exponents that you need to know to go from right to left, i.e., 2^3^4 is 2^81 and not 8^4.
It’s not entirety a random choice. Parentheses, for example, kinda have to go first. If they appear anywhere else in the order they function as a deprioritizing tool, and this gives you fairly convoluted equations if you need to group certain terms, where you rapidly need to start adding multiple parentheses to ensure the terms are treated as a group. Similarly exponents kinda need to come next (again as they function as a group, or you start to need a lot of parentheses to get them to work.
It’s also not really arbitrary that addition/subtraction and multiplication/division are equal in precedence as division is just multiplication of the inverse of the number you are dividing by (Eg 5/3 is 5 x 1/3. They’re the same functions so it makes sense they are equal in precedence.
Although you could argue the division should be after multiplication as it *could* be taken to mean to include multiple terms before and after- and when writing by hand this is how it is commonly used:
A**x** + B
——————-
C**x** + D
When writing on screens you’d normally have to format it:
(A**x** + B) / (C**x** + D)
But on balance there are a *lot* of cases where you’d have to add in parentheses to treat division like this, so it makes more sense to use parentheses to group terms when needed, albeit this gives rise to the debate over “implicit multiplication” where terms are assumed grouped for multiplication when they’re adjacent to each other without an actual sign.
Eg:
Y = 1/3**x**
Where if x = 2 you’d wind up with 1/6 instead of 2/3 – this is common notation in engineering and science, but not in grade school, which results in those viral math problems you see floating about about the order of operations.
Latest Answers