# Ambiguous PEMDAS

Oliver Knill

April/9/2014

 Abstract: even in mathematics, ambiguities can be hard to spot. The phenomenon seen here in arithmetic goes beyond the usual PEMDAS rule and illustrates an ambiguity which can lead to heated arguments and discussions. This document is chronological and contains add-ons, either if something new was written about it or if somebody sent something interesting. See especially some Slides [PDF] from April, 2018.

## What is 2x/3y-1 if x=9 and y=2 ?

Did you get 11 or 2? If you got 11, then you are in the BEMDAS camp, if you got 2, you are in the BEDMAS camp.
In either case you can relax because you have passed the test. If you got something different you are in trouble although! There are arguments for both sides. But first a story.

## A true story

I got today following lovely story from the director of curriculum of some some school district:

 "The problem 2x/3y-1 with x=9 and y=2 was actually posed for a 5th grade homework question and it is interesting how much debate has occurred between our parents. The students who had help from parents had the answer of 2. The teacher explained that the correct answer was 11."

Who is right?

I wrote back:

"It depends on how the brackets are understood. There are two interpretations:
x=9; y=2;

(2x/3)y-1            gives  11
2x/(3y)-1            gives   2

It is not clear what the textbook had intended with the 3y. As written, it can be interpreted both ways. Yes, one could argue that without brackets the given order matters. One can however also argue that "3y" is a unit which belongs together. So, everybody is right and that the textbook problem has just been unclear."

This is actually a really fun topic. Lets expand a bit on it and explain why we can argue both ways. I bet most humans get the answer 2. [Update April 16, 2014: I made an experiment with my calculus class, in which
60 students submitted answers on paper: all except two got the answer 2.

Interestingly, the two other answers were 18/5. This is what you get if read it as 2x/(3y-1). Nobody got 11]. The interesting thing is that if you want to use technology then the answer is 11:

javascript gives 11, or wolfram alpha gives 11 or mathics (based on python) gives 11 too.

## What is x/3x?

It depends again on whether one has 3x bundled together or not. Both answers x2/3 or 1/3 should be counted correct because the parenthesis had been missing. One should write either x/(3x) or (x/3)x in order to make the problem clear. Here is what the computer algebra system Mathematica does:
x/3x

2
x
Out[1]= --
3

x/(3x)

1
Out[2]= -
3

The computer has chosen to do the division first. This is natural if one looks as division and multiplication as operations on the same level. To play the devils advocate, note however that the famous PEMDAS (parenthesis, exponents, multiplication, division, addition and subtraction) has the M before the D so that we would have to accept the second one ...

Its funny that in Excel, there is a rule BEDMAS (Brackets, Exponents, Division, Multiplication, Addition, Subtraction), which reverses Multiplication and division. One could therefore call the original question the BEMDAS-MEDMAS conflict. Different programming languages might do things differently. Your browser computes in Javascript with the BEDMAS rule:
  document.write(2/3*5);
document.write(2*5/3);

gives both 10/3. Try it out. Funny by the way (and totally unrelated to the topic discussed here) that the results are different
3.333333333333333
3.3333333333333335

illustrating that computers do not honor basic laws of arithmetic. The mathematics of rounding error arithmetic is subtle. My PhD advisor Oscar Lanford knew much about this. By the way, also Mathematica adhers to BEDMAS and does division before multiplication. It is in line with Excel and javascript as probably most programming languages like Perl.

## What is the source of the problem?

We know that addition and subtraction orders can be interchanged:
3+4-3  = (3+4)-3 = 3+(4-3)

This is called associativity. But already this is trickier if one tries to modify this because
3-4+3  = (3-4)+3 = 3-(4+3)

How come, associativity does not hold here? You find out. Since the logarithm gives an isomorphism between the group (R,+) and (R -{0}, *), where * is multiplication, we also have ambiguities in the multiplicative case evenso the multiplicative group (R-{0},*) is by definition associative. But it is the role of the division which must be made clear:
12/(3*2)      = 2
(12/3)*2      = 8

gives different answers. This can not be discovered well in algebra situations like
12/3x

which is ambiguous. Both of the following expressions are clear, but give different results:
12/(3*x)      = 4/x
(12/3)*x      = 4x

This is also often a source of error in addition, as the minus sign has to be carried through:
3-4+3
(3-4)+3 = 2
3-(4+3) = -5

It is this case which makes the argument that the bracket should be placed to the left. The additive case is also a reason which seduces not to write the brackets in the multiplicative case. It always leads to trouble.

## An other example

What is
x/x/x     ?

We again have two interpretations
(x/x)/x = 1/x
x/(x/x) = x

But since now, we have only divisions and no multiplication, it is even less clear what comes first. When dealing with fractions, we often make this clear by the size of the division lines
    x
-----
x            =  x
-
x

It has become clear that we first do the division with the smaller division line and
    x
-
x            =  1/x
----
x

What does Mathematica do? Lets look and enter
2/100/2

2/(100/2)   = 1/25
(2/100)/2   = 1/100

Mathematica choses the second choice (as does javascript). It makes the first division first.

## An ambiguous example with exponents

So, Mathematica does things from the left. Lets look now at exponents. What is
3^3^3  ?

Again we have an ambiguity with two cases:
(3^3)^3 = 19683
3^(3^3) = 7625597484987

Leaving out the brackets invites trouble. Yes, one could argue that the first example is more natural, but then, a printed version of a textbook might have the third 3 smaller so that the reader is seduced to first compute 3^3 and put that into the exponent, producing a much larger number. In the following example, this is even less clear what the writer intends because expressions like 102 are often treated together as we write 106 for a million. The 106 has become a unit: so, if we write
2^10^2

(2^10)^2   = 1048576
2^(10^2)   = 1267650600228229401496703205376

is correct? Maybe we should ask our professional computer algebra system again. Mathematica 9.0 gives the second choice, if 2^10^2 is entered!
Now we see that even professionals have difficulty to decide.

 For (a/b/c) the algebra system starts evaluating from the left, while for (a^b^c) it starts evaluating from the right.

How come, Mathematica does that? The reason is that a^x is a short hand for Exp[x Log[a]]. Now, if you write expressions like Exp[Exp[Exp[x]]], then by nature, we start evaluating from the right. If we write f(g(x)), we first compute g(x) and then f(g(x)) even so f is written first.

Lets go back to division. If we write f(x)=1/x then f(f(x))=x but (1/1)/x) = 1/x and 1/(1/x) = x. We see that the argument of starting to evaluate the division from the right when writing 1/1/x has some merit too because it even gives in the division case the result we would get if we wrote the expressions as operators.
This is why the parents and the teacher have disagreed. And both were right. Because both way to write things make sense in some way.

 There is only one solution: write the parenthesis.

P.S. This reminds me: when I was in school, there had been a war about whether to use Reverse Polish Notation (RPN) or not for calculators. There was the "HP camp" using calculators from Hewlett-Packard which used RPN and there was the "TI camp" using calculators from Texas Instruments which did not. I had been in the TI camp (even hardware hacking them) and as a student found the RPN strange. Of course, after having studied mathematics and working with computer algebra systems for a long time, RPN has become natural too. In Mathematica, one often makes computations by adding commands from the right like in
256 // Sqrt // Exp // Floor // PrimeQ

which takes the square root of 256, then exponentiates it, take the integer part and then answers the question whether this is prime. It is equivalent to
PrimeQ[Floor[Exp[Sqrt[256]]]]

but avoids the brackets. I use the first way often when computing interactively, while the second one when writing code like the following which looks for the statistics of primes in a subexponential sequence of integers:
F[n_]:=Floor[Exp[Sqrt[n]]];
s=Table[If[PrimeQ[F[n]],1,0],{n,1000}];
G[n_]:=Sum[s[[k]],{k,n}]*Log[n]/n;
ListPlot[Table[G[n],{n,Length[s]}],PlotRange->{0,1}]

If you are curious: here is the Plot.

P.S. An other interesting (a bit unrelated) story is the ambiguity introduced by decimal marks and dividing numbers into groups. Especially in journalism, one writes things like 121.123 or 121,123 meaning 121123 and not 121 + 123/1000. Even so it is now well established that "the symbol for the decimal marker shall be either the point on the line or the comma on the line" the comma or decimal point is still used frequently to divide numbers into groups, despite the fact that it clearly violates the ISO 31-0 standard. But habits are hard to change.

Document history:
• 4/9/2014
• 4/13/2014 change title, found BEDMAS Excel page and put question first
• 4/14/2014: add picture, motivated from here using background drop from here.
• 4/14/2014: references
• A hpmuseum forum example
• A physics forum example: 48/2(9+3)
• advocates Divide and multiply rank equally and go left to right. and has other memnonics like "Please Eat Mom's Delicious Apple Strudels".
• Science blog mentions the article by Tara Haelle which pretty well tells already what is going on (if I had seen this article written on March 12, 2013 before, I would not have bothered to write this down, because that article makes very clear that the initial assessment that there is no agreement on the order of multiplication or division is correct). Still, the topic had prompted me to say something new about the order of operations of the same type, like the D or E in PEMDAS which goes beyond the BEDMAS controversy. Here is an interesting quote from that article
      "Internet rumors claim the American Mathematical Society has written "multiplication indicated by juxtaposition is carried
out before division," but no original AMS source exists online anymore (if it ever did). Still, some early math textbooks
also taught students to do all multiplications and then all divisions, but most, such as this 1907 high-school algebra
textbook, this 1910 textbook, and this 1912 textbook, recommended performing all multiplications and divisions in the
order they appear first, followed by additions and subtractions. (This convention makes sense as well with the Canadian
and British versions of PEMDAS, such as BEDMAS, BIDMAS, and BODMAS, which all list division before multiplication in
the acronym.) The most sensible advice, in a 1917 edition of Mathematical Gazette, recommended using parentheses to
avoid ambiguity. (Duh!) But even noted math historian Florian Cajori wrote in A History of Mathematical Notations
in 1928-29, "If an arithmetical or algebraical term contains / and x, there is at present no agreement as to which
sign shall be used first."

The article has links to sources of textbooks. Here is entry 242 in Florian Cajoris book "A history of mathematical notation" (page 274), which is mentioned in that quote
I don't see any indications of an advise given in the cited High school textbooks like here, here, but the mentioned entry this book of Webster Wells is clear about it on page 18:

Update of May 18, 2017: As of recently, riddles like this
appeared, where one easily overlooks that the number of fries has changed. Or this:
(where one can miss that only one cherry is used) or this:
have surfaced. These type of puzzles have managed to become viral not because of the PEMDAS thing but because people don't look at the variations (3 instead of 4 bananas, 2 o clock rather than 3 o clock). Almost everybody gets it wrong at first. But there is also the PEMDAS challenge. Some get 88. But for getting 88, one would have to write parenthesis (2+3+3)*11. (thanks to Abitha Sukumaran for sharing this).
Update of August 2, 2017: Presh Talwalkar writes

"I make math videos on YouTube on the channel "MindYourDecisions." Some of the most popular videos are ambiguous expressions involving the order of operations. In doing research, I came across your website and the problem: What is 2x/3y - 1 if x = 9 and y = 2? I would answer 11, which was what the 5th grade teacher said. I was stunned that none of the 60 students your Harvard calculus class answered 11 (you explained 58 got the answer 2; and then 2 got the answer 18/5).

My answer: "yes, it is an interesting thing. None of the answers is of course "correct" as we know that both the BEDMAS and PEMDAS interpretations can be used without violating any authority. As indicated on the page, the answer 11 is what most computer languages get. You were obviously taught that. It would be interesting to know what percentage of humans say 11. My experiments say that it is very rare. Most do the multiplication before division as PEMDAS seems to be more popular and more taught in schools. BEDMAS of PE(MD)AS appears to be taught much less. The only thing we know is that the claim that one of the answer is the only right answer, is wrong."
Update of August 5, 2017: Jacob Poscholann Koefoed Christensen sends an other example and a remark on the obelus.
"The problem is a picture of a mobile phone gets 9 from the equation : 6÷2(2+1) which according to them says it would be 1. In your argue you define obelus and division slash to have to whole different meanings. Well yes they actually do have two different meanings and that's why you normally never use obelus. Only American may still use it, but this sign has been removed in use of equations of scientific papers due to its historical problematic. First of obelus in Northern Europe means subtraction. Second of all, obelus is recommended removed in the use of science due to that we already have a sign for either of these (division slash ("/") and subtraction ("-")). Even though according to your argue that obelus and division slash should imply two different meanings you often only have one option on a calculator to make a division-sign."

"Thanks for the example 6÷2(2+1). It illustrates the ambiguity too. Yes, depending on whether one is in the PEMDAS or PEDMAS team, one gets 1 or 9. Its also a beautiful example, where one can see heated debates. Like pointed out and previously by others in the literature list, there is no right answer. It depends on which rule is applied. Both 1 and 9 are correct. I always see the obelus as a synonym for / but it can be even more confusing and so, yes, should be avoided. "
Update of November 2017: In our Second midterm PDF of November 2017, we had in Problem 9 the expression x^3/3+y. There is no ambiguity here as PEMDAS very clearly makes the expression defined. Still, I should have been more clear when writing the exam as there were many students who asked during the exam whether it could be x^3/(3+y). I was surprised and had to put a clarification on the blackboard: The exam still went well. And you can see on this photo taken just before the exam that everybody was happy to go:
The lesson is very clear: as a teacher, even if you know better you have to be extra clear, even redundant. Even if there is no ambiguity, it is better to be on the safe side. By the way, the Wikipedia article mentions the example
1+2x3 = 9     Microsoft calculator in standard view
1+2x3 = 7     Microsoft calculator in programmers view

It shows that the same vendor, in a framework where no ambiguity exists (nobody has ever questioned that multiplication should go before addition), an ambiguity in the same product. An other example from that article mentions Texas Instruments calculators
1/2x = 1/(2x)    in TI-82 calculator
1/2x = (1/2)x    in TI-83 calculator

Self-proclaimed rules like this are hardly helpful.
Update of January 19, 2018: Timothy Musgrove kindly drew my attention to a silly debate on youtube in which the question of 6÷2(1+2) again comes up (see above). Also this story shows how almost theological the debate can become but already the fact that the fraction of viewers liking the video and not liking the video is about equal shows that answer to that problem must be ambiguous. Above, I have given, (following partly Tara Haelle, who had written that Slate article), historical pointers showing how ambiguous things are. Here are the camps:
1. PEMDAS (The multiplication comes before division)
2. PEDMAS (The division comes before multiplication)
3. PE(MD)AS (Division and Multiplication have the same weight, it depends what is left)
4. Ambiguous (There is no established rule)
Computers mostly follow the second or third. Most people and especially students (by experiment) tend to follow the PEMDAS rule. The literature points to Ambiguity.
 PEMDAS BEDMAS PE(MD)AS 6/2*(1+2) 1 9 9 (1+2)*6/2 9 9 9
There is a reason why the "PE(MD)AS" camp feels so much superior. We have in both cases the same answer. Also computers often follow "PE(MD)AS" and taking the "left" to "right" point of view. Even worse is probably the debate when asking what 8÷2/2 is (some high school teacher confirmed me that the divisions (obulus and backslash signs) are treated differently in some textbooks, see the "obulus" remark above by Jacob Poscholann Koefoed Christensen. Some would tell that the answer is 8 because / goes before ÷. When going from left to right, we get 2.

Update of September 4th, 2018:

I got the following nice email

 How on earth can you say it is ambiguous when it is AXIOMATIC that multiplication and division are inverse operations? How can you say it is ambiguous when ANY division can be expressed as multiplication by the reciprocal? Shame on you for perpetuating bullshit.

The only thing which is a bit troubling as the writer actually seems to be a teacher. Independent of the argument, the writer should probably change to a profession, where as little human interaction as possible is required. I wrote back

 Dear ..., you probably refer to http://www.math.harvard.edu/~knill/pedagogy/ambiguity/ It is not about whether the division is the inverse of multiplication. That is the definition. This is not where the ambiguity is. It is that the notation is ambiguous (and experience shows that that it is a source for errors and misunderstandings). For example, if we write x/3x, then many humans understand the result as x/(3x) which is 1/3. If you give it to a machine, then it gives the result x/3x =x^2/3. Now, the question is whether there is a definite rule which tells, what is right. The PEMDAS rule, clearly puts multiplication before division so that x/3x = x/(3x) = 1/3. Most humans follow the PEMDAS rule. Because they have been taught so. There is also the BEDMAS rule in which the division comes before multiplication. In that case the result would be x^2/3. Now, if you look at the literature and history, then it turns out that there is no definite answer what is right. And if this is the case, we call it ambiguous. There is a camp which advocates PE(MD)AS where MD are on equal footing and where the order matters if multiplication is used together. But this makes things only more complicated as we have now three different interpretations. So if one writes such an expression like x/3x, one has to be careful and put the brackets. Everything else can produce misunderstandings. You are not the only one who feels very strong and become emotional about it.

Update of October 2, 2018:

I was sent the link to the following Youtube Video. It is sofar one of the best contributions on youtube about it. It makes a good point that in the real world, the expressions are used in a different way: for example, in published articles mn/rs is usually in publications interpreted as (mn)/(rs) or the Feynman lectures, one sees that 1/2N1/2 is interpreted as 1/(2 N1/2). In Engineering, one can read W = PVMg/RT. An other excellent point done in that video is that one would write x/2 if 1/2x would be interpreted as (1/2) x. Nobody would write 1/2x, if they mean x/2. So, in practice, one interprets the expression as 1/(2x), which is PEMDAS, but different from BEDMAS or the interpretation that multiplication and division are put on the same footing. It also mentions that in the AMS guide, one has PEMDAS (multiplication comes before division). Also the guide from the American Physical Society follows PEMDAS. The video illustrates again that the only way avoid the ambiguity is to use brackets.

October 24, 2018: I originally had planned to post a youtube version of some slides from April 28, 2018 at the Harvard Exstension STEM Club, but there is no time to do that. Thanks to Ana Carolina Smith for the opportunity to speak. Here are the part of the slides:
PDF (76 pages)

October 26, 2018: An other nice example from somebody: Here the email:
I was told that when you multiply and divide
(since the order of operation does not matter)
you never need to use parentheses, is this right?
Because 2 * 3 / 4 * 6 on my calculator give me 9,
and I was expecting 0.25!  To me this should be the
equivalent to 2*3/(4*6) because, since we don't
need parentheses, it's the only way to type it without them.
If I want to calculate 2*3/4*6, like my calculator
does, I should type 2 * 3 * 6 / 4 is this correct?

The order of operations matter. You need to put
parenthesis. I like the example you give. It
already illustrates it well. Most humans would get
6/24=1/4 as you did. Most programming languages
(computers) give 9. The computer follows PEDMAS
(division before multiplication)

2 (3/4) 6  = 9

or do with the rule (MD) which means whatever comes first"

((2*3)/4)*6 = 9

Humans (and most recommendations, like professional
societies like AMS  follow PEMDAS, which means
you first do multiplication and then division

(2*3)/(4*6)   = 1/4

But it does not make sense to follow a recommendation
if different interpretations exist and computers do it
different. There are lots of different opinions about
it on the web. There is only one way out: just write
the parenthesis, also when using a computer.
Here is an other nice example which only uses division:

((2/2)/2)/2 = 1/4
(2/(2/2))/2 = 1
(2/2)/(2/2) = 1
2/(2/(2/2)) = 1
2/((2/2)/2) = 4

The computer follows here the rule (left to right)
and gives 1/4.  But in this example:

(3^3)^3     = 19683
(3^(3^3))   = 7625597484987

the computer goes from right to left.
Also here, brackets are required.

November 4, 2018: S. A. added an interesting angle to the story: It is the recommendation to simplify first then remove parentheses.
I read your blog on programming issues as to MD or DM.
The problem is they all conflict with the first law of Algebra.
Simplify then REMOVE Parentheses.
These conventions all violate that by saying only simplify brackets INSIDE.

So at first I like you said AMBIGUOUS to 6/2(1+2)
1 or 9

However, I took a nap, astral surfed over to old Euclid and he laughed.

Proof 1 and 9.

6/x=1 or 6/x=9
When x=2(1+2)

2(1+2)=2(3)=6

6/6=1

So not teaching students to remove parentheses in new math is conflicting with first law of algebra.
All these acronym conventions need to be corrected to reconcile with 1st law of algebra.
So do you agree the new math conventions need to agree with Euclids first rule of Algebra?
I think it does.


It is an interesting angle. But note that the recommendation to simplify"
is where the problem of the ambiguity is located:

Yes, one can simplify 6/2(1+2) by introducing x=2(1+2) = 6, then get 6/6=1
But one can also simplify by defining x=6/2, then get x(1+2) = 9.

Actually, this is also historically interesting. You mention Euclid.
Euclid did not use any algebra as we know it. Symbolic algebra came only with
Viete in the 16th century. As far as we know, one only has realized in the 20th century
that there is really an ambiguity. It is clearly stated in Cajori's book on
mathematical notation, which is the authority on the matter.

It has also become a pedagogical issue:
students today get mostly taught the PEMDAS rule which formally puts
multiplication before division and would recommend the result
6/2(1+2) =1.  If you give the expression to a computer algebra system they all
give 6/2(1+2) = 9. It was examples like that which produced all these discussions.

The first rule of algebra is still a nice rule. It is good advise. Unfortunately
it does not resolve the ambiguity. But I agree that it helps a writer to avoid
the ambiguity. But you know, the issue came up mostly in educational settings.
If a teacher asks a student what is 6/2(1+2) , the teacher does not want to
simplify that, as it would already solve the problem. If today, a teacher asks
students what is 6/2(1+2), then this is just asking for trouble. The right thing to
do is to clarify and either write either (6/2)(1+2) or 6/(2(1+2)).
It was clear already to Cajori that avoiding the parenthesis does not produce
well defined mathematical expressions.

Oliver

December 3, 2018: Atmos added an other interesting angle
A potential solution for this controversy could be that when you have
coefficients and variables written together without operators between
them, e.g. 5ab, we should be able to treat this as a nested operation.
In other words, the lack of an operator symbol implies that the
relationship between them takes precedence over any operations outside,
i.e. 5ab represents (5 * a * b).

So if you had a / bc, there is only one operator written (the division
symbol), and the "bc" part would be implied to be nested because of
the omission of the operator within. So it would still be "a over bc,"
exactly what it looks like and how many of us were taught. And then if
we need to signify that the operation between a and b actually takes
precedence over the relationship between b and c, then we would just
write a / b * c instead. No fuss, no muss.

Isn't that a much more efficient way of communicating with the
mathematical language here? And isn't that the point of a mathematical
language, to communicate concepts effectively? Otherwise this kind of
confusion will never go away, and we will have to write a lot more
parentheses in our equations (and nobody wants to do that). Some
people like the "new math" of the super strict PEMDAS interpretation
specifically because it is an easy way to trick people and make the math
more convoluted than it needs to be. Yet that seems to defeat the entire
point of why we do this stuff in the first place.

I get both ways of doing it, but the strict PEMDAS method seems
counterproductive because it causes so many problems, and it does things
like making an ostensibly simple fraction like 2x / 3y into actually
meaning 2xy / 3 instead, which seems completely insane. But if instead
we just use PEMDAS when the operators are actually written, then all of
these kinds of problems would literally vanish overnight. The "old math"
and the "new math" would finally agree, and we could accomplish it all
with one very simple rule.

What do you think about that?

I wrote back
Hi Atmos,
leaving away the multiplication signs is already routinely done.
Actually most of the time. There can be an additional problem however
when using numbers rather than variables like 3/45 is not the same than 3/4 5
But you contribute an interesting point because there is now even more
ambiguity:

3/45     =  3 over 45  = 1/15
3/(4*5)  =  3 over 20  = 3/20
(3/4) 5  =  3/4  times 5  = 15/4

The PEMDAS problem is not a problem to be solved". It is a matter of
fact that there are different interpretations and that a human for
example reads x/yz   with x=3,y=4 and z=5 as  3/20 while a machine
(practically all programming languages) give a different result.
There are authorities which have assigned rules (most pupils are taught
PEMDAS) which is one reason why many humans asked about 3/4*5 give 3/20
which most machines asked give 15/4:

I type this in Mathematica
x=3; y=4; z=5; x/y z     and get 15/4

It is a linguistic problem, not a mathematical problem. In case of a
linguistic problem, one can not solve it by imposing a new rule.
The only way to solve the problem is to avoid it. One can avoid it to
put brackets.

Oliver

Update of December 14, 2018:

In the newest Cartoon guide of the Larry Gonnik series (which are fantastic), there is also something about order of operations. But it does not go very far. "If no parentheses are present, multiply and divide before adding and subtracting." This is a very rough rule but it has the advantage that it does not get into the PEMDAS wars.
Update of January 18, 2019:

A math teacher sent me the following example. Not only is here the PEMDAS ambiguity involved. Also, the question "96 divided by 6 of 4" appears which can both mean "96/6 times 4" or then "96/(6*4)". It is a specially interesting case because of that:
 Question: I am a Maths teacher and recently came across a particular question on PEMDAS (kindly check the attachment) where the students got two different answers (6 and 66). The reason for the getting two different answers was the way the students solved the last part of the question: 96 ÷ 6 of 4 Method 1: Few students solved it as follows : 96 ÷ 24 Method 2: And the rest solved it as : 16 x 4 I need your help to ascertain which is the correct method, or are both the methods acceptable. 

 My answer: There are two ambiguities in this problem and yes, all answers given by students should be graded as correct. 1) The first expression: It appears that the students did interpret 57 ÷ 19*2 expression as 6 even so it could be 3/2 if PEMDAS is used (and official recommendations of AMS or physical society and used by most scientific papers, especially if the expressions are variables). What happens is that if the question would have been ask as 57/19*2, then many would have interpreted it as 57/38. 2) The third expression is a new thing as the "of" as a "multiplication" is unusual. Also here, there are no definite rules. Both answers 6 and 66 are correct in the total. I would even count 3/2 as correct as this is what one gets if one uses the PEMDAS rule and not the PEDMAS nor the PE(MD)AS rule. So, here are the four possible answers. On the left we have now always unambiguous expressions: 57/(19*2) -64*2/32 + 96/(6*4) = 3/2 (57/19)*2 -64*2/32 + 96/(6*4) = 6 (57/19)*2 -64*2/32 + (96/6)*4 = 66 57/(19*2) -64*2/32 + (96/6)*4 = 123/2  The example again shows that one always needs to put brackets. But it also illustrates what can happen if "colloquial language" is used to describe arithmetic operations as this can can lead to other ambiguities. "What is two third of 9" should be clear as (2/3)*9, while 2 ÷ 3 of 9 could be interpreted as 2/(3*9) too. The example also shows again that humans interpret the obulus sign ÷ often differently than the division sign /.
Update of May 2, 2019:

In the Swiss newspaper 20 Min, the problem 6/2(1+2) = ? is mentioned too. The article already has 1384 comments. Similarly as for years on social media, the fight goes on there. The most interesting thing is how certain most are that they are right, on all sides. Which points again to ambiguity.

The title of the article is "Millions fail at this math equation!" As proof", there is a youtube video which gives the answer 9. The author of that video, Presh Talwalker, gives in his blog the reference Lennes, N. J. "Discussions: Relating to the Order of Operations in Algebra." The American Mathematical Monthly 24.2 (1917): 93-95. . One should better read that article.
This article from 1917 indeed claims that most text books" use the left to right rule if division and multiplication appear mixed. But it also states the "established rule"

 "All multiplications are to be performed first and the divisions next".

So, we have it: the 12 million people who do it differently were not unable to do the problem". it remains that we deal with a situation which must be considered ambiguous. The 1917 article is a nice reference. It confirms that already. But since 1917, the PEMDAS rule has been taught to millions of people. It remains astounding only how many claim to know the right answer. Maybe that is just human nature.

Read at the end of the article of Lennes who wrote in 1917 already:

 "When a mode of expression has become wide-spread, one may not change it at will. It is the business of the lexicographer and grammarian to record, not what he may think an expression should mean but what it is actually understood to mean by those who use it. The language of algebra contains certain idioms and in formulating the grammar of the language we must note them. For example that 9a2 ÷ 3a is understood to mean 3a and not 3a3 is such an idiom. The matter is not logical but historical.

One can not say it better! So, not the 12 million people are the idiots. Those who claim so, are.

Update of August 5, 2019: Steven Strogatz gives in a New York Times article a new twist and blames a discrepancy between grade and high school: the example taken is 8 ÷ 2(2+2), where every computer gives 16, while humans usually give the answer 1. The article again makes very clear that the question is ambiguous. There is no right or wrong if there are different conflicting rules. The only ones who claim that there is one rule are the ones which are wrong!
That Vexing Math Equation? Here's an Addition The confusion (likely
intentional) boiled down to a discrepancy between the math rules used
in grade school and in high school.

8 ÷ 2(2+2) = ?

The issue was that it generated two different answers, 16 or 1,
depending on the order in which the mathematical operations were
carried out. As youngsters, math students are drilled in a particular
convention for the "order of operations," which dictates the order thus:
parentheses, exponents, multiplication and division (to be treated
on equal footing, with ties broken by working from left to right), and
addition and subtraction (likewise of equal priority, with ties similarly
broken). Strict adherence to this elementary PEMDAS convention, I argued,

they regarded as the standard order of operations, strenuously insisted
the right answer was 1. What was going on? After reading through the
many comments on the article, I realized most of these respondents were
using a different (and more sophisticated) convention than the elementary
PEMDAS convention I had described in the article.

In this more sophisticated convention, which is often used in
algebra, implicit multiplication is given higher priority than explicit
multiplication or explicit division, in which those operations are written
explicitly with symbols like x * / or ÷. Under this more sophisticated
convention, the implicit multiplication in 2(2 + 2) is given higher
priority than the explicit division in 8÷2(2 + 2). In other words,
2(2+2) should be evaluated first. Doing so yields 8÷2(2 + 2) = 8÷8 =
1. By the same rule, many commenters argued that the expression 8 ÷ 2(4)
was not synonymous with 8÷2x4, because the parentheses demanded immediate
resolution, thus giving 8÷8 = 1 again.

This convention is very reasonable, and I agree that the answer is 1
if we adhere to it. But it is not universally adopted. The calculators
built into Google and WolframAlpha use the more elementary convention;
they make no distinction between implicit and explicit multiplication
when instructed to evaluate simple arithmetic expressions.

Sign up for Science Times We'll bring you stories that capture the
wonders of the human body, nature and the cosmos.
Moreover, after Google and WolframAlpha evaluate whatever is inside
a set of parentheses, they effectively delete the parentheses and no
longer prioritize the contents. In particular, they interpret 8 ÷ 2(2 + 2)
as 8 ÷ 2x(2 + 2) = 8 ÷ 2x(4), and treat this synonymously with 8 ÷ 2x4. Then,
according to elementary PEMDAS, the division and multiplication have
equal priority, so we work from left to right and obtain 8 ÷ 2x4 = 4x4
and arrive at an answer of 16. For my article, I chose to focus on this
simpler convention.

Other commenters objected to the original question itself. Look at how
poorly posed it was, they noted. It could have been made so much clearer
if only another set of parentheses had been inserted in the right place,
by writing it as (8 ÷ 2)(2+2) or 8 ÷ (2(2+2)).

True, but this misses the point: The question was not meant to ask
anything clearly. Quite the contrary, its obscurity seems almost
intentional. It is certainly artfully perverse, as if constructed to
cause mischief.

The expression 8 ÷ 2(2+2) uses parentheses - typically a tool for reducing
confusion - in a jujitsu manner to exacerbate the murkiness. It does
this by juxtaposing the numeral 2 and the expression (2+2), signifying
implicitly that they are meant to be multiplied, but without placing an
explicit multiplication sign between them. The viewer is left wondering
whether to use the sophisticated convention for implicit multiplication
from algebra class or to fall back on the elementary PEMDAS convention
from middle school.

Picks: "So the problem, as posed, mixes elementary school notation
with high school notation in a way that doesn't make sense. People who
remember their elementary school math well say the answer is 16. People
who remember their algebra are more likely to answer 1."

Much as we might prefer a clear-cut answer to this question, there
isn't one. You say tomato, I say tomahto. Some spreadsheets and software
systems flatly refuse to answer the question - they balk at its garbled
structure. That's my instinct, too, and that of most mathematicians I've
spoken with. If you want a clearer answer, ask a clearer question.

August 5, 2019. An other treasure trove by Jenni Gorham just appeared on Youtube:
August 8, 2019. Greg McCann kindly pointed out this link to an archived copy of the AMS guidelines. Local copy. To cite from there for example:
Formulas. You can help us to reduce printing costs by avoiding
excessive or unnecessary quotation of complicated formulas.  We
linearize simple formulas, using the rule that multiplication
indicated by juxtaposition is carried out before division. Thus,

$${1\over{2\pi i}}\int_\Gamma {f(t)\over (t-z)}dt$$

we might use

$(1/2\pi i)\int_\Gamma f(t)(t-z)^{-1}dt$.


August 17, 2019 An other question:
I am curious what you think the answers is to this equation.
8 ÷ 2(4). To me, the simplest order of operation next is to multiply 2 * 4
first because I still have the parentheses to deal with.
I'm just a believer that we have to do some kind of math to get rid of the parentheses.
Some people are just dropping them without doing any math.
I mean, why have them at all if one can just drop them at any time
without doing any math to clear them out.   S.
-----------------------------------------------------------------------------------

yes, this is one of the latest pemdas riddles passed around. A similar one
has been discussed also by Strogatz in the NYT. What you mention is that the
2+2 is already evaluated but it does not change the situation to to
8 ÷ 2(2+2) which is now passed around. But it is the
same story. The reason to put a bracket around 4 is so that it is not read
as 24. But it does not clarify the ambiguity. Yes, one is tempted to do first 2*4 and
get the result 1. Most computer programs evaluate it to 16. Example:

Mathematica 12.0.0 Kernel for Linux x86 (64-bit)