Something that's been bugging me for a fairly decent while is the order of operations - not so much using it, however, as to understanding where it comes from.
Typically we're introduced to it in the "PEMDAS" order in school (or "BEDMAS" or whatever acronym you were given):
- First: Parenthetical/bracketed expressions
- Second: Exponentiation (and its inverse, roots)
- Third: Multiplication (and its inverse, division)
- Fourth: Addition (and its inverse, subtraction)
...all typically done in a left-to-right order. But this seems arbitrary in a sense - why this particular ordering of steps, as opposed to any other particular ordering? Why should I calculate $4+5\times 6$ by finding $5\times 6$ first, as opposed to $4+5$ first?
Obviously, we adopted a standard in order to prevent ambiguity - but then, why this standard?
I could not find anything on the matter that felt really satisfying. For example, a lot of the previous discussion on MSE ultimately boiled down a few points:
- It was agreed upon by mathematicians. (Okay, but why did they agree on this?)
- It makes for more efficient notation once everyone is on the same page. (Yes, but would that not also hold for any ordering?)
- Furthering the previous, it leads to more efficient notation for polynomials. (But as noted in the comments, Polish/reverse Polish notation also can resolve a lot of that.)
- Our end goal is an order of operations that drops a lot of the parentheses, for readability's sake. (Understandable but then why is this convention the most efficient in that regard?)
Consider characterizing each of our operations by what they basically are: exponentiation is repeated multiplication, which is repeated addition, which is basically repeated application of the successor function. So we can sort of call our operations this:
- Operation $0$ - Successor function (repeated addition of $1$ in effect)
- Operation $1$ - Addition (repeated succession - repetitions of operation $0$)
- Operation $2$ - Multiplication (repeated addition - repetitions of operation $1$)
- Operation $3$ - Exponentiation (repeated multiplication - repetitions of operation $2$)
The pattern becomes evident if we adopt this scheme:
- Operation $n$ is just repeated applications of operation $n-1$
- Equivalently, repeated application of operation $n$ yields operation $n+1$
So we ask - what is operation $4$? Of course, in this scheme, it's repeated exponentiation - that is to say, tetration! Rather fitting since "tetra-" is the prefix for $4$, but I digress.
Of course, then, this sequence of hyperoperations also uses pentation, hexation, and so on, as repeated applications of the previous.
All of this, then, begs a couple of questions:
Is this "sequence of operations" the reason we define the order of operations as we do - that is, we do exponentiation before multiplication, because the former is a repetition of the latter? Or is it just a "happy consequence" of whatever the reason is?
Where do these hyperoperations, e.g. tetration and pentation, fit into the scheme? If the previous is true, then this suggests that we would handle all bracketed expressions, then the highest $n$-ations, then the $(n-1)$-ations, and so on - that is, we would handle hexation, then pentation, then tetration, then exponentiation, and so on.