What is the logic behind PEMDAS?

1.53K views

I know some places use BIDMAS as well. Overall though, to someone who knows little about mathematics, why is this the correct order? What’s the exact logic behind it

In: 6

54 Answers

Anonymous 0 Comments

While it is absolutely true that the most important thing is that it’s a convention that we all agree on, there is some logic behind it.

Expressions in parentheses are evaluated first, because that’s why they were introduced in the first place: to let you change the priority of operations.

Multiplication and division have the same priority, because they are basically the same operation: division is just multiplication by the reciprocal of the divisor. The same is true for addition and substraction. (Before someone comes here to nitpick this, yes, I know, it depends on the precise semantics of the operations and the underlying field, but I think we all know what OP is talking about.)

Multiplication has a higher priority than addition, because it makes intuitive sense. This is kinda subjective, I suspect this perception is mostly formed by the fact that we are used to it being this way (sort of circular, it comes back to this being a convention that we are taught at a young age). I think of it this way: you are multiplying a single term (you’re just making more of it, you’re not adding anything new), so it makes sense to perform that operation before adding new stuff – the terms are sort of glued by multiplication. This doesn’t make a whole lot of sense when you’re just thinking of numbers, but it starts to be useful when you start giving the numbers names (like variables for example).

It also makes sense when you think of how we use units. When you write 20m, what you’re really saying is that you’re multiplying *a meter* (which is some distance) by twenty. It makes sense to do that before you start adding other stuff in. If the priorities were reversed, then something like “20m + 2cm” would mean “20 * cm * (2 + m)” in our system, which doesn’t make much sense (also it’s obviously not what we wanted, suddenly we have 20cm instead of 20m). To get the same thing, you’d have to write “(20m) + (2cm)” and that’s much less elegant.

That’s really what it comes down to: how elegant and readable the expression ends up being. Other operations also have priorities that are chosen based on this principle. For example, in programming languages, you usually have an operator called “function call”, which looks like two parentheses after a function name (foo(), for example), and it has a higher priority than addition for example. This is because when you write something like “2 + foo()”, you probably don’t want to add 2 to the function foo and then call the result, you want to add 2 to the result of the function foo (sometimes you want the opposite, but it’s less common, so it earns the more cumbersome notation).

You are viewing 1 out of 54 answers, click here to view all answers.