# Real-life exceptions to PEMDAS?

What are some real-life exceptions to the PEMDAS rule? I am looking for examples from "real" mathematical language --- conventions that are held in modern mathematics practice, such as those appearing in papers, books, and class notes, that are not covered (or contradicted) by PEMDAS. I am not interested in contrived examples, such as those constructed to confuse people on Facebook.

The PEMDAS convention says that order of operations are evaluated as:

1. Parentheses

2. Exponents

3. Multiplication and Division, from left to right

4. Addition and Subtraction, from left to right

So far I know of one exception: sometimes the placement of text indicates "implicit" parentheses: text that is a superscript, subscript, or above/below a fraction.

• $$2^{3 + 5}$$

Here, $$3 + 5$$ is evaluated before the exponentiation

• $$\frac{3+5}{2}$$

Here, $$3 + 5$$ is evaluated before the division

Are there other exceptions?

• It is pretty common to see things like $1/2m$ where the audience is expected to understand $\frac{1}{2m}$. Try a physics book from the typewriter age. – Adam May 16 '19 at 14:44
• Is the main problem that I asserted some things were "exceptions" that people don't agree are exceptions? I can clarify what I mean by exceptions. – 6005 May 16 '19 at 16:21
• @6005 There is nothing "toxic" about this question and its responses. "I don't agree" $\neq$ "those disagreeing with me make this environment toxic". – Namaste May 16 '19 at 16:45
• Typically, when I teach order of operations, I use the phrase "GEMDAS," where the "G" stands for "grouping symbols" or "groups". In both of the cited examples, $3+5$ are groups (in the exponential, they are grouped by size, in the fraction they are grouped by geography). If you insist on "PEMDAS" and further insist that "P" stands for "parenthses" and nothing else, then you get exceptions, I suppose. But I think that rather emphasizes the letter of the law over the spirit. – Xander Henderson May 17 '19 at 12:35
• PEMDAS, SHMEMDAS, all these abbreviations are evil. – Rusty Core May 23 '19 at 20:25

The examples you give aren't exceptions. The parentheses aren't needed because there is no other way to interpret the expressions.

In applications in engineering and the physical sciences, variables have units associated with them, and the units often disambiguate the expression without the need for parentheses. For example, if $$\omega$$ has units of radians per second, and $$t$$ has units of seconds, then $$\sin\omega t$$ has to be interpreted as $$\sin(\omega t)$$, not as $$(\sin\omega) t$$, because the sine function requires a unitless input. Omitting the parentheses is preferable in examples like these because it simplifies the appearance of expressions and makes them easier to parse.

Similarly, if a force $$F$$ acts on an object of mass $$m$$ for a time $$t$$, then, starting from rest, the object is displaced by $$Ft^2/2m$$. This can only be interpreted as $$(Ft^2)/(2m)$$, because otherwise the units wouldn't come out to be units of distance. Examples like this aren't just typewriter usages. Built-up fractions that occur inline in a paragraph of text are awkward typographically: $$\frac{Ft^2}{2m}$$. They either have to be written very small, which makes them hard to read, or they force the spacing of the lines to be uneven, which looks ugly.

These are examples involving physics and units, but more generally, when people read mathematics, they apply their understanding of the content, which could be economics or number theory. People are not computers. Mathematical notation is a human language written for humans to read. Human languages are ambiguous, and that's a good thing. When we don't require all ambiguities to be explicitly resolved, it helps with concision and expressiveness.

Besides the meaning, another factor that resolves ambiguities and allows concise and readable notation is that we have certain conventions that we follow, such as the convention that tells us to write $$2x$$ rather than $$x2$$. If someone means $$(\sin x)(y)$$, then they'll write it as $$y\sin x$$, not $$\sin xy$$. There is also a convention that if we have a long chain of multiplications and divisions, such as $$abcdefgh/ijklm$$, we put all the multiplicative factors to the left of the slash, and then it's understood that we mean $$abcdefgh/(ijklm)$$. We wouldn't write this as $$a/ibc/j/kdef/lgh/m$$, which would be extremely difficult to read. We wouldn't interpret $$abcdefgh/ijklm$$ as $$(abcdefgh/i)jklm$$, because if that had been the intended meaning, it would have been written like $$abcdefghjklm/i$$.

• The "parentheses" rule that I was taught does not mention implicit groupings of the things in the expression based on placement. What do you mean "there is no other way"? That's clearly not true. I could interpret $2^{3+4}$ as $(2^3)^{+4}$. The point is that there are implicit parentheses. To be accurate, the rule should say that P means "parentheses and implicit groupings" – 6005 May 16 '19 at 16:30
• I like the physics unit examples. – 6005 May 16 '19 at 16:32
• 6005 whenever you see $\frac{\text{numerator-stuff}}{\text{denominator-stuff}}$, we are expected to compute or simplify "numerator-stuff", and do the same for "denominator-stuff". So $\frac{a+b}{c+d} = (a+b)/(c+d)$. Don't mistake the fraction for meaning $a + b/c+ d = a +\frac bc + d$. Think: All of the numerator, divided by all of the denominator. – Namaste May 16 '19 at 16:42
• Just as evaluating $2^{\text{exponent}}$ means "raise $2$ to the power of all of the exponent," so that $2^{a+b} = 2^{\text{sum of a + b}}$, which is exactly the same as $2^{(a+b)}$. – Namaste May 16 '19 at 16:50
• @RustyCore Yes. I find it much easier to parse the expression with parentheses. I also write it with \sin and \cos. :P – Xander Henderson May 17 '19 at 17:02

That's a good question. In addition to PEMDAS there's grouped symbols; they occur under a radical ($$\sqrt{~}$$, $$\sqrt[n]{~}$$), in the numerator and denominator of a fraction and in exponents. These grouped symbols are treated as if they are between parenthesis. That means that the expressions $$a^{\text{expression}}$$, $$\sqrt[n]{\text{expression}}$$ and $$\dfrac{\text{expression}_1}{\text{expression}_2}$$ mean $$a^{(\text{expression})}$$, $$\sqrt[n]{(\text{expression})}$$ and $$\dfrac{(\text{expression}_1)}{(\text{expression}_2)}$$.

The horizontal fractional line and the vinculum of the radical act as symbols of grouping. That's why we write $$\sqrt{\text{expression}}$$ instead of $$\sqrt{~}(\text{expression})$$ and $$\dfrac{\text{expression}_1}{\text{expression}_2}$$ instead of $$(\text{expression}_1)/(\text{expression}_2)$$. The exponent, written in superscript, is also a grouped symbol, so we write $$a^{\text{expression}}$$ instead of $$a\wedge(\text{expression})$$.

Other functions use parentheses around the input to avoid ambiguity. The parentheses are sometimes omitted if the input is a monomial. That doesn't have anything to do with units. Thus $$\sin 2x$$ means $$\sin (2x)$$ but $$\sin a+b$$ means $$\sin (a)+b$$. Personally I prefer to write the parenthesis even around a monomial like $$\ln (5x)$$.

What does $$a/bc$$ means? Is it $$\dfrac{a}{bc}$$ or $$\dfrac{a}{b}c$$ ? We could argue which convention we like but the matter of fact is that different people have different convention and different softwares have different conventions. For example $$18/2\times 3$$ gives $$27$$ on wolframalpha but $$a/bc$$ gives $$3$$ when $$a=18$$, $$b=2$$ and $$c=3$$. The same software has two conventions for the same expression! That's why I always prefer to write $$\dfrac{a}{b}$$, $$\sqrt{a}$$ and $$a^b$$ instead of $$a/b$$, $$\sqrt{}a$$ and $$a\wedge b$$. They don't cause any ambiguity. The same issue is present with $$\sin ab$$ which WA interprets as $$b\sin a$$ or $$\sin (ab)$$.

• The wolfram alpha examples are interesting, but the difference in parsing seems to be due to spacing, not due to plugging in values for a, b, and c. Note that a/bc groups $b$ and $c$ together, but a/b*c and a / b c do not. Similarly for the other example, sin ab is interpreted as $\sin(ab)$ but sin a b is interpreted as $(\sin a) \cdot b$. – 6005 May 18 '19 at 13:45
• @6005 Well $bc=b*c$. It should be the same. The different results WA gives, whether because of different conventions or different spacing, are a reason to not use these operators without parenthesis (at least for me). – llllllllllllllllllllllllllllll May 19 '19 at 12:39

Briefly: The thing that you seem to be orbiting around is that some mathematical symbols, in addition to having some primary operation, also have the secondary function of serving as "grouping" symbols. These symbols serve to group certain operations together in the same way that parentheses do, without extra notation. Another way of putting it: parentheses are just one special type of grouping symbol. They do not count as exceptions to the standard precedence syntax. Examples include:

• Fraction bars
Numerical negation (e.g. the '$$-$$' sign in in the expression $$-x^2$$) usually has an order of precedence that is less than that of exponentiation and greater than that of multiplication, division, addition and subtraction in order from right to left. So we have $$-x^2=-(x^2)$$. And $$--x = -(-x))$$. And $$x+-y= x+(-y)$$.
When exponentiation is printed using different levels of typeface (e.g. $$x^{y^z}$$) then they are done in order from right to left. So we have $$x^{y^z}=x^{(y^z)}$$ If, on the other hand, it is printed using the '^' symbol (or '$$**$$') as in many programming languages (e.g. $$x$$^$$y$$^$$z$$ or x$$**$$y$$**$$z), they are usually done in order from left to right. So we have $$x$$^$$y$$^$$z = ((x$$^$$y)$$^$$z)$$