NCERT Solutions Class 9 Maths Chapter 11 Think and Reflect — The World of Algorithms
NCERT Class 9 Mathematics — Ganita Manjari Part II, The World of Algorithms. All 3 Think and Reflect prompts answered.
Also here. Every exercise in this chapter is solved, one page per exercise.
Ganita Manjari sets short Think and Reflect boxes into the body of each chapter. They are not exercises and carry no marks, but they ask why something has just worked. Chapter 11 has two such boxes, holding three prompts between them, on printed pages $39$ and $41$.
The first box comes right after the addition algorithm and asks you to justify it, and to extend it from whole numbers to decimals. The second comes after the algorithm for the divisors of a number, and asks how much work it takes.
Key insight. A procedure is not finished when it gives right answers; it is finished when you can say why it gives them, and how much effort it costs. The first two prompts ask for the why: the carry is just a bookkeeping device for place value. The third asks for the cost, and the answer, that the work grows in step with the size of the number and not with its number of digits, is the problem the rest of the chapter sets out to cure.
Prompts 1 and 2 come from the box on page 39, under the heading Adding Numbers Digit by Digit.
Question 1
See if you can complete the argument about grouping by units, tens, hundreds, $\dots$ to justify why the addition algorithm works.
Solution. The book’s argument says: group each number into units, tens, hundreds, and add each group separately; whenever a smaller group makes ten, carry the newly formed ten to the next group. To complete it we show exactly what each column does.
Step 1: write each number by its groups. The $473 + 695$ of the chapter:
$$473 = 3 \text{ units} + 7 \text{ tens} + 4 \text{ hundreds}, \qquad 695 = 5 \text{ units} + 9 \text{ tens} + 6 \text{ hundreds}.$$
Adding group by group, with no carrying yet, gives
$$(3 + 5) \text{ units} + (7 + 9) \text{ tens} + (4 + 6) \text{ hundreds} = 8 \text{ units} + 16 \text{ tens} + 10 \text{ hundreds}.$$
This is already the correct total, but not yet in the standard form, because a group may hold ten or more.
Step 2: carry when a group reaches ten. Ten of a group is worth one of the next bigger group, which is exactly why place value works in base ten.
- $16$ tens $= 6$ tens and $1$ hundred. Write $6$ in the tens place and move the new hundred to the hundreds group.
- The hundreds group now has $4 + 6 + 1 = 11$ hundreds $= 1$ hundred and $1$ thousand. Write $1$ in the hundreds place and move the thousand across.
- The thousands group is now just that $1$.
The result is $1$ thousand, $1$ hundred, $6$ tens and $8$ units, that is $1168$, which is the book’s $473 + 695 = 1168$.
Step 3: the general argument. Let the two numbers have digits $a_0, a_1, a_2, \dots$ and $b_0, b_1, b_2, \dots$ counted from the right, so that $a = \sum a_k 10^k$ and $b = \sum b_k 10^k$. Let $c_0 = 0$, and for each column compute
$$s_k = a_k + b_k + c_k = 10\,c_{k+1} + r_k, \qquad 0 \leq r_k \leq 9.$$
This is what the algorithm does: $r_k$ is the digit written below column $k$ and $c_{k+1}$ is the carry sent to the next column. Rearranged, $a_k + b_k = r_k + 10\,c_{k+1} – c_k$. Multiply by $10^k$ and add over all the columns, $k = 0$ to $K$:
$$a + b = \sum_{k=0}^{K} r_k\,10^k \;+\; \sum_{k=0}^{K} c_{k+1}\,10^{k+1} \;-\; \sum_{k=0}^{K} c_k\,10^k.$$
The last two sums cancel except at the ends. What is left is $c_{K+1}\,10^{K+1}$ from the second sum, and $c_0 = 0$ from the third, so
$$a + b = \sum_{k=0}^{K} r_k\,10^k + c_{K+1}\,10^{K+1}.$$
The right side is the number whose digits are the $r_k$’s, with the final carry $c_{K+1}$ as its leading digit, which is exactly what the algorithm writes: the digits $r_k$ below the columns and, by Step 5, a leading $1$ if the last carry is $1$. So the algorithm writes down the digits of $a + b$, which is what we set out to prove.
In words. Each carry takes ten of one place out of a column ($-10$ there) and puts one of the next place into the next column ($+1$ in a place worth ten times as much). The total never changes; only the way it is split among the groups does.
Group each number into units, tens, hundreds, $\dots$ and add group by group. A group of ten or more of one place is worth one of the next place, so the extra ten is carried over. This never changes the total, only how it is divided among the places.
In symbols, with column total $s_k = a_k + b_k + c_k = 10\,c_{k+1} + r_k$, the sum of all the columns telescopes to $a + b = \sum r_k 10^k + c_{K+1} 10^{K+1}$: the written digits $r_k$, with the last carry in front. For $473 + 695$ this gives $1168$.
Question 2
How would you modify the algorithm to add two decimal fractions?
Solution. Decimals use the same idea of place value, extended to the right of the point: the first place after the point is tenths, the next hundredths, and so on, each worth a tenth of the one before. Ten tenths make one unit, exactly as ten units make one ten. So the carrying works as before, even across the decimal point.
Only two things in the algorithm need changing.
- Step 1 must align the decimal points, not the rightmost digits. The digits that must sit in the same column are those of equal place value. Digits after the point then line up automatically, tenths under tenths.
- Pad the shorter numbers with zeros after the point, so that both have the same number of decimal places. An empty place is read as $0$, as in Exercise Set 11.1, Question 2.
After that, steps 2 to 5 are unchanged: add from the rightmost column leftwards, carry $1$ when a column total reaches ten, and write a final carry on the left. Write the decimal point in the answer directly beneath the points above it.
Example. $3.75 + 12.5$. Align the points and pad $12.5$ to $12.50$:
$$\begin{array}{r} \phantom{0}3.75 \\ +12.50 \\ \hline \end{array}$$
- Hundredths: $5 + 0 = 5$, carry $0$.
- Tenths: $7 + 5 = 12$, write $2$, carry $1$.
- Units: $3 + 2 + 1 = 6$, write $6$, carry $0$.
- Tens: only the $1$ of $12.50$; $0 + 1 + 0 = 1$.
Placing the decimal point gives $16.25$, and $3.75 + 12.5 = 16.25$.
An alternative. Multiply both numbers by the same power of $10$ to make them whole, say by $100$ here: $375 + 1250 = 1625$. Then divide by $100$ again to get $16.25$. This works because $100\,(x + y) = 100x + 100y$, and it reduces the decimal problem to the one the algorithm already solves. Aligning the points is exactly the same thing done silently.
Align the decimal points instead of the rightmost digits, pad the shorter number with zeros after the point, then run the same steps right to left, carrying across the point as if it were not there. Write the point in the answer under the points above.
Check: $3.75 + 12.50 = 16.25$.
Prompt 3 comes from the box on page 41, after the algorithm for the divisors of $n$ has been run for $18$, $375$ and $825$, and just before the section on greatest common divisors.
Question 3
Try to execute the algorithm to compute the divisors of $15$, $135$, and $775$. How does the amount of work increase as the numbers grow?
Solution. The algorithm is: start with an empty list, and for each $j$ in $1, 2, 3, \dots, n$, add $j$ to the list if $j$ divides $n$. Count one unit of work for each divisibility test.
For $15$. Test $j = 1, 2, \dots, 15$. The divisors are $1, 3, 5, 15$, so
$$\text{divisors}(15) = [1, 3, 5, 15], \qquad 15 \text{ tests}.$$
For $135$. Test $j = 1, 2, \dots, 135$. Since $135 = 3^3 \times 5$, the divisors found are $1, 3, 5, 9, 15, 27, 45, 135$, so
$$\text{divisors}(135) = [1, 3, 5, 9, 15, 27, 45, 135], \qquad 135 \text{ tests}.$$
For $775$. Test $j = 1, 2, \dots, 775$. Since $775 = 5^2 \times 31$, the divisors found are $1, 5, 25, 31, 155, 775$, so
$$\text{divisors}(775) = [1, 5, 25, 31, 155, 775], \qquad 775 \text{ tests}.$$
How the work grows. The number of tests is exactly $n$, because every number from $1$ to $n$ is checked, however few divisors there turn out to be. So:
| $n$ | Tests | Divisors found |
|---|---|---|
| $15$ | $15$ | $4$ |
| $135$ | $135$ | $8$ |
| $775$ | $775$ | $6$ |
Going from $15$ to $135$ multiplies the number by $9$ and the work by $9$; going from $135$ to $775$ multiplies it by about $5.7$, and the work by about $5.7$. From $15$ to $775$ the number grows about $51.7$ times and so does the work.
Two points are worth drawing out.
- The work is proportional to $n$ itself, not to how many divisors there are: $775$ has fewer divisors than $135$ but needs nearly six times the effort.
- That means it grows with the value, not the length, of the number. Adding one digit to $n$ multiplies $n$ by about $10$, so each extra digit makes the work about ten times larger. Adding numbers digit by digit needed only one extra column for one extra digit, which is why the chapter then looks for something better for the gcd.
$$\text{divisors}(15) = [1, 3, 5, 15], \quad \text{divisors}(135) = [1, 3, 5, 9, 15, 27, 45, 135],$$
$$\text{divisors}(775) = [1, 5, 25, 31, 155, 775].$$
The algorithm tests every number from $1$ to $n$, so the work is $15$, $135$ and $775$ tests: it grows in step with $n$. Each extra digit makes the work about $10$ times larger.
Common mistakes
- Question 1, saying “the carry is just the extra digit”. It is more than a trick: a carry is ten of one place exchanged for one of the next. That exchange is what makes the total stay the same, and the argument depends on it.
- Question 1, forgetting the final carry. The identity ends with $c_{K+1}\,10^{K+1}$. Leaving it out is the same error as dropping Step 5.
- Question 2, lining up the rightmost digits. For $3.75 + 12.5$ that puts the $5$ of $12.5$ under the $5$ of $3.75$, adding tenths to hundredths, and gives a wrong answer that looks plausible.
- Question 2, forgetting to pad. An empty place after the point is $0$. Without padding, the column under the $5$ of $3.75$ is blank and the algorithm gives no instruction.
- Question 3, counting the divisors found instead of the numbers tested. The work is the tests, and all $n$ of them are made. The list is short only because few numbers divide $n$.
- Question 3, believing a bigger number always means more divisors. $135$ has eight and $775$ only six, yet $775$ costs more to examine.
Practise next
- Exercise Set 11.1, Questions 3 to 5 — probe the same addition algorithm from the other side: why it must run right to left, why the carry stays at $1$, and what Step 5 contributes.
- Exercise Set 11.2, Question 3 — cuts the work of Question 3 above sharply, by listing the divisors in pairs so that only numbers up to $\sqrt{n}$ need testing.
Shiwam's Classes: CBSE 10CBSE Class 10 Maths and Science, every chapter
Subscribe
Doubts are answered by Shiwam, usually within a day. Ask about this question specifically — a general question about the chapter is better asked in class.