[Math] When do we need parenthesis to change order of operations

arithmetic

A few questions about order of operations:

$1$) In an expression such as $1+3+3^2$, it is legal to simplify to $4+3^2$, a violation of the grade school order of operations. In this case, are we adding an implicit set of parenthesis and then simplifying? i.e. making the expression $(1+3)+3^2$? So if you simplify $1+2+(3+5)$ to $3+(3+5)$ without adding the parenthesis first, are you wrong in the most pedantic sense?

I guess the question could be phrased like this: does order of operations mean a strict order of how any equation should be multiplied, or does it refer to priority of operations? I.e. that it simply means that higher order operations must be completed before their operands are combined with lower order operators, or does it actually imply a strict $1\times2\times3$ for how to simplify?

$2$) is implicit multiplication the same thing as explicit? I.e. is $A*(b)$ the same as $A(b)$?

$3$) Is $A*(b)$ two expressions while $A(b)$ is one?

Best Answer

In strictest sense, an expression such as $1+2+3$ isn't even defined, only $(1+2)+3$ and $1+(2+3)$ are. It is the law of associativity that allows us to interchange the latter two expressions and motivates the usual convention of dropping parentheses altogether in such sums. In view of this, the "right" to evaluate a sum in arbitrary order is already implicit in the legitimiacy of leaving out parentheses. Similar for products.

The fact that we write $1+2\cdot 3$ without parentheses, although $(1+2)\cdot 3$ and $1+(2\cdot 3)$ differ, is not based on an arithmetic law, but rather on the convention that multiplication and division precede addition and subtraction. That is, $1+2\cdot 3$ is really a shorthand for $1+(2\cdot 3)$ whereas there is no shorthand for $(1+2)\cdot 3$.

Finally, a similar convention, namely that the non-associative operation of subtraction (as well as division) are to be done left to right. That is, of the two expressions $(1-2)-3$ and $1-(2-3)$, only the first has a shorthand notation of $1-2-3$.

Note however that exponentiation is not associative, e.g. $(2^3)^4\ne 2^{(3^4)}$. Since the former can be written simply as $2^{3\cdot4}$, we have the convention that the expression $2^{3^4}$ is a shorthand for $2^{(3^4)}$.

I think the best way to view this is in for of a tree where each node is either a leaf labelled with a number or (if the node has a left and a right subtree) an operator $+,-,\cdot,/$ or epxonetiation. You may additionally introduce negative signs and functions as unary operators (nodes with one subtree). For associative operations such as addition and multiplication, you may loosen these rules and allow more than two subtrees. This tree determines the order of operation (note that there are no parentheses needed to build the tree): In order to perform an addition, subtraction etc. you need to first compute the two subtrees and then combine these two results accordingly. Note that the overall sequence of operation is only very loosely defined/restricted by this: You can first evaluate the left tree, then the right tree, or vice versa, or intertwined. Only the "top" operation must be last. This is all there is behind the rules of precedence and parentheses: They clarify which of several possible trees is intended.

Related Question