# PEMDAS Problems

Inspired by this post at Education Week, by David Ginsburg, and a fruitful discussion in the comments, I thought I’d make my own post about the order of operations. I feel the need to do this because of my own experiences teaching Algebra 1 and correcting the habits of Algebra 2, Precalculus, and Calculus students. The problem is often with their misunderstanding of the ubiquitous “PEMDAS” approach to order of operations (parentheses, exponentiation, multiplication, division, addition, subtraction).

The classic example given by those who have discussed this before is an expression like the following. This example shows the problem with instructing students to simply “add then subtract”:

$8-4+1$

You can easily see that blindly following PEMDAS would give you an answer of 3, not 5. In reality, addition and subtraction can be done in any order, provided that you think of the expression this way:

$8+(-4)+1$

I have to constantly reinforce in my students the notion that the “-” goes with the 4. It owns it. That’s the right way to think of it, since subtraction (and division) are just shorthand for addition by the additive inverse (and multiplication by the multiplicative inverse). That’s right kids, subtraction is an illusion. The typical Real Analysis approach is to use the field axioms to define the properties of addition. Here they are:

1. If $x$ and $y$ are in the field, so is $x+y$ (closure).
2. $x+y=y+x$ (commutativity)
3. $(x+y)+z=x+(y+z)=x+y+z$ (associativity)
4. There exists an element $0$ such that $0+x=x$ for all $x$ (identity)
5. For each $x$ there is an element called $-x$ such that $x+(-x)=0$ (inverse)

There are almost identical ones for multiplication, and then one more axiom for distribution. Just listing the field axioms for addition  helps us in the discussion of order of operations. As I said above, subtraction is never really mentioned. We only later define $x-y$ to mean $x+(-y)$.

Similarly, division is an illusion. Or more precisely, it is defined in terms of multiplication. We define $x/y$ to mean $x\cdot(1/y)$.

The other important thing to notice is that addition and multiplication are binary operations, meant to be functions of two variables. So the expression $x+y+z$ is defined to mean $(x+y)+z=x+(y+z)$.

But the problems with PEMDAS don’t stop with multiplication and addition. There are many other issues with the order of operations as well. We lie to students when we just tell them they’ll encounter those limited operations in tidy situations. Here’s a perfectly legitimate expression with which PEMDAS would flounder:

$-2^{3^2}+\left|\frac{2\sin{0}+3!}{2-\sqrt{9}}\right|\pmod{3}$

The reason the expression is so difficult for PEMDAS is because PEMDAS doesn’t acknowledge the existence of other functions or grouping symbols, and ignores the possibility of nested exponentiation.

As another somewhat related example, I often have Calculus students who evaluate the following expression incorrectly (because they misuse their calculator):

$e^{(0.05)(10)}$

And some high school students at every level still struggle with evaluating these expressions:

• $-2^2$
• Given $f(x)=-x^2+x$, evaluate $f(-2)$.

The wikipedia article on Order of Operations is very clear on all this, but I wanted to just highlight some of the common misconceptions. For more, feel free to check out that article. I’m in no way recommending that PEMDAS be removed from math curriculum, but that it be used with great care. And by the way, the expression above evaluates to 1.

## 5 thoughts on “PEMDAS Problems”

1. x+y=y+x (commutativity)

There are almost identical ones for multiplication

Curious on your thoughts regarding quaternions & matrices where multiplication isn’t commutative and how it interplays with your discussion

-t

• Good addition to the discussion, brother! Yes, maybe I should have gone into that a bit. Quaternions, matrices, symmetry groups, the ring of integers mod n, the group of rationals with addition…all examples of things that aren’t fields. We’d have to generalize the discussion of order of operations to handle other algebraic structures. In every discussion of order of operations, though, I think you’d need to go all the way back to the axioms and definitions for the algebra.

For the specific examples I gave, I have in mind the reals. But everything I’ve said immediately generalizes to any other field, like the complex numbers.

2. There was a time, the “new math” era, when mathematics educators recommended that the additive inverse of y, namely -y, be written

¯y

to emphasize your point about the fact that x – y is x + ¯y. Such pedantry was abandoned for the same reason that we are careless in casual English speech about ambiguity. “The old men and women left the room.” could mean “The old (men and women) left the room.” or “The (old men) and women left the room.” We can clarify by context or by intonation. So we don’t want students to react mechanically to that other language, algebra, either but to think about the meaning of the mathematics that they write.

We do in fact have a list of conventions that covers all the cases you mention, even though they don’t exactly fit PEMDAS. By convention “x^y^z” means “x^(y^z)”. Treating [ ] and | | like parentheses makes them fit PEMDAS, as long as we realize that [(]) doesn’t make sense. “x+yz!” means “x + (y * (z!))”. Some parens mean function application: “(mod x)” and “f(x)”. But we still need conventions beyond all your examples.

For the same reason–context–we don’t devise a separate symbol for addition of functions, but write f + g to mean “the function which is defined pointwise as follows: (f+g)(x) is defined to evaluate to f(x) + g(x)”. Formally, that’s nonsense. Addition of functions is not the same thing as addition of numbers, so a new symbol, say ⊕, “should” be used.

We count on context to deal with these things. That’s good, unless we’re trying to write an “artificially intelligent” computer programming, which requires all context to be explicit.

So in my humble opinion, I think that the difference between ⊕ and + ought to be pointed out, and then dismissed with this encouraging, humanizing word: “But you’re not machines, so we won’t be so pedantic.”

You may have to define the word “pedantic.” 🙂

One point I should have made clearer is that teachers shouldn’t assume these conventions are known by their students, teachers need to teach them explicitly. You mentioned that $x^{y^z}$ is shorthand for $x^{(y^z)}$. That convention should be taught to students, not assumed to be obvious. Likewise, students should at some point be explicitly taught that $\frac{a+b}{c+d}$ really means $(a+b)/(c+d)$. And the list could go on.
It’s interesting you mention the whole $(f+g)(x)$ definition. I go over function operations in Algebra 2 and in Precalculus. In Algebra 2, I gloss over the fact that we’re ‘overloading’ the operators a bit. But in my Precalculus class, I always make a point of mentioning what you said.