The Math Equation That Tried to Baffle the Internet



Mathematical Twitter is normally a quiet, well-ordered place, a refuge from the aggravations of the internet. But on Sunday, someone who must have been a troll off duty decided to upset the stillness and did so with a surefire provocation.

It has to do with something that high school teachers call "the order of operations." The latest blowup concerned this seemingly simple question:

8 ÷ 2(2+2) = ?

Many respondents were certain the answer was 16. Others heard Yanny, not Laurel, and insisted the right answer was 1. That's when the trash talking began. "Some of y'all failed math and it shows," said one. Another posted a photo showing that even two different electronic calculators disagreed. The normally reassuring world of math, where right and wrong exist, and logic must prevail, started to seem troublingly, perhaps tantalisingly, fluid.

The question above has a clear and definite answer, provided we all agree to play by the same rules governing "the order of operations." When, as in this case, we are faced with several mathematical operations to perform — to evaluate expressions in parentheses, carry out multiplications or divisions, or do additions or subtractions — the order in which we do them can make a huge difference.

When confronted with 8 ÷ 2(2+2), everyone on Twitter agreed that the 2+2 in parentheses should be evaluated first. That's what our teachers told us: Deal with whatever is in parentheses first. Of course, 2+2 = 4. So the question boils down to 8÷2×4.


A seemingly simple equation stumped the internet.

And there's the rub. Now that we're faced with a division and a multiplication, which one takes priority? If we carry out the division first, we get 4×4 = 16; if we carry out the multiplication first, we get 8÷8 = 1.

Which way is correct? The standard convention holds that multiplication and division have equal priority. To break the tie, we work from left to right. So the division goes first, followed by the multiplication. Thus, the right answer is 16.

More generally, the conventional order of operations is to evaluate expressions in parentheses first. Then you deal with any exponents. Next come multiplication and division, which, as I said, are considered to have equal priority, with ambiguities dispelled by working from left to right. Finally come addition and subtraction, which are also of equal priority, with ambiguities broken again by working from left to right.

To help students in the United States remember this order of operations, teachers drill the acronym PEMDAS into them: parentheses, exponents, multiplication, division, addition, subtraction. Other teachers use an equivalent acronym, BODMAS: brackets, orders, division and multiplication, and addition and subtraction. Still others tell their pupils to remember the little ditty, "Please excuse my dear Aunt Sally."

Now realise, following Aunt Sally is purely a matter of convention. In that sense, PEMDAS is arbitrary. Furthermore, in my experience as a mathematician, expressions like 8÷2×4 look absurdly contrived. No professional mathematician would ever write something so obviously ambiguous. We would insert parentheses to indicate our meaning and to signal whether the division should be carried out first, or the multiplication.

The last time this came up on Twitter, I reacted with indignation: It seemed ridiculous that we spend so much time in our high-school curriculum on such sophistry. But now, having been enlightened by some of my computer-oriented friends on Twitter, I've come to appreciate that conventions are important, and lives can depend on them. We know this whenever we take to the highway. If everyone else is driving on the right side of the road (as in the U.S.), you would be wise to follow suit. The same goes if everyone else is driving on the left, as in the United Kingdom. It doesn't matter which convention is adopted, as long as everyone follows it.

Likewise, it's essential that everyone writing software for computers, spreadsheets and calculators knows the rules for the order of operations and follows them. For the rest of us, the intricacies of PEMDAS are less important than the larger lesson that conventions have their place. They are the double-yellow line down the centre of the road — an unending equals sign — and a joint agreement to understand one another, work together, and avoid colliding head-on. Ultimately, 8 ÷ 2(2+2) is less a statement than a brickbat; it's like writing the phrase "Eats shoots and leaves" and concluding that language is capricious. Well, yes, in the absence of punctuation, it is; that's why we invented the stuff.

So on behalf of all math teachers, please excuse us for drilling your younger selves on this tedium. My daughters spent weeks on it each school year for several years of their education, as if training to become automatons. No wonder so many students come to see math as an inhuman, meaningless collection of arbitrary rules and procedures. Clearly, if this latest bout of confusion on the internet is any indication, many students are failing to absorb the deeper, essential lesson. Perhaps it's time to stop excusing dear Aunt Sally and instead embrace her.

Better still would be to teach everyone how to write unambiguous math expressions, and then all of this would go away. For those students destined to become software designers, writing code that can handle ambiguous expressions reliably whenever they arise, by all means exhume Aunt Sally from her crypt. For everyone else, let's spend more time teaching our students the more beautiful, interesting and uplifting parts of mathematics. Our marvellous subject deserves better.