icon

The PEMDAS Paradox

David Linkletter Share this page

It looks trivial but it keeps going viral. What answer do you get when you calculate $6\div 2(1+2)$? This question has reached every corner of social media, and has had millions of people respond with two common answers: $1$ and $9$.

You might think one half of those people are right and the other half need to check their arithmetic. But it never plays out like that; respondents on both sides defend their answers with confidence. There have been no formal mathematical publications about the problem, but a growing number of mathematicians can explain what's going on: $6\div 2(1+2)$ is not a well-defined expression.

Well-defined is an important term in maths. It essentially means that a certain input always yields the same output. All maths teachers agree that $6\div (2(1+2)) = 1$, and that $(6\div 2)(1+2) = 9$. The extra parentheses (brackets) remove the ambiguity and those expressions are well-defined. Most other viral maths problems, such as $9-3\div 1/3 + 1$ (see here), are well-defined, with one correct answer and one (or more) common erroneous answer(s). But calculating the value of the expression $6\div 2(1+2)$ is a matter of convention. Neither answer, $1$ nor $9$, is wrong; it depends on what you learned from your maths teacher.

The order in which to perform mathematical operations is given by the various mnemonics PEMDAS, BODMAS, BIDMAS and BEDMAS:

  • P (or B): first calculate the value of expressions inside any parentheses (brackets);
  • E (or O or I): next calculate any exponents (orders/indices);
  • MD (or DM): next carry out any multiplications and divisions, working from left to right;
  • AS: and finally carry out any additions and subtractions, working from left to right.

Two slightly different interpretations of PEMDAS (or BODMAS, etc) have been taught around the world, and the PEMDAS Paradox highlights their difference. Both sides are substantially popular and there is currently no standard for the convention worldwide. So you can stop that Twitter discussion and rest assured that each of you might be correctly remembering what you were taught – it's just that you were taught differently.

The two sides

Mechanically, the people on the "9" side – such as in the most popular YouTube video on this question – tend to calculate $6\div 2(1+2) = 6 \div 2 \times 3 = 3\times 3 = 9$, or perhaps they write it as $6\div 2(1+2) = 6\div 2(3) = 3(3) = 9$. People on this side tend to say that $a(b)$ can be replaced with $a\times b$ at any time. It can be reduced down to that: the teaching that "$a(b)$ is always interchangeable with $a\times b$" determines the PEMDAS Paradox's answer to be $9$.

On the "1" side, some people calculate $6\div 2(1+2) = 6\div 2(3) = 6\div 6 = 1$, while others point out the distributive property, $6\div 2(1+2) = 6\div (2+4) = 6\div 6 = 1$. The driving principle on this side is that implied multiplication via juxtaposition takes priority. This has been taught in maths classrooms around the world and is also a stated convention in some programming contexts. So here, the teaching that "$a(b)$ is always interchangeable with $(ab)$" determines the PEMDAS Paradox answer to be $1$.

Mathematically, it's inconsistent to simultaneously believe that $a(b)$ is interchangeable with $a\times b$ and also that $a(b)$ is interchangeable with $(ab)$. Because then it follows that $1 = 9$ via the arguments in the preceding paragraphs. Arriving at that contradiction is logical, simply illustrating that we can't have both answers. It also illuminates the fact that neither of those interpretations are inherent to PEMDAS. Both are subtle additional rules which decide what to do with syntax oddities such as $6\div 2(1+2)$, and so, accepting neither of them yields the formal mathematical conclusion that $6\div 2(1+2)$ is not well-defined. This is also why you can't "correct" each other in a satisfying way: your methods are logically incompatible.

So the disagreement distills down to this: Does it feel like $a(b)$ should always be interchangeable with $a\times b$? Or does it feel like $a(b)$ should always be interchangeable with $(ab)$? You can't say both.

(Image from Quora)

In practice, many mathematicians and scientists respond to the problem by saying "unclear syntax, needs more parentheses", and explain why it's ambiguous, which is essentially the correct answer. An infamous picture shows two different Casio calculators side-by-side given the input $6\div 2(1+2)$ and showing the two different answers. Though "syntax error" would arguably be the best answer a calculator should give for this problem, it's unsurprising that they try to reconcile the ambiguity, and that's ok. But for us humans, upon noting both conventions are followed by large slices of the world, we must conclude that $6\div 2(1+2)$ is currently not well-defined.

Support for both sides

It's a fact that Google, Wolfram, and many pocket calculators give the answer of 9. Calculators' answers here are of course determined by their input methods. Calculators obviously aren't the best judges for the PEMDAS Paradox. They simply reflect the current disagreement on the problem: calculator programmers are largely aware of this exact problem and already know that it's not standardised worldwide, so if maths teachers all unified on an answer, then those programmers would follow.

Consider Wolfram Alpha, the website that provides an answer engine (like a search engine, but rather than provide links to webpages, it provides answers to queries, particularly maths queries). It interprets $6\div 2(1+2)$ as $9$, interprets $6\div 2x$ as $3x$, and interprets $y=1/3x$ as the line through the origin with slope one-third. All three are consistent with each other in a programming sense, but the latter two feel odd to many observers. Typically if someone jots down $1/3x$, they mean $\frac{1}{3x}$, and if they meant to say $\frac{1}{3}x$, they would have written $x/3$.

In contrast, input $y=\sin 3x$ into Wolfram Alpha and it yields the sinusoid $y=\sin (3x)$, rather than the line through the origin with slope $\sin 3$. This example deviates from the previous examples regarding the rule "$3x$ is interchangeable with $3\times x$", in favor of better capturing the obvious intent of the input. Wolfram is just an algorithm feebly trying to figure out the meaning of its sensory inputs. Kinda like our brains. Anyway, the input of $6/x3$ gets interpreted as "six over $x$ cubed", so clearly Wolfram is not the authority on rectifying ugly syntax.

On the "1" side, a recent excellent video by Jenni Gorham, a maths tutor with a degree in Physics, explains several real-world examples supporting that interpretation. She points out numerous occasions in which scientists write $a/bc$ to mean $\frac{a}{bc}$ . Indeed, you'll find abundant examples of this in chemistry, physics and maths textbooks. Ms. Gorham and I have corresponded about the PEMDAS Paradox and she endorses formally calling the problem not well-defined, while also pointing out the need for a consensus convention for the sake of calculator programming. She argues the consensus answer should be 1 since the precedence of implied multiplication by juxtaposition has been the convention in most of the world in these formal contexts.

The big picture

It should be pointed out that conventions don't need to be unified. If two of my students argued over whether the least natural number is 0 or 1, I wouldn’t call either of them wrong, nor would I take issue with the lack of worldwide consensus on the matter. Wolfram knows the convention is split between two answers, and life goes on. If everyone who cares simply learns that the PEMDAS Paradox also has two popular answers (and thus itself is not a well-defined maths question), then that should be satisfactory.

Hopefully, after reading this article, it's satisfying to understand how a problem that looks so basic has uniquely lingered. In real life you should use more parentheses and avoid ambiguity. And hopefully it’s not too troubling that maths teachers worldwide appear to be split on this convention, as that’s not very rare and not really problematic, except maybe to calculator programmers.

For readers not fully satisfied with the depth of this article, perhaps my previous much longer paper won't disappoint. It goes further into detail justifying the formalities of the logical consistency of the two methods, as well as the problem's history and my experience with it.


About the author

David Linkletter

David Linkletter

David Linkletter is a graduate student working on a PhD in Pure Mathematics at the University of Nevada, Las Vegas, in the USA. His research is in set theory - large cardinals. He also teaches undergraduate classes at UNLV; his favourite class to teach is Discrete Maths.

Comments

Permalink

1 (meaning that juxtaposition has higher precedence) is what makes sense

it makes life easier and it is more intuitive

people only say 9 because they are using the oversimplification they learned at kindergarten

Permalink

Math syntax is only a syntax error when there are undefined symbols, or when the expression has no numbers in it. So 6÷2(1+2)=9 with no syntax error.
(3×(3)+3)=12
(3+(3)×3)=12
[3×(3]+3)=18
[3+(3]×3)=12
(3×[3)+3]=12
(3+[3)×3]=18
[3×[3]+3]=12
[3+[3]×3]=12
Also, parentheses have precedence over brackets.

Who's syntax check? Here's an interesting case where
=6/2(1+2)
is a syntax error:
LibreOffice Calc found an error in the formula entered.
Do you want to accept the correction proposed below?
=6/2*(1+2)

Accepting the proposal yields 9. But it refused to assume that was the intended meaning.
This is a great choice because otherwise you would have to have a setting as to
which convention would be used to resolve the ambiguity of whether the 2( was distributed or
just multiplied. It is perhaps interesting to note that did not offer=6/(2*(1+2)) instead
suggesting simply multiply might be the usual meaning.

Permalink

Late to this post but it's a pretty good article so I wanted to discuss it further.

Isn't there a further contradiction with the whole a(b) = (ab) argument in the choice of a?

If you have 6/2(1+2), then what determines that a = 2 and not 6/2?

I was going to comment this exact thing. Calling this an issue with an acronym for order of operations and suggesting a paradox doesn't really make sense when the real reason for the ambiguity of the expression is because of dissension on whether the term a in a(b) in this case is 2 or 6/2.

If this had been written using a vinculum instead of a solidus (or worse, the obelus) the ambiguity would be resolved:

6
-- (1 + 2) = 9
2

versus

      6
--------- = 1
2(1 + 2)

Saying that there is no recognized standard also doesn't seem accurate. What about ISO 80000-1 and ISO 80000-2? ISO 80000-1:2009 section 7.1.3 which discusses printing rules for mathematical expressions indicates:

 a
--- = a / (bc), NOT a/b · c
bc

ISO 80000-2:2009(E) also states that only the vinculum and solidus are acceptable as general division operators. A colon should only be used for ratios and the obelus should. not be used at all.

There's also the Physical Review Style and Notation Guide by the American Physical Society, but if I were to choose a standard, I'd go with an internationally recognized standard.

My question is, since there are in fact published international standards regarding presenting mathematical expressions (and in part their interpretation as noted above), why isn't the academic community either aware of or using those standards when teaching, particularly in getting rid of using the obelus altogether?

We are in agreement with the answer of 1, but I will take it one step further. Regardless what indicator is used to show division, the equation is still clear. I know of only one method to resolve parentheses and that is with the distributive method. Regardless how the equation is written, you will always end up with (2*2)+(2*1)=6.

"If you have 6/2(1+2), then what determines that a = 2 and not 6/2?"

If a = 6/2 then the expression would be presented as (6/2)(1+2).

Is it not usual when a constant or variable is defined as a term or expression of numbers that the numbers be enclosed in parentheses?

Permalink

Using a real life problem to reach the solution, imagine you have 6 sweets and 2 groups of 1 girl and 2 boys to share them around.

The kids all get one sweet each, so the answer is 1. If the answer were 9, you'd be creating 3o sweets out of thin air!

Permalink In reply to by Lucky13pierre (not verified)

Using a real life problem to reach the solution, imagine you have 6 index cards and one group of 1 girl and 2 boys. Your instructions are to first get rid of half of the cards, then give one card to each child, then tell each child to tear their card into 3 pieces.

You now have 9 pieces, so the answer is 9.

And who is to say which "real life problem" is the correct one? Nobody. We can always invent a word problem to fit whatever arithmetic steps we want.

(and, yes, it's been 8 months, so probably nobody will ever read what I wrote...)

Permalink

David, in your exceptional article, you mentioned that the people in the 1 category will sometimes point to the distributive method for how to get an answer of 1. If the distributive method is not used in this type of equation, where is it used? Be gentle with me! I am an engineer, not a mathematician!

Permalink

I do wish the international body of mathematicians could sort this one out. In algebra the implicit multiplier is always understood to take precedence. In other 'random' mathematical expressions whoever gave the mathematical world the permission to arbitrarily express 2*(1+2) as 2(1+2)? In order to follow logical consistency we spend years teaching kids algebraic mathematics where 2X is always 2X (inseparable and implicit takes precedence). If you wish to express 6 / 2 * (1+2) you simply do not have any permission to lazily and arbitrarily express it as 6 / 2(1+2) for this very reason. I know that even the maths professors are contorting themselves over this, but I think it should be sorted out. And logically it should simply be nailed down that implicit multiplication takes precedence because otherwise all of algebra is wrong. ab no longer means ab. I thought it was. I was taught Brackets Of Division (2 of something takes precedence over division and multiplication). But it turns out even that is not agreed on as more seem to hold to BODMAS meaning 'Brackets Orders Division...'

The International Organization for Standardization (ISO) has a document ISO 80000-2 whose topic is "Mathematical signs and symbols to be used in the natural sciences and technology".

It says (in a 2020 version), regarding the two standard symbols for multiplication, "Either symbol may be omitted if no misunderstanding is possible". It does not follow up by saying that when the symbol has been omitted the multiplication automatically rises to a higher level of precedence.

Consider four expressions:
4+(5-2)
4-(5-2)
4*(5-2)
4/(5-2)
The notational convention is that in one of those four cases the operator adjacent to the opening bracket can be omitted. That case is multiplication.

The idea that omitting the operator automatically gives it higher precedence than division is ludicrous. Omitting the operator can not, and should not, change its meaning.

Of course, it is true that algebraic notations such as xy or 2x are considered grouped. But the similarity of, for example 2(3), to such algebraic expressions superficial, and is not a basis for considering 2(3) grouped.

That's my perspective, anyway.

Permalink

This is a complete use or words but not use simple Arithmethic for resolve.
1. Arithmetic try to solve many terms into 1.
2. When we dont see any agrupation signal we know there's an order to solve any problem.
3. Calculators can't make maths, just only results.
4. Your single example corrspond to the form c:b(a+b). Simple algebraic definition. ¿Where is the rule that show me Wolframs is superior to math for follow your suggested formula?
5.This nosense publication correspond to try to insert deconstructional Gramsci thinking where it is impossible to do. And follow same steps in the science of maths, bases starts in arithmethics.

2 Results:
2.1. Arithmetican: 1

Lol

Permalink

I have followed a lot of the comments regarding the subject expression and the controversy created. Many agree that the expression is ambiguous but some settle for either PEMDAS and the order of operations from left to right while others use juxtaposition to resolve the group first. A lot of the confusion results from the use of the obelus (:-) for division with some noting that it is a syntax error and one should use either the slash (/) or more preferably the vinculum (---) instead. However, I have seen a different way of solving the expression that uses the uncontroversial rule for how to solve the division of fractions. i.e, multiply the first fraction by the reciprocal of the second fraction. To wit: the expression 6:- 2(1+2) uses the obelus to indicate division. But all can agree that any value is equal to itself if divided by 1, so if we write the expression as 6 over 1 :- 2(1+2) over 1 then it becomes 6 over 1 x 1 over 2(1+2)[the reciprocal]. From here it does not matter which operation is chosen first, i.e to either resolve the denominator first: 6 over 6 or to divide the group factor (in this case 2) into the numerator it becomes 3 over 3, and both methods result in 1 as the answer. Any comment on this?

  • Want facts and want them fast? Our Maths in a minute series explores key mathematical concepts in just a few words.