Order of arithmetic operations; in particular, the 48/2(9+3) question.

A problem that hit the Internet in early 2011 is, "What is the value of 48/2(9+3) ?"

Depending on whether one interprets the expression as (48/2)(9+3) or as 48/(2(9+3)) one gets 288 or 2. There is no standard convention as to which of these two ways the expression should be interpreted, so, in fact, 48/2(9+3) is ambiguous. To render it unambiguous, one should write it either as (48/2)(9+3) or 48/(2(9+3)). This applies, in general, to any expression of the form a/bc : one needs to insert parentheses to show whether one means (a/b)c or a/(bc).

In contrast, under a standard convention, expressions such as ab+c are unambiguous: that expression means only (ab)+c; and similarly, a+bc means only a+(bc). The convention is that when parentheses are not used to show the contrary, multiplication precedes addition (and subtraction); i.e., in ab+c, one first multiplies out ab, then adds c to the result, while in a+bc, one first multiplies out bc, then adds the result to a. For expressions such as a−b+c, or a+b−c, or a−b−c, there is also a fixed convention, but rather than saying that one of addition and subtraction is always done before the other, it says that when one has a sequence of these two operations, one works from left to right: One starts with a, then adds or subtracts b, and finally adds or subtracts c.

Why is there no fixed convention for interpreting expressions such as a/bc ? I think that one reason is that historically, fractions were written with a horizontal line between the numerator and denominator. When one writes the above expression that way, one either puts bc under the horizontal line, making that whole product the denominator, or one just makes b the denominator and puts c after the fraction. Either way, the meaning is clear from the way the expression is written. The use of the slant in writing fractions is convenient in not creating extra-high lines of text; but for that convenience, we pay the price of losing the distinction that came from how the terms were arranged horizontally and vertically.

Probably another reason why there is not a fixed convention for order of multiplication and division, as there is for addition and subtraction, is that while people frequently do calculations that involve adding and subtracting lengthy strings of numbers, the numbers of multiplications and divisions that come into everyday calculations tends to be smaller; so there is less need for a convention, and none has evolved.

Finally, the convention in algebra of denoting multiplication by juxtaposition (putting symbols side by side), without any multiplication symbol between them, has the effect that one sees something like ab as a single unit, so that it is natural to interpret ab+c or a+bc as a sum in which one of the summands is the product ab or bc. Without that typographic convention, the order-of-operations convention might never have evolved. When one has numbers rather than letters, one can't use juxtaposition, since it would give the appearance of a single decimal number, so one must insert a symbol such as ×, and there is less natural reason for interpreting 2 × 3 + 4 as (2 × 3) + 4 rather than 2 × (3 + 4), but I suppose that we do so by extension of the convention that arose in the algebraic context. Likewise, because addition and subtraction constitute one "family" of operations, and multiplication and division another, and perhaps also because the slant "/" doesn't seem to separate two expressions as much as a + or − does, we are ready to read a/b+c etc. as involving division before addition. But when it comes to a/bc, where the operations belong to the same family, the left-to-right order suggests doing the division first, while the "unseparated letters" notation suggests doing the multiplication first; so neither choice is obvious.

It is interesting that in the 48/2(9+3) problem, the last element was written 9+3 rather than 12. If the latter had been used, it would have been necessary to insert a multiplication sign, 48/2×12, and I would guess that a large majority of people would have then made the interpretation (48/2)×12. Perhaps we will never know where this puzzle originated; perhaps it was cunningly designed so that one interpretation would seem as likely as the other; or perhaps it came up as a real expression that someone happened to write down, not thinking of it as ambiguous, but that other people did have trouble with.

From correspondence with people on the the 48/2(9+3) problem, I have learned that in many schools today, students are taught a mnemonic "PEMDAS" for order of operations: Parentheses, Exponents, Multiplication, Division, Addition, Subtraction. If this is taken to mean, say, that addition should be done before subtraction, it will lead to the wrong answer for a−b+c. Presumably, teachers explain that it means "Parentheses — then Exponents — then Multiplication and Division — then Addition and Subtraction", with the proviso that in the "Addition and Subtraction" step, and likewise in the "Multiplication and Division" step, one calculates from left to right. This fits the standard convention for addition and subtraction, and would provide an unambiguous interpretation for a/bc, namely, (a/b)c. But so far as I know, it is a creation of some educator, who has taken conventions in real use, and extended them to cover cases where there is no accepted convention. So it misleads students; and moreover, if students are taught PEMDAS by rote without the proviso mentioned above, they will not even get the standard interpretation of a−b+c.

Should there be a standard convention for the relative order of multiplication and division in expressions where division is expressed using a slant? My feeling is that rather than burdening our memories with a mass of conventions, and setting things up for misinterpretations by people who have not learned them all, we should learn how to be unambiguous, i.e., we should use parentheses except where firmly established conventions exist. If expressions involving long sequences of multiplications and divisions should in the future become common, then there may be a movement to introduce a standard convention on this point. (A first stage would involve individual authors writing that "in this work", expressions of a certain form will have a certain meaning.) But students should not be told that there is a convention when there isn't.

Incidentally, it is worth noting that in certain cases, no convention is needed. The meaning of a+b+c is unambiguous even without the "left-to-right" convention, by the associativity of addition, and similarly abc by associativity of multiplication. By further properties of the operations, the values of a+b−c and ab/c come out the same whichever order one uses. In contrast, a−b+c and a−b−c require the "left-to-right" rule, while in the absence of a corresponding rule for multiplication and division, a/bc (as discussed above), and likewise a/b/c, are ambiguous.