One Order for Every Reader
The order of operations is a shared convention that makes one written expression yield exactly one value for every reader. · 10 min
Read this expression: 3 + 4 × 2. Working strictly left to right gives 14. Multiplying first gives 11. An expression that could honestly mean two different numbers is useless — so mathematics settled the question by convention, once, for everyone. This folio is about that convention: what the agreed order is, why it exists, and the one place it bites hardest — substituting negative numbers.
Guess before you learn
Commit to a value before reading on: 3 + 4 × 2 = ?
Multiplication goes first: 4 × 2 = 8, then 3 + 8 = 11. If you read left to right and got 14, your pencil mark is in good company — left to right is how we read everything else. The next section shows why the convention overrules it here.
9–12
3–5
Parentheses are a 'do this first' signal. Without them, multiplication happens before addition. So 2 + 3 × 4 means 2 plus twelve: 14. But (2 + 3) × 4 means five taken four times: 20. Same three numbers, different instructions.
6–8
The full order: grouping symbols first, then exponents, then multiplication and division together, left to right, then addition and subtraction together, left to right. Note what the mnemonic PEMDAS hides: multiplication does not outrank division, and addition does not outrank subtraction — each pair shares one rank and is read like a sentence.
So 8 − 2 + 3 is 6 + 3 = 9, not 8 − 5 = 3. And 12 ÷ 3 × 2 is 4 × 2 = 8, not 12 ÷ 6 = 2. When the rank ties, the leftmost operation moves first.
9–12
The order is a convention, not a law of nature — its job is to make one string of symbols name exactly one number for every reader. Some grouping is invisible: a fraction bar groups its whole numerator and denominator, so (x + 1)/2 halves the entire sum, and a radical groups everything under its roof.
The sharpest edge is substitution. At x = −3, the expression x² means (−3)² = 9. But typed bare, −3² means −(3²) = −9, because the exponent binds tighter than the minus sign. The habit that prevents every such accident: wrap the substituted value in parentheses, always.
K–2
Two bags hold 3 blocks each, and 1 extra block sits alone. Count the bags first: 3 and 3 makes 6. Then the extra: 7 blocks in all.
Everyone counts the bags first, then the extras. That way every counter gets 7 — never a different answer.
Undergrad
Precedence and associativity are parsing rules: they map a linear string to a unique expression tree, and the tree — not the string — is what gets evaluated. 'Left to right' for − and ÷ is left-associativity, and it matters precisely because those operations are not associative: (8 − 2) + 3 and 8 − (2 + 3) differ.
Notation is serialization. Polish prefix notation (+ 3 × 4 2) and postfix notation need no precedence rules at all, because the operator positions encode the tree directly. The convention exists only because infix writing throws that structure away and must recover it.
Postgrad
Formally: the naive grammar E → E + E | E × E | n is ambiguous, and precedence resolves the ambiguity — either by stratifying the grammar (expression, term, factor) or by precedence-climbing in the parser. Every compiler implements the schoolroom convention as a disambiguation scheme over parse trees.
The scheme itself is arbitrary but must be shared: APL evaluates strictly right to left with no precedence and is perfectly consistent. What is not negotiable is that writer and reader hold the same scheme — the convention is a coordination equilibrium, not a theorem.
order of operations
The agreed reading order: grouping, then exponents, then multiplication and division left to right, then addition and subtraction left to right.
Two traps deserve their own paragraph. First, ties: multiplication and division share one rank, as do addition and subtraction, so ties are broken by reading left to right. 8 − 2 + 3 is 9, because the subtraction comes first in reading order. 12 ÷ 3 × 2 is 8 for the same reason. Second, substitution: when a value stands in for a letter, wrap it in parentheses before computing anything.
Evaluate 2x² − 3(x + 1) at x = −3 — the steps fade as you master them
2(−3)² − 3((−3) + 1)
2(−3)² − 3(−2)
2(9) − 3(−2)
18 + 6
24
Why is this true?
Why does −3² equal −9 while (−3)² equals 9?
The exponent binds tighter than the minus sign, so −3² reads as the opposite of 3², which is −9. Parentheses pull the minus sign inside before squaring, and a negative times a negative is positive: (−3)² = 9.
One order, held by everyone: grouping, exponents, multiplication and division left to right, addition and subtraction left to right — and parentheses around every substituted value. With expressions now readable by any reader, the next folio turns the pipe the other way: taking a sentence in plain words and writing it as symbols.
Practice — new ink and old, interleaved
1.In the expression 5c + 3, what does c stand for?
2.Simplify 7t + 2 − 4t, then evaluate it at t = 3.
3.2 + 3 × 4² = ?
4.At x = −2, the expression x² equals:
5.Without looking back: recite the full order of operations, including how ties are broken.
Grouping symbols first, then exponents, then multiplication and division together left to right, then addition and subtraction together left to right — ties within a rank go to the leftmost operation.
How close were you? Grade yourself honestly — it sets your review date.
6.Evaluate 3n + 2 when n = 7.
7.Put the steps for evaluating 4(x − 1)² at x = 3 in order.
- Substitute with parentheses: 4((3) − 1)²
- Grouping: 4(2)²
- Exponent: 4 × 4
- Multiply: 16