Primary & Middle School Mathematics · Grades 1–9
45Priorities of Operations
What is ? If you compute left to right you get ; if you multiply first you get . Mathematics needs one single answer, so there are traffic rules for computations — the priorities. This chapter states them and introduces a first algebraic identity, distributivity.
45.1 The priority rules
Theorem 45.1 (Priority rules)
In a computation without brackets:
- multiplications and divisions are performed before additions and subtractions;
- operations of the same level are performed from left to right.
Brackets override everything: what is inside brackets is computed first, starting with the innermost ones.
Example 45.2
One step per line, underlining (mentally) what is computed:
Note the traps: is not , and is not .
Example 45.3 (Nested brackets)
Remark 45.4 (Fraction bars hide brackets)
A fraction bar groups its numerator and its denominator, as if each had invisible brackets:
Method 45.5 (Computing safely)
- Spot the operation to do first (innermost brackets, then and , then and );
- compute only that one, and rewrite the whole expression with the result in place;
- repeat until one number remains — one operation per line, no shortcuts.
45.2 Distributivity
Theorem 45.6 (Distributivity)
For all numbers , , :
Proof by a picture. Count the area of a rectangle of width split into two smaller rectangles of lengths and : as a whole it is ; in two parts it is . Same rectangle, same area. ∎
Example 45.7 (Both directions)
Expanding (left to right) makes mental math easy:
Factoring (right to left) collects a common factor:
Example 45.8 (Translating words into a computation)
“The sum of and the product of by ” is . “The product of by the sum of and ” is : the words “the product of … by the sum of…” put brackets around the sum.
45.3 Exercises
Exercise 45.1 ★
Compute, one operation per line:
Solution
Solution of Exercise 45.1.
.
.
.
.
Exercise 45.2 ★
Compute:
Solution
Solution of Exercise 45.2.
(left to right).
(left to right).
(multiplication first).
.
Exercise 45.3 ★
Compute step by step:
Solution
Solution of Exercise 45.3.
.
.
.
Exercise 45.4 ★
Compute the fractions (invisible brackets!):
Solution
Solution of Exercise 45.4.
; ; .
Exercise 45.5 ★
Use distributivity to compute mentally:
Solution
Solution of Exercise 45.5.
.
.
.
.
Exercise 45.6 ★
Write the computation in one line, with brackets where needed, then compute: “the difference of and the product of by ”; “the product of the sum of and by the difference of and ”.
Solution
Solution of Exercise 45.6.
“The difference of and the product of by ”: (no brackets needed, the priority does the work).
“The product of the sum of and by the difference of and ”: .
Exercise 45.7 ★
Amir bought notebooks at each and pens at each. Write his total in a single expression, then compute it.
Solution
Solution of Exercise 45.7.
euros.
Exercise 45.8 ★★
Place brackets in to make the result: (a) ; (b) ; (c) . (One of the three needs no brackets at all — which one?)
Solution
Solution of Exercise 45.8.
(a) no brackets: .
(b) .
(c) .
Exercise 45.9 ★★
Are and the same for every number ? Test with and , and conclude. Which priority mistake would lead from one to the other?
Solution
Solution of Exercise 45.9.
: and — they agree (that is why is a bad test!). : but : different. So the two expressions are not equal in general. The mistake comes from adding first, ignoring the priority of .
Exercise 45.10 ★★
A cinema ticket costs euros, but a group of people pays a flat euros plus euros per person.
- Write an expression for the group price, and compute it for .
- From how many people is the group rate cheaper than individual tickets? (Try a few values of .)
Solution
Solution of Exercise 45.10.
1. Group price: . For : euros.
2. Individual price: . Compare: : vs (individual cheaper); : vs (equal); : vs (group cheaper). From people on, the group rate wins (each extra person costs instead of , so the gap only grows).
Exercise 45.11 ★★★
Using each of the digits , , , exactly once, the four operations and brackets at will, write expressions equal to , to , and to .
Solution
Solution of Exercise 45.11.
Possible answers (many exist):
45.4 Problem: Multiplying like an Egyptian scribe
Problem 45.1
Weekend problem — mental-math tricks from distributivity, and the doubling–halving multiplication used for four thousand years
Long before calculators — and before multiplication tables were drilled at school — Egyptian scribes and Russian peasants multiplied any two numbers using only doubling, halving and adding. Their method looks like magic; it is in fact distributivity (Theorem 45.6) working at full power. This problem sharpens your mental arithmetic, then teaches you the ancient method, then opens the hood to see exactly why it works.
Part I — The art of not computing.
- Compute mentally, expanding as in Example 45.7: and .
- Compute mentally, factoring: and .
- The “times ” trick: to multiply by , multiply by and halve. Compute this way, and explain why the trick is legitimate.
- Two more tricks to justify and use: multiply by by multiplying by and dividing by (compute ); multiply by by multiplying by and subtracting once (compute ).
- A warning shot: distributivity spreads a factor over a sum, never over a product. Compare with , and then with : which pair matches, which does not?
Part II — The doubling–halving method. Here is the recipe for . Write two columns. Left column: start at and halve, dropping any remainder, down to : . Right column: start at and double as many times: . Cross out every row whose left number is even, and add the surviving right numbers.
- Carry out the recipe for : which row is crossed out, what sum remains, and does it equal ?
- Multiply by the method (halve , double ), and check the answer by ordinary multiplication.
- Multiply by the method. How many rows survive, and what is special about a left column that starts at , , , , ?
Now why it works, one step at a time. Justify each equality with distributivity:
Moral: halving the left and doubling the right keeps the product — but when the left number is odd, one copy of the right number splits off and must be banked. Which number does the first row of the table bank?
- Continue the bookkeeping down the table: , then , then . Collect everything that was banked along the way, and explain why the banked numbers are exactly the right-column numbers of the rows with an odd left — the rows the recipe keeps.
Part III — Under the hood: sums of doublings.
- In question 6, the surviving rows were worth , and doublings of : the method silently wrote . Check that , and find which doublings (, , , , ) the method kept for in question 7.
- Write and as sums of numbers from the doubling list , using each at most once.
- Explain why every whole number can be written this way: take the largest doubling number that fits, subtract, repeat — why must this stop? Write as such a sum.
- The scribes of Egypt did exactly this, four thousand years ago: to multiply , they made a doubling table of (, , , , ), picked the rows adding up to , and summed. Do the computation their way.
- Finale: modern computers, which count with s and s, multiply essentially like the scribes — by doublings and additions. Which three additions would a computer make for ? (Why every number splits into doublings, and what s and s have to do with it, is the weekend problem of the Powers chapter: Problem 56.1.)
Solution
Solution of Problem 45.1.
1. ; .
2. ; .
3. . Legitimacy: , so multiplying by is multiplying by then dividing by (the order of and at the same level, left to right, does the rest).
4. , because . And : distributivity over the difference (Theorem 45.6).
5. and : they match — that is distributivity. But , while : no match. The factor spreads over the terms of a sum, not over the factors of a product.
6.
Sum of the surviving right numbers: , and indeed .
7. Halving : ; doubling : . Even lefts and are crossed out; survivors . Check: .
8. Halving : ; doubling : . Every left number except the final is even: a single row survives, and the answer is . A left column made of pure doublings keeps only its last row — the method reduces to doubling alone.
9. , so by distributivity ; and since halving one factor while doubling the other leaves a product unchanged (). The odd left number split off one copy of the right number: the first row banks .
10. (halve–double, no banking: is even). : the odd banks . Finally : the odd banks and the table ends. Total banked: . A row banks its right number exactly when its left number is odd — so the recipe “keep the odd-left rows and add” is precisely the bookkeeping of distributivity.
11. . For , the surviving rows were those of , and : the doublings .
12. and .
13. Take the largest doubling number not exceeding the target and subtract it; what remains is smaller, and smaller than the doubling number just used (otherwise a bigger one would have fitted). Repeating, the remainder strictly shrinks and must reach : the process stops, and the doublings used are all different. For : fits ( left), fits ( left), fits ( left): .
14. Doubling table of : , , , , . Since , pick those rows: . Check: .
15. The same three as the scribe and the peasant: — the doublings of selected by . Writing numbers as sums of doublings is exactly writing them with s and s; the full story is told in Problem 56.1.