# When was “operator precedence” invented? Did any culture use a different rule?

Every kid knows $1+2\times3$ is equal to $1+(2\times3)$, not $(1+2)\times3$. But the more I think about it, the more counterintuitive it seems. You have to tell kids to memorize the rule, instead of just following the literal order.

So I think the operator precedence might be "invented" somewhere, by someone or some cultures. Is it a part of Arabic numerals? Did ancient Greek and Egyptians have it? And is/was there a culture where $1+2\times3$ equals $9$?

The idea of operator precedence - also known as order of operations - is a relatively recent concept, in part because the common mathematical operators for the four basic arithmetical operations - $+,-,\times,\div$ - weren't all in use until a few hundred years ago. For example, as Florian Cajori writes in A History of Mathematics, one of the symbols for multiplication ($\times$) was created by William Oughtred in the 17th century. This means that older cultures didn't have the same system we use today.

That said, according to this source,

The convention that multiplication precedes addition and subtraction was in use in the earliest books employing symbolic algebra in the 16th century. The convention that exponentiation precedes multiplication was used in the earliest books in which exponents appeared.

The debate about the order of multiplication/division came later, although given that the two operations are inverses of each other, it is not as important.

• Is a little hard to believe that basic operations are introduced only a few hundred years ago. Before that how people wrote down an equation like 1+2x3=7? (sorry for off-topic) – Lai Yu-Hsuan Oct 19 '15 at 6:14
• @LaiYu-Hsuan - With words. Lots and lots of words. – David Hammen Oct 19 '15 at 12:37
• @LaiYu-Hsuan As David said, word problems were common. Some other alternate notations were used, but there weren't operators as we know them. – HDE 226868 Oct 19 '15 at 15:31
• By @DavidHammen 's link, there actually was operator precedence in that notation! Though × was written as in, it was prior to + and - by the time, just like x nowadays. So the concept of operator precedence actually appeared before × and ÷, didn't it? – Lai Yu-Hsuan Oct 19 '15 at 20:44
• @LaiYu-Hsuan - please, note that David's Wiki link is to a modern "translation" of Viete's book: the original text (page 7) reads : "Proponatur $B$ in $A$ quadratur, plus $D$ plano in $A$, aequari $Z$ solido" i.e. $BA^2 + D^p = Z^s$. – Mauro ALLEGRANZA Oct 20 '15 at 20:09

Find me two numbers such that when they are added together, they make as much as the cube of the lesser added to the product of its triple with the square of the greater; and the cube of the greater added to its triple times the square of the lesser makes $64$ more than the sum of these two numbers.
[i.e. Find $a, b$ such that
$a + b = b^3 + 3ba^2$ and
$a^3 + 3ab^2 = 64 + a + b$ (from : John Fauvel & Jeremy Gray (editors), The History of Mathematics : A Reader (1987), page 257).]