Order of Operations, and Where It Is Not Agreed

Type an expression. The tool reduces it one operation at a time, naming the rule behind each step, and evaluates the same line under four conventions that do not all agree.

Loading interactive simulation...

The rule only does work where a × meets a + 🖖

Press Why there is a rule. 2 + 3 × 4 is 14 if you know the rule and 20 if you read left to right, so the rule is clearly doing something. Now type 8-3-2, then 12/2*3. Every convention on this page agrees on both, because both stay inside one tier and every convention reads a tier from left to right. Here is the size of it: build every expression with three operators and operands from 1 to 9 out of + and − alone, and a four-function calculator gets all 52,488 of them right. Out of × and ÷ alone, all 52,488 again. Let the two tiers mix and 186,624 of 419,904 come out different. The rule earns its keep where the × ÷ tier meets the + − tier, and does nothing at all inside either one.

Three places where nobody ever agreed 🖖

2^3^2 is 512 grouped to the right and 64 grouped to the left. −3² is −9 if the minus sign waits for the power and 9 if it does not; Microsoft’s own precedence table for Excel lists negation second and exponentiation fourth, so a spreadsheet cell says 9 where a calculator says −9. And 6 ÷ 2(1 + 2) is 9 under the rule as taught at school, or 1 if a number pressed against a bracket binds tighter than the division, which is how a/bc is read in many textbooks and how MathWorld warns you it will not be read by a computer algebra system. Press the four buttons and watch the answer move. No arithmetic changed while you did that; only the reading did.

Brackets are the only part that is not a convention 🖖

Under the table the tool prints the same expression with every operation bracketed. Feed that line back into the box and the four readings collapse onto one number. It is not a property of these examples: take every three-operator expression over operands 1 to 6, bracket every operation, and 0 of 82,944 still split. That is the argument for the two characters. Published mathematics writes a/(bc), or stacks the fraction so the grouping is in the geometry rather than in a rule the reader has to have been taught.

Problem solved in full

  1. 6 ÷ 2(1 + 2): is it 9 or 1? The argument has run for years and both sides can do arithmetic. Work out what is actually in dispute.

    Open this problem in the tool

    1. The bracket goes first, and nothing here is contested. Both readings now face the same line, with a 3 where the bracket was.

    2. The school rule: × and ÷ share one tier and a tier is read left to right. The division comes first because it is written first.

    3. The other reading: a number pressed against a bracket is one quantity, so 2(3) is a single 6 before the division looks at anything.

    4. Both are internally consistent and neither can be derived from arithmetic. Switch between Standard and Implicit first and the tree on the page re-hangs: multiplication at the top under Standard, division at the top under Implicit first.

    5. What settles it is not a better rule but a better line. Either bracketing is unambiguous under all four conventions, and the tool prints the fully bracketed form under the table.

    6. Which is why the expression is rare in print. A journal writes the fraction stacked, and a stacked fraction carries its grouping in the geometry, where no convention can get at it.

    Answer

    There is no fact of the matter, and 9 and 1 are both correct readings of a line that was written too loosely to have one value. The disagreement is entirely about how a division sign and a juxtaposition are read on one line of type, and each of the four readings on this page is consistent with itself. Write (6 ÷ 2)(1 + 2) when you mean 9 and 6 ÷ (2(1 + 2)) when you mean 1, and the question stops existing.

References (2)