Why do we have to do the P first in PEMDAS?
“Why do we have to do the P first in PEMDAS?” — Sophie, age 12
Fantastic question!
Wait… what’s PEMDAS?
If you don’t recognize the acronym “PEMDAS,” it’s a mnemonic taught in many American schools to help when simplifying algebraic expressions. The rule is to do the operations in PEMDAS order, from left to right:
Parentheses
Exponentiation
Multiplication and Division
Addition and Subtraction
For example, if we want to compute 2+7×(5-1):
First we handle what’s inside the parentheses, which has one clear operation: 5-1=4, leaving 2+7×4
There are no exponents to handle in 2+7×4, so we can skip that!
Multiplication and division: 7×4=28, leaving 2+28. There was no division.
Addition and subtraction: 2+28=30, leaving 30. The only subtraction was handled earlier in the parentheses.
So,
Why parentheses first?
To some degree, the traditional order of operations is a little arbitrary. It’s like asking why people in the US drive on the right side of the road while people in the UK drive on the left side. At some point a choice had to be made so that everyone would be on the same page. While we evaluate 2+3×4 as 2+12=14, perhaps in some addition-first parallel universe that same expression simplifies to 5×4=20.
However, whether the choice is made to do multiplication before addition or vice versa, there will inevitably be a reason you would need to do things out of order.
If 2 eggs are placed by a 3-by-4 container of eggs, how many eggs are there in total?
The container has 3×4=12 eggs, which we then add to the 2 stray eggs to find there are 2+12=14 eggs, total.
If 2 farmers and 3 ranchers each have 4 cows, how many cows are there in total?
We would first add 2+3=5 to get the total number of people and then multiply by 4 cows per person to arrive at 5×4=20 cows.
Making a choice to do multiplication first makes it impossible to read 2+3×4 as 5×4=20, while choosing to do addition first makes it impossible to read 2+3×4 as 2+12=14. The idea behind parentheses is we can override whichever choice we made when we set up our order of operations system, effectively saying, “Hey… I know this is unusual, but do this first.” In our multiplication-first world, we write (2+3)×4 to express our solution to the second problem. In the addition-first parallel universe, we would have to write 2+(3×4) to express our solution to the first problem.
Why is the rest in that order?
As I noted, the order is a little arbitrary. Why not just evaluate everything in order from left to right, for example? We could use parentheses to fix any problems that arise in that ordering, after all! If we choose to instead order evaluation by operation type, we effectively write parentheses without having to write parentheses. If it turns out there are certain operations that people tend to do before others, it would save a lot of writing if we just did those first, unless otherwise indicated.
Polynomial equations have been studied by mathematicians since at least 2000 BCE by the Babylonians. The Italian mathematicians Niccolò Fontana Tartaglia and Gerolamo Cardano famously feuded when Cardano published a solution to the cubic equation x³+ax=b for a,b > 0 in 1539 CE that was discovered just a few years earlier by Tartaglia. It seems quaint now, but academic careers were made and broken based on mathematicians’ abilities to solve such equations. After Descartes and Fermat introduced the essentials of analytic geometry, it became standard to think about shapes like circles as polynomial equations in two variables like x²+y²=1. It would be tough to overstate the importance of polynomials in the development of mathematics as we know it today.
Look how succinct these are: x³+ax=b and x²+y²=1. I didn’t have to write (x³)+(ax)=b or (x)²+(y)²=1 to clarify the order, since our order of operations exactly reflects how we want polynomials to be evaluated! I’d guess this is what made folks settle on exponentiation before multiplication before addition. Since the order of operations was developed organically by many people as algebra moved from rhetorical to syncopated to symbolic, I’m not sure anyone can definitely point to polynomials and say, “this is the reason,” but it certainly feels that way to me. It’s interesting to think what other sorts of problems could have spurred people to settle on a different pecking order for exponentiation, multiplication and addition.
What about subtraction and division?
Perhaps you noticed that addition and subtraction are the same bullet point in my PEMDAS list, as are multiplication and subtraction. What’s that about?
In the hierarchy of exponentiation, multiplication, and addition, each operation can be thought of as a sort of “higher order” version of the operation below it. Multiplication is a sort of “repeated” addition: 5c=c+c+c+c+c. Exponentiation is a sort of repeated multiplication: c⁴=c×c×c×c. We are left to reckon with whether it still makes sense to add π copies of c to itself to interpret an expression like πc, but this heuristic holds for counting numbers.
Subtracting a number is the same as adding its additive inverse: 8-5=8+(-5). Similarly, dividing by a number is the same as multiplying by its multiplicative inverse: 9÷3=9×(1/3). In this sense, it’s reasonable to think of subtraction as a form of addition and division as a form of multiplication. For that reason, the way students are taught order of operations in American schools is to do multiplication and division with the same priority, reading left to right: 5×4÷2×3 = 20÷2×3 = 10×3 = 30. Similarly with addition and subtraction: 5+4-2+3 = 9-2+3 = 7+3 = 10.
This is actually a little contentious, since it has also been historically taught that expressions should be evaluated in strict PEMDAS order. Since multiplication happens strictly before division in that system, that means 5×4÷2×3 would be interpreted as 20÷6 = 10/3 instead of 30. Similarly, 5+4-2+3 would be interpreted as 9-5 = 4 instead of 10. While I don’t think I’ve ever seen it taught that way in the US, there’s enough confusion about PEMDAS being P/E/M/D/A/S vs P/E/MD/AS that this contention is the heart of many of the math memes I see people use to farm engagement on social media by getting people to argue in the comments:
All three of the expressions in the memes above are constructed to elicit confusion about whether division should be done before or after multiplication, and your answer will vary based on whether you read PEMDAS as P/E/M/D/A/S or P/E/MD/AS. While I (along with pretty much every mathematician I know) was taught to think P/E/MD/AS is the correct answer, the real debate is whether the expressions are clearly and unambiguously communicating something to their intended readers. I think that answer has to be “no,” since the comment sections reveal it’s a pretty effective engagement farmer!
It sort of feels like when dictionaries updated the word “literally” with an alternative definition of “figuratively” — i.e., “not literally.” People had been using the word both ways for years and I was never sure which way people meant it. Now it’s official, but that’s just how language evolves. When things are unclear, it’s up to us to figure things out from context clues or ask questions.
For order of operations, however, we have a nice fix that remains perfectly unambiguous: parentheses. If I want to communicate what I understand the expressions in the three memes to say according to my understanding of PEMDAS, I wouldn’t write them as they are written above, since I’m now sensitive to the ambiguity. I’d instead write:
(8/2)(2+2)
(8/2)(8/2)
(6/2)(1+2)
Of course, the point of such memes is not clear mathematical communication, but the exact opposite!