Mathematics Book 1 Exercises: Arithmetic and NumbersMaths Book 1 · Exercises
0 / 0

Workbench / Mathematics Book 1 Exercises: Arithmetic and Numbers

B1·03

Adding and Subtracting

Exercises for chapter 3: why carrying and borrowing work, strategies you can explain, three subtraction methods coded and checked against each other, what casting out nines really catches (measured), a million ten-paise coins added in floating point, totals checked three ways, subtraction by complement in any base, and senior exercises on counters, distributed totals and reconciliation.

20 topics · ~5 min read
Updated Suggest a correction

Start here: how these exercises work

Write your answer in the box first; hints open one at a time as you write, and the solution a couple of minutes after the last hint. Theory is in your own words, practice and programs come with real output (Python 3.13), cumulative projects use chapters 1 to 3 together, what the chapter leaves out explains what it skips, and senior exercises put the ideas into designs and reviews.

Theory

T1. Carrying, explained to a ten-year-old

Explain, using bundles of ten sticks, why 58+67 is done by adding the ones, writing 5 and carrying 1. Then explain why we start at the ones and not the tens. Use no rules you can't show with the sticks.

T2. Same difference, everyday

Explain why 1003−498 and 1005−500 have the same answer, using a story about two people's ages. Then use the idea to do 6001−2997, 10,000−3,456 and 7.02−2.98 in your head.

T3. Why borrowing across zeros changes several digits

In 4000−1, borrowing changes three digits of 4000 before anything is subtracted. Explain why, with boxes, bundles and loose sticks, and say what 4000 looks like after the regrouping.

T4. A carry of 2

When you add a column of three numbers, a carry can be 2. Find three 2-digit numbers whose sum produces a carry of 2 from the ones column, and prove that with three numbers the carry can never be 3.

T5. What casting out nines can and can't see

Explain why casting out nines catches a dropped carry but never catches two swapped digits. Then say which kinds of errors it catches only sometimes.

T6. Why computers subtract by adding

Explain, without code, how 7032 − 2845 can be done using only "take each digit from 9" and addition, and why this means a computer needs only an adder to subtract.

Practice and programs

P1. Mental strategies

Do each in your head, naming the strategy: (a) 397+286; (b) 1000−368; (c) 5003−2996; (d) 48+77+52+23; (e) 15,000−9,875; (f) ₹2,000 paid for a ₹1,365 bill: the change, counted up.

P2. Two subtraction methods, coded and compared

Write column subtraction by decomposition (borrowing, including across zeros) and by equal addition, and test both against Python's - on 100,000 random pairs. Show both on 7032−2845 and 50004−18569.

P3. What casting out nines really catches

Simulate 100,000 additions of two six-digit numbers and four kinds of mistake in the answer: one digit off by 1, two neighbouring digits swapped, a carry dropped, and an answer off by 9 in one place. For each, measure how often casting out nines catches it. Predict the four rates before running it.

P4. A million ten-paise coins

Add ₹0.10 a million times with a floating-point loop, with integer paise, with Decimal, with math.fsum and with sum(). Explain each result.

Cumulative projects (chapters so far: 01–03)

C1. A total, checked three ways

Write total_with_checks(amounts, claimed_total) that reads each amount strictly (chapter 2), adds in whole paise (chapter 1), and checks a claimed total three ways: exactly, by casting out nines, and against an estimate made by rounding each amount to the nearest ₹100. Try it on the stage 1 ledger's amounts with a correct total and four wrong ones: two digits swapped in the tens and units (₹45,950.50), the leading digits swapped (₹54,905.50), a digit off by 1 (₹45,915.50) and a dropped carry (₹45,904.50).

C2. Subtraction by complement, in any base

Write subtract_by_complement(a, b, base, width) that computes a−b with width digits using only "each digit from base − 1", addition and dropping the carry out. Run it in base 10, base 2 with 8 digits and base 16. What does a carry out of 0 tell you?

What the chapter leaves out

Faster adders: carry-lookahead

A ripple-carry adder (chapter 3's lab) must wait for each column's carry before the next column can finish, so adding two 64-bit numbers takes 64 steps of delay. Real processors use carry-lookahead adders: for each column they compute, in parallel, whether it would generate a carry (both bits 1) or propagate one (exactly one bit 1), and combine those in a tree, so the delay grows with logn rather than n. The arithmetic is the same column addition; the hardware works out every carry at once instead of waiting.

Compensated summation

Experiment 4 in the chapter and programming exercise P4 show Python's sum() and math.fsum avoiding the drift of a floating-point loop. The classic method is Kahan summation (1965): keep a second variable holding the low-order part lost in each addition, and add it back in the next step. It costs a few extra operations per number and makes the error almost independent of how many numbers are added. Python's sum() uses a variant (Neumaier's) since version 3.12.

Check digits that see swaps

Casting out nines misses swapped digits. Identification numbers use check digits designed to catch them: the Luhn algorithm (on payment cards) doubles every second digit before adding, so swapping two neighbours usually changes the total; ISBN-10 weights each digit by its position, modulo 11, and catches every single-digit error and every swap of neighbours. They're casting out nines with weights, and chapter 5's modular arithmetic explains why they work.

Why the methods are taught the way they are

Which subtraction method schools teach has changed over time and differs by country. Brownell and Moser's 1949 study found that children taught decomposition meaningfully (with the bundles) understood and transferred it better, which helped decomposition become dominant in the United States; equal addition remained common elsewhere for decades. Both are correct; the research question was which one children learn to understand, not which one is right.

Senior exercises

S1. The page-view counter that went negative

A service stores page views in a signed 32-bit integer and increments it on every view. After a few months a popular page shows a large negative number. Explain what happened with chapter 3's ideas, and design the fix, including what to do with the counts already stored.

S2. Totals that differ by a few paise between two reports

Two services compute the day's revenue: one sums all orders in a single query, the other sums per-shard subtotals and then adds them. Both use floating-point columns. The totals differ by a few paise. Which is right, and how do you make them agree by design?

S3. A daily reconciliation job

Design a job that checks, every night, that the money your payment system thinks it received equals what the bank says arrived. What do you compare, what tolerances (if any) do you allow, and what happens when it fails?