Shelves / Arithmetic and Numbers
AN·04
Multiplying and Dividing
Multiplication and division from the inside: the times tables and the structure that makes them small, why long multiplication works (and a faster method computers use), division with remainder as a theorem, long division step by step and why it's correct, and where programming languages disagree about remainders.
Start here
What this chapter answers
Why are there really only about thirty times-table facts to learn? Why does long multiplication shift each row one place left? How many digits will a product have, before you work it out? What exactly is a remainder, and why is it always smaller than the divisor? Why does long division "bring down" the next digit, and why does it work? And why does Python say that −17 divided by 5 leaves remainder 3, while JavaScript says −2?
Multiplying and dividing in one picture
Tiles for a floor: 23 rows of 14 tiles. You could count them, or add 14 twenty-three times. Instead, split the rectangle: 20 rows and 3 rows, and each row into 10 tiles and 4 tiles. Now there are four smaller rectangles, , , and , each easy: 200, 80, 30 and 12, total 322. Long multiplication is that split, organised in columns.
Division runs the picture backwards: 322 tiles laid in rows of 14; how many rows? Take away as many big chunks of rows as you can (20 rows use 280 tiles, leaving 42), then smaller chunks (3 rows use 42), until nothing, or less than a row, is left. Long division is that, done one place at a time.
Multiplication facts
The table is smaller than it looks
The table of products from to has 100 entries. Much of it is free:
- Commutativity makes and one fact, leaving 55.
- Times 0 is always 0 and times 1 changes nothing (the identities of chapter 1), removing 19 more.
- Times 2 is doubling, times 5 is half of times ten (), and times 9 is times ten minus once ().
What's left to memorise outright is a short list: the squares ( to ) and the products of 3, 4, 6, 7 and 8 with each other. Every one of those can also be built from a neighbour: , double . Knowing how a fact is built means a forgotten one can be rebuilt in two seconds.
Patterns that are facts
- In the nine times table, the digits of each product (up to ) add to 9: 18, 27, 36, …. That's because : each step adds one ten and takes one away from the ones. Chapter 5 shows it's a special case of a bigger fact.
- Even times anything is even; odd times odd is odd. (Write the odd numbers as and multiply.)
- Multiplying by 10 appends a zero (chapter 2: it moves every digit one place left), by 100 two zeros, and so on.
Multiplying longer numbers
By a one-digit number
: distributivity over the expanded form gives . The column method does the same, right to left, carrying: (write 2, carry 4); (write 0, carry 6); .
6 4 carries
3 8 6
× 7
-------
2 7 0 2
Carries in multiplication can be larger than in addition: a column can reach , so carries go up to 8 (and never beyond, by the same induction as chapter 3: if the carry in is at most 8, the column is at most 89).
Long multiplication
For , split the second number by place value: . Each part is a one-digit multiplication, and multiplying by 20 is multiplying by 2 and then by 10, which shifts the row one place left:
3 4 7
× 2 6
-------
2 0 8 2 347 × 6
+ 6 9 4 0 347 × 20
-------
9 0 2 2
The zero at the end of the second row is the "times ten". Many people leave it out and just start the row one place to the left; it's the same thing, and forgetting why it's there is how rows end up misaligned.
The box method and the lattice
The box (grid) method writes the split explicitly, one cell per pair of place values; it's the tiles picture from Start here:
| × | 300 | 40 | 7 |
|---|---|---|---|
| 20 | 6000 | 800 | 140 |
| 6 | 1800 | 240 | 42 |
Adding all six cells gives 9,022. It shows every partial product, which makes it the clearest method for learning and the slowest for doing.
The lattice method writes each single-digit product in a cell split by a diagonal, tens above and ones below, then adds along the diagonals. The diagonals line up the place values automatically, so no shifting is needed. It's the same four-rectangles idea with different bookkeeping.
How many digits will the product have?
This is the simplest check there is on a long multiplication: must have 4 or 5 digits, and 9,022 has 4. A 3-digit or 6-digit answer is wrong before you look at a single digit.
Mental multiplication
Each of these is a rule from chapter 1 used on purpose:
- Double and halve (associativity): . .
- Times 5 is half of times 10: .
- Times 9 is times 10 minus once (distributivity): .
- Times 11 for two-digit numbers: write the two digits apart and put their sum between, carrying if needed: ; . It's in columns.
- Either side of a round number: . Expanding the brackets by distributivity, the cross terms and cancel. Chapter 10 returns to this pattern, .
Division
Division with remainder
Chapter 1 defined as the number that multiplies by to give , and noticed that among whole numbers there often isn't one: 17 sweets don't share equally among 5 children. What always exists is a quotient and a remainder.
The condition is what makes the answer unique: is a true statement, but 7 isn't the remainder, because two more fives fit in it. "Divides exactly" (chapter 5's main subject) means the remainder is 0.
What the remainder means
The theorem gives one answer; the situation decides what to do with it (chapter 1). 17 children, minibuses for 5: , so 4 minibuses. 17 sweets for 5 children: 3 each, 2 left over. 17 litres of juice into 5 jugs: litres each, because juice can be split, which is where fractions (chapter 6) and decimals (chapter 7) come in.
Short division
Dividing by a one-digit number, you can do the work in your head and write only the quotient. : 8 thousands ÷ 6 is 1 thousand each, 2 thousands left over, which are 20 hundreds; with the 4 hundreds that's 24 hundreds, ÷ 6 is 4 hundreds each, nothing left; 7 tens ÷ 6 is 1 ten each, 1 ten left, which is 10 ones; with the 2 ones, 12 ÷ 6 is 2. Quotient 1,412, remainder 0.
That is sharing, one place at a time: share out the biggest pieces first, then break up what's left over into the next size down (the unbundling of chapter 3) and share those.
Long division
The same process, written out when the divisor has more than one digit and the steps need paper. :
3 1 9 quotient
--------
23 ) 7 3 4 6
6 9 3 × 23
---
4 4 bring down the 4
2 3 1 × 23
---
2 1 6 bring down the 6
2 0 7 9 × 23
-----
9 remainder
Each step asks one question, "how many times does 23 go into this?", subtracts, and brings down the next digit. The quotient is 319 and the remainder 9: .
Finding each quotient digit
With a two-digit divisor, each digit of the quotient is an estimate that you check. To divide 315 by 39, round 39 to 40: about 7. Then check: , leaving 42, which is more than 39: the estimate was too small, so use 8 (, leaving 3). If the product had been bigger than 315, the estimate would have been too big. The rule: after each subtraction, the remainder must be less than the divisor, or the digit was too small. That's the division algorithm's condition, checked at every step.
Zeros in the quotient
: 60 hundreds ÷ 15 = 4 hundreds, nothing left. Bring down the 4: 4 tens ÷ 15 is 0 tens, remainder 4. Bring down the 5: 45 ones ÷ 15 = 3. Quotient 403. Skipping the 0 (writing 43) is the most common long-division error, and the length check catches it: 6,045 ÷ 15 is more than 6,000 ÷ 100 = 60 and less than 6,045 ÷ 10, so it has three digits.
Checking a division
Multiply back: . ✓ And check the remainder is less than the divisor (9 < 23). Both conditions together are exactly the division algorithm, so passing them proves the answer correct, not just plausible.
Lab: multiplying and dividing in code
Experiment 1: long division as code
def long_division(n, d):
"""Divide n by d the school way, one digit of n at a time, and show each step."""
q, r, steps = "", 0, []
for ch in str(n):
r = r * 10 + int(ch) # bring down the next digit
digit = r // d # how many times does d go in?
steps.append(f"bring down {ch}: {r:>4} ÷ {d} = {digit}, remainder {r - digit * d}")
q += str(digit)
r -= digit * d
return int(q), r, steps
q, r, steps = long_division(7346, 23)
print("\n".join(steps))
print(f"7346 = {q} × 23 + {r}")
import random
random.seed(4)
bad = 0
for _ in range(100_000):
n, d = random.randrange(10**9), random.randrange(1, 10**4)
q, r, _s = long_division(n, d)
bad += (q, r) != divmod(n, d) or not (0 <= r < d and n == q * d + r)
print("random divisions checked: 100000 wrong:", bad)
bring down 7: 7 ÷ 23 = 0, remainder 7
bring down 3: 73 ÷ 23 = 3, remainder 4
bring down 4: 44 ÷ 23 = 1, remainder 21
bring down 6: 216 ÷ 23 = 9, remainder 9
7346 = 319 × 23 + 9
random divisions checked: 100000 wrong: 0
The whole method is two lines in the loop: r * 10 + int(ch) is "bring down" (the leftover unbundled into the next place, plus that place's digit), and r // d is "how many times does it go?". The first step gives a quotient digit of 0, which on paper we don't write as a leading zero. Python's divmod gives quotient and remainder together, and the check confirms both conditions of the division algorithm on a hundred thousand random cases.
Experiment 2: n² steps, or fewer
Long multiplication of two -digit numbers does single-digit products: double the length, four times the work. Karatsuba's method splits each number into a high half and a low half, , and notices that the middle term can be found from one extra product, , instead of two. Three half-size products instead of four, applied again and again. The code counts the single-digit products each method does.
count = 0
def school(x, y):
"""Long multiplication on digit lists (least significant first), counting digit-by-digit products."""
global count
out = [0] * (len(x) + len(y))
for i, a in enumerate(x):
carry = 0
for j, b in enumerate(y):
count += 1
t = out[i + j] + a * b + carry
out[i + j], carry = t % 10, t // 10
out[i + len(y)] += carry
return out
def karatsuba(a, b):
"""Karatsuba (1962): three half-size products instead of four. Counts single-digit products at the bottom."""
global count
if a < 10 or b < 10:
count += 1
return a * b
m = max(len(str(a)), len(str(b))) // 2
a1, a0 = divmod(a, 10**m); b1, b0 = divmod(b, 10**m)
z2 = karatsuba(a1, b1); z0 = karatsuba(a0, b0)
z1 = karatsuba(a1 + a0, b1 + b0) - z2 - z0
return z2 * 10**(2 * m) + z1 * 10**m + z0
import random
random.seed(2)
print(f"{'digits':>7} {'school':>9} {'Karatsuba':>10}")
for n in (8, 16, 32, 64, 128, 256):
a, b = random.randrange(10**(n - 1), 10**n), random.randrange(10**(n - 1), 10**n)
digits = lambda v: [int(c) for c in reversed(str(v))]
count = 0; s = school(digits(a), digits(b)); c1 = count
count = 0; k = karatsuba(a, b); c2 = count
assert int("".join(map(str, reversed(s)))) == a * b == k
print(f"{n:>7} {c1:>9} {c2:>10}")
digits school Karatsuba
8 64 27
16 256 107
32 1024 375
64 4096 1051
128 16384 3147
256 65536 9657
Doubling the length multiplies the school method's work by exactly 4, and Karatsuba's by about 3 (a little more here, because the sums sometimes gain a digit). At 256 digits that's 65,536 products against 9,657, and the gap keeps widening: Karatsuba's count grows like (since ). Python uses Karatsuba for its own large integers, and libraries for very large numbers use faster methods still; in 2019 David Harvey and Joris van der Hoeven published one that takes about steps, which is believed to be the best possible. For numbers the size people write, the school method is fastest, which is why it's the one taught.
Experiment 3: whose remainder?
print(17 // 5, 17 % 5, divmod(17, 5))
print(-17 // 5, -17 % 5, divmod(-17, 5))
3 2 (3, 2)
-4 3 (-4, 3)
console.log(Math.trunc(17 / 5), 17 % 5);
console.log(Math.trunc(-17 / 5), -17 % 5, Math.floor(-17 / 5));
3 2
-3 -2 -4
For whole numbers, both languages agree with the division algorithm: . For negative numbers they disagree, and both are internally consistent. Python rounds the quotient down () and so keeps the remainder between 0 and 4: . JavaScript's % (like C's and Java's) truncates the quotient towards zero (−3) and lets the remainder take the sign of the dividend: . Chapter 9 defines negative numbers; the practical lesson now is that % is not the same operation in every language, and code that does x % n to wrap around a clock or an array index breaks on negative x in JavaScript, C and Java.
Experiment 4: checking the length rule
for m, n in [(1, 1), (2, 2), (3, 2), (3, 3)]:
lengths = {len(str(a * b)) for a in range(10**(m - 1), 10**m) for b in range(10**(n - 1), 10**n)}
print(f"{m}-digit × {n}-digit: every product has {sorted(lengths)} digits")
print(10 * 10, 99 * 99, 100 * 100, 999 * 999)
1-digit × 1-digit: every product has [1, 2] digits
2-digit × 2-digit: every product has [3, 4] digits
3-digit × 2-digit: every product has [4, 5] digits
3-digit × 3-digit: every product has [5, 6] digits
100 9801 10000 998001
Over every pair (nearly a million for the last line), products have or digits, never anything else, as the theorem says; the extreme cases are the smallest and largest numbers of each length.
Worked examples
Long multiplication with a check
A quotient digit that needs correcting
Choosing what the answer means
Exercises
Practice
- Build these facts from easier ones, saying how: , , , .
- Calculate mentally: (a) ; (b) ; (c) ; (d) .
- Multiply on paper: (a) ; (b) ; (c) .
- Without multiplying, say how many digits each product has, or which two lengths are possible: (a) ; (b) ; (c) .
- Find quotient and remainder: (a) ; (b) ; (c) .
- Check your answers to question 5 using the division algorithm.
- Which of these is the true quotient and remainder of 100 ÷ 7: (i) r ; (ii) r ; (iii) r ? Explain why the others are rejected.
Answers
- For example: ; ; double ; double double 7 .
- (a) ; (b) ; (c) ; (d) .
- (a) 5,832; (b) , , total 14,210; (c) 699,678.
- (a) : 7 digits. (b) 4 digits × 4 digits gives 7 or 8; it is 10,001,406, which has 8. (c) 3 × 2 digits gives 4 or 5; , 5 digits.
- (a) 1,410 r 6; (b) 208 r 8; (c) 306 r 3.
- , 6 < 7; , 8 < 24; , 3 < 33.
- (ii). (i) is a true equation but the remainder 9 isn't less than 7; (iii) is true too, but the remainder must be between 0 and 6.
Harder
- Prove that the carry in multiplying by a single digit is never more than 8.
- Explain why multiplying in binary needs no times table at all, and multiply by shifting and adding. Check in decimal.
- A number leaves remainder 3 when divided by 7. What remainder does twice the number leave? Three times? Explain using the division algorithm.
- The quotient of a long division has a 0 in the middle, and someone writes the answer without it. What does the length rule tell you, and what does multiplying back show?
- Show that with a picture: start from an by square of tiles, remove one row, then add one column. Use it to find .
Answers
- In a column the digit product is at most . If the incoming carry is at most 8, the column total is at most 89, so the outgoing carry (its tens digit) is at most 8. The first column has no incoming carry, so by induction every carry is at most 8.
- A binary digit is 0 or 1, so each row is either 0 or a copy of the first number, shifted. ; . ✓
- , so : remainder 6. : remainder 2. Remainders multiply like the numbers, then reduce; chapter 5 builds on this.
- The quotient written without the 0 has one digit fewer than the length rule allows for dividend ÷ divisor, and multiplying it back by the divisor gives a number about ten times too small, nowhere near the dividend. Either check exposes the error.
- An by square, with one row removed, is rows of . Adding one column gives rows of , which adds tiles, so . So .
Challenge
- Karatsuba's trick computes as . Verify the identity by expanding. Then use it to multiply with three single-digit multiplications instead of four. Why doesn't the trick help for single-digit numbers, and why does it help so much for very long ones?
Discussion
; subtracting and leaves . For : ; ; , so the middle term is . Then . ✓ It trades one multiplication for several additions and subtractions; for single digits a multiplication is as cheap as an addition, so nothing is saved. For long numbers a multiplication costs far more than an addition, and the saving applies again at every level of halving, so it compounds: instead of at depth .
In real life
Misconceptions and limits
The model to keep
Common misconceptions
| Misconception | What's actually true | Where it's shown |
|---|---|---|
| "The answer to a division problem is the quotient." | The situation decides: buses round up, equal shares round down, and "is it divisible?" asks whether the remainder is 0. | What the remainder means |
| "The remainder can be any leftover amount." | The remainder must be less than the divisor; is true but 7 isn't the remainder. | Division with remainder |
| "A zero in the quotient can be skipped." | Skipping it makes the quotient ten times too small (403 becomes 43); every place needs a digit. | Zeros in the quotient |
| "The times table has 100 facts to memorise." | Commutativity, the identities and a few strategies leave only a short list, each buildable from a neighbour. | The table is smaller than it looks |
| "Long multiplication is the only (or fastest) way." | It takes digit products; Karatsuba's method takes about , and faster methods exist. | Experiment 2: n² steps, or fewer |
| "% gives the same remainder in every language." | For negative numbers, Python's % follows the sign of the divisor (−17 % 5 is 3), JavaScript's, C's and Java's the sign of the dividend (−2). |
Experiment 3: whose remainder? |
| "Division always makes smaller." | Only when dividing by a number greater than 1; chapter 6 divides by fractions and makes things bigger. | Division with remainder |
Limits and trade-offs
- The division algorithm needs . There is no quotient and remainder for division by zero (chapter 1).
- Whole-number division leaves remainders. Exact sharing of 17 by 5 needs fractions (chapter 6) or decimals (chapter 7), and some decimals never end.
- Paper methods trade speed for transparency. The box method shows every partial product and is slow; the lattice hides the shifting; the column method is compact and easiest to get wrong by misalignment.
- Machine multiplication overflows. A product of two 32-bit numbers needs up to 64 bits (the length rule, in binary), which is why multiplying two
ints in C or Java can silently wrap around.
Revision sheet
Key ideas
- Times tables shrink to a short list via commutativity, identities, doubling, ×5 = half of ×10, ×9 = ×10 − ×1.
- Long multiplication = distributivity over place value: one row per digit, shifted by its place, then column addition. Works in any base; binary is shift-and-add.
- Multiplying by one digit, carries are at most 8.
- An -digit × -digit product has or digits.
- Mental strategies: double and halve, ×5, ×9, ×11, .
- Division algorithm: , , exactly one solution.
- Short and long division share the biggest place first and bring down (unbundle the leftover into the next place).
- Each quotient digit is an estimate: remainder ≥ divisor means the digit was too small.
- Never skip a 0 in the quotient.
- Check a division by and ; a product by length, estimate, casting out nines.
- Languages disagree on negative remainders.
Glossary
- Product: the result of a multiplication; the numbers multiplied are its factors.
- Partial product: one row of a long multiplication, the product of the first number with one digit of the second, shifted to its place.
- Long multiplication: the column method that adds shifted partial products.
- Box (grid) method: multiplication by splitting both numbers by place value and writing every pairwise product in a grid.
- Lattice method: multiplication in a grid of cells split by diagonals, adding along the diagonals.
- Dividend and divisor: in , the number divided () and the number divided by ().
- Quotient: the whole number of times the divisor fits into the dividend.
- Remainder: what is left after taking away the quotient's worth of divisors; always less than the divisor.
- Division algorithm: the theorem that with has exactly one solution in whole numbers for .
- Short division: division by a one-digit number with the intermediate steps done mentally.
- Long division: division written out step by step, bringing down one digit at a time.
- Karatsuba multiplication: a method that multiplies -digit numbers using three half-size products instead of four, taking about steps.