# What is the reason for the "left to right" rule?

I specifically ask about the nature of the "left to right" rule, and whether this is just a convention (because one has to be made), or that there are deep algebraic reason for it.

I am not looking for either the solution of the problems below, or remarks that multiplication trumps addition, or that addition and multiplication are associative, or any of the things which are one google search away.

The motivation for this question is that the Internet is currently discussing what the result of

$$8 / 2(2+2)$$

is.

Putting aside the ambiguity, we end up with

$$8 \div 2 \times 4$$.

The order of operations description on Wikipedia does not go into details on why the order is such and not another, but I believe there are algebraic reasons. By that I mean more they are more than a convention, but rather something which is derived from their algebraic features (such as saying that one can perform the calculation $$(2+3)+4$$ as $$2+(3+4)$$ because of the associative property of addition).

With this in mind, why are the calculations for $$8 \div 2 \times 4$$ done from left to right?. Is it just a convention because a decision had to be made, or are there deeper reasons for that?

• The internet could invent something new for a change. The old meme from a few years back was bad enough. This is just lame. Mind you, this is also a duplicate of the other. Gerry Myerson's answer there is CANON. Aug 4, 2019 at 9:15
• Following Jyrki's link to the "canon" answer, one of the comments there point to a great document which clarifies a lot: math.berkeley.edu/~wu/order5.pdf
– WoJ
Aug 4, 2019 at 9:51
• As you well know, we can get away with writing $2+3+4$ for algebraic reasons, namely, because $(2+3)+4=2+(3+4)$. Similarly, there is an algebraic reason why we can't get away with writing $8\div2\times4$, namely, because $(8\div2)\times4\neq8\div(2\times4)$. That algebraic reason forces us to make a decision as to what we mean by $8\div2\times4$, but it doesn't tell us which decision to make. That's a convention. [And, of course, the best thing is not to rely on the convention, but to put in the requisite parentheses so there's no possibility of ambiguity.] Aug 4, 2019 at 9:52
• Please do not include meta-commentary in the post. Also the part that answers would be better given as a CW answer, but that's less problematic.
– quid
Aug 4, 2019 at 18:13
• You might find it enlightening to peruse literature on parsers, e.g. this classic paper by Vaughan Pratt on Top Down Operator Precendence parsing (a.k.a. Pratt parser). This type of parser is used in some computer algebra systems, e.g. Macsyma. Glad to see that you found my link to Wu's paper helpful. Aug 5, 2019 at 19:39

Bill Dubuque's comment which I quote here in full is the answer to that question

Recommended reading on this topic: "Order of operations" and other oddities in school mathematics by Hung-Hsi Wu, a Berkeley mathematician who has given much thought to mathematics education.

This paper is excellent. It fully answers my question several layers deep and clarifies the muddy ideas I had about the subject.

• I generally agree with Wu here, but he objects to the teaching of domain and range as they are not used in higher mathematics. They are, however, quite relevant to physical systems! Sep 9, 2019 at 18:38
• @OpalE I missed where he objected to talking about domains and ranges. Are you talking about his critique of the 'variable' formulation?
– Ukko
Sep 9, 2019 at 20:36

There might be other conventions; in the natural sciences and technology, however, the well-established conventions do not include such a “left to right rule”.

According to the actual conventions, such ambiguous expressions shall be avoided. In particular, a division sign shall not be followed by a multiplication sign or another division sign on the same line unless parentheses are inserted to avoid any ambiguity.

This rule is used in The International System of Units (SI):

When several unit symbols are combined, care should be taken to avoid ambiguities, for example by using brackets or negative exponents. A solidus must not be used more than once in a given expression without brackets to remove ambiguities.

For example, write “$$\mathrm{m\ kg/(s^3\ A)}$$” or “$$\mathrm{m\ kg\ s^{-3}\ A^{-1}}$$” but not “$$\mathrm{m\ kg/s^3/A}$$” nor “$$\mathrm{m\ kg/s^3\ A}$$”.

The same rule is used in the international Standard ISO 80000 Quantities and units, explicitly in Part 1 General but also in Part 2 Mathematical signs and symbols to be used in the natural sciences and technology and all other parts:

a solidus (/) shall not be followed by a multiplication sign or a division sign on the same line unless parentheses are inserted to avoid any ambiguity.

For example, write $$\frac{a/b}c=\frac a{bc}=(a/b)/c=a/(bc),\ \text{not}\ a/b/c$$

This rule is also used in the German standard DIN 1338 Writing and typesetting of formulae:

Therefore, it is not permissible to write your example as “$$8/2\times4$$” since it could be read as $$\frac8{2\times4}$$ or $$\frac82\times4$$.

A rule is needed but it could be different. An analogy is that a rule about which side of the road to drive on is required but some countries pick the right and some the left.

For an example of how it could be different look at Polish notation. An attractive feature of this notation is that parentheses are not required.

There is a variant Reverse Polish notation which was once popular on calculators.

• RPN is still popular among eccentric computer scientists. For programming a computer it is better and easier than almost any alternative. Which may explain why old calculators used it. Aug 4, 2019 at 7:34
• The Postscript language, which is still involved in the production and printing of many documents, uses RPN.
– Mars
Aug 7, 2019 at 17:38

In computer languages, any line of code you write must be interpreted in a unique way. Towards that end, every programming language defines an explicit order of operations. Not surprisingly, each language has their own definition.

Order of operations is a convention, not a logical imperative. Of course, being Humans, we have different versions of the order of operations. There is one definition that is the most popular, but there are others.

In practice, you should write expressions in a way that avoids confusion. In reality, mathematicians will often sacrifice clarity for the sake of brevity.

It is purely a convention. In e.g. the APL programming language there are lots of operations (some rather strange), and moreover ways to manufacture your own. There the rule is simple: Operations are done in strict left-to-right order, unless parentheses say otherwise. E.g. $$a + b * c / d$$ means $$((a + b) * c) / d$$. No ambiguity, no random order of operations to remember (or fix, in Prolog you can define your own operations, and give them precedence and associativity at will). Many programming languages add operations to the "standard arithmetic" ones, and meaning of mixed expressions has to be fixed somehow. The result sometimes leads to surprising consecuences...