Ambiguous Absolute Value Expressions

by Justin Skycak on

Is there a standard "order of operations" for parallel vs nested absolute value expressions, in the absence of clarifying notation?

Cross-posted from here.

Consider the expression

$$\begin{align*} |x + 2|x + 3|x + 4|. \end{align*}$$

One way to interpret this is that there are two products being added together:

$$\begin{align*} |x+2|x \hspace{1cm} + \hspace{1cm} 3|x+4| \end{align*}$$

But you could also interpret it as the absolute value of an expression that itself contains an absolute value:

$$\begin{align*} |x \hspace{1cm} +2|x+3|x \hspace{1cm} +4| \end{align*}$$

These two interpretations are not equivalent. For instance, substituting $x=0{:}$

$$\begin{align*} |0+2|0 \hspace{1cm} &+ \hspace{1cm} 3|0+4| \hspace{1cm} = 12 \\[7pt] |0 \hspace{1cm} +2|0&+3|0 \hspace{1cm} +4| \hspace{1cm} = 4 \\[7pt] |0 + 2|0 &+ 3|0 + 4| \hspace{2cm} = \,\, ??? \end{align*}$$

Granted, this is a contrived example and I’ve never actually seen an ambiguous case come up in real life (or in any math textbook). I only stumbled upon this while developing algorithms to handle edge cases in a free response grader a couple years ago. (And even then, behavior on this edge case doesn’t make a difference in practice since none of the correct answers that would be graded against involve ambiguous notation.)

I also realize that the expression could be made un-ambiguous by explicitly writing multiplication symbols, or by tweaking the absolute value notation to distinguish between left bars and right bars (e.g. via sizing/spacing/padding, or by writing $\textrm{abs}(\cdot)$ instead of $\vert \cdot \vert$). And I realize that there are obvious ways to solve this issue in the context of software (e.g. designing a user interface that avoids ambiguous notation, or using heuristics like choosing the interpretation with the lowest nesting depth).

But I’m still curious to know: given an ambiguous absolute value expression, is there a standard convention for interpreting it? In other words, loosely speaking, is there a standard “order of operations” for parallel vs nested absolute value expressions, in the absence of clarifying notation? (The answer may be that there is no agreed-upon rule.)

So far, the most convincing argument I’ve seen was Dave L Renfro’s comment on this StackExchange answer:

  • "If there is [a standard convention], then it almost certainly would only be applied in a computer coding (or calculator) setting, and it would not generally be known in the mathematical community"

In other words, this comment suggests that there is no agreed-upon rule: mathematicians use symbol sizing (or other notational means) to avoid ambiguity and therefore have no need for a rule to interpret ambiguous cases (since ambiguous cases shouldn’t exist in a mathematical text).