Algorithms

NCERT Solutions Class 9 Maths Exercise 11.1 — The World of Algorithms

NCERT Class 9 Mathematics — Ganita Manjari Part II, The World of Algorithms, Exercise Set 11.1. All 5 questions solved.

This exercise asks you to run the chapter’s first algorithm, the one for adding two numbers, and then to try to break it. The algorithm reads:

  1. Write the numbers one below the other in the Indian base-ten place-value system, so that the digits are aligned from right to left.
  2. Add the rightmost digits. If the sum is less than $10$, write the sum below the two digits and set the carry to $0$. If the sum is more than $10$, write the units digit of the sum below the two digits and set the carry to $1$.
  3. Move to the next column on the left. Add the two digits and the current carry. Then write the sum, or its units digit, and set the carry, exactly as in Step 2.
  4. Repeat Step 3 until there are no more digits on the left.
  5. If the value of carry is $1$, write $1$ to the left of the bottom row.

Every question below is about what these five steps do, and do not do, when taken literally. That is the point of an algorithm: it is a recipe a machine, or a careful student, could follow without understanding anything.

Key insight. An algorithm is only as good as its steps are complete and its assumptions are stated. Each question here pokes at one of them: what the steps say about unequal lengths, why they insist on right-to-left, why the carry stays small, and what Step 5 is for. Whenever a step looks unnecessary, ask for the input on which the algorithm would give a wrong answer without it.

Question 1

Add two $4$-digit numbers using the steps we have written down. Make sure you follow the steps precisely; do not perform any action that is not explicitly mentioned. Are you able to obtain the correct result?

Solution. Take $4768 + 3457$, which makes every column carry.

Write them aligned on the right (Step 1) and work from the units column:

Column Digits Carry in Total Written Carry out
Units $8 + 7$ $0$ (none yet) $15$ $5$ $1$
Tens $6 + 5$ $1$ $12$ $2$ $1$
Hundreds $7 + 4$ $1$ $12$ $2$ $1$
Thousands $4 + 3$ $1$ $8$ $8$ $0$

No digits remain on the left, the carry is $0$, so Step 5 does nothing. Reading the bottom row from the left gives $8225$, and indeed $4768 + 3457 = 8225$.

Two small points show up when the steps are followed “precisely”.

  • The algorithm never says to stop looking for further actions once Step 4 ends. That is fine, because Step 5 is a complete instruction and a carry of $0$ means it asks for nothing.
  • Steps 2 and 3 handle a column total that is less than $10$ or more than $10$, and neither covers a total of exactly $10$. Try $4725 + 3175$: the units column gives $5 + 5 = 10$, which is neither less than nor more than $10$, so a literal reader is stuck. The book’s own wording in the running text, “equal to or more than $10$”, shows what is meant: a total of $10$ writes $0$ and carries $1$. With that reading the algorithm gives $7900$, which is correct.

Yes. For example $4768 + 3457$: columns give $15, 12, 12, 8$ with carries $1, 1, 1, 0$, and the bottom row reads $8225$, which is correct.

The steps work for every pair of $4$-digit numbers, provided “more than $10$” is read as “ten or more”, since a column total of exactly $10$ is not covered by the wording.

Question 2

What happens if you add a $5$-digit number to a $3$-digit number? Do our steps handle this situation correctly?

Solution. Try $12345 + 678$. Step 1 aligns the digits from the right, so $678$ sits under the last three digits of $12345$:

$$\begin{array}{r} 12345 \\ +\phantom{00}678 \\ \hline \end{array}$$

The units, tens and hundreds columns each have two digits. The thousands and ten-thousands columns have only one digit each, because $678$ has run out.

  • Units: $5 + 8 = 13$, write $3$, carry $1$.
  • Tens: $4 + 7 + 1 = 12$, write $2$, carry $1$.
  • Hundreds: $3 + 6 + 1 = 10$, write $0$, carry $1$ (the “exactly $10$” case again).
  • Thousands: only the digit $2$ is present, and the carry is $1$.

Here the steps are silent. Step 3 says to add “the two digits and the current carry”, but there is only one digit. Step 4 says to repeat “until there are no more digits on the left”, which suggests carrying on, but never says what to put in the empty place.

The sensible reading is that an empty place counts as the digit $0$, which is exactly what a leading zero would be: $678 = 00678$. With that reading:

  • Thousands: $2 + 0 + 1 = 3$, write $3$, carry $0$.
  • Ten-thousands: $1 + 0 + 0 = 1$, write $1$, carry $0$.

The bottom row is $13023$, and $12345 + 678 = 13023$. The same reading handles a carry that travels a long way, as in $99999 + 101$, where every column beyond the first two generates a carry and the answer is $100100$.

So the steps handle it correctly if the missing digits are taken as $0$. The algorithm as printed assumes the two numbers have the same length and does not say what to do otherwise, which is a gap in the description, not in the method.

The algorithm works, provided an empty place is read as $0$. For $12345 + 678$ the extra columns on the left just receive the carry: the result is $13023$, which is correct.

The printed steps do not say this, so the unequal-length case has to be added to them: “if one number has no digit in a column, use $0$”.

Question 3

Why is it important to align the columns from right to left?

Solution. Every digit of a number is worth a different amount depending on its place: in $473$ the $4$ means four hundreds, the $7$ seven tens and the $3$ three units. Adding is only meaningful between digits that are worth the same, units with units, tens with tens. Aligning from the right is what puts equal place values in the same column.

The right-hand edge is the right choice because the units place is always the last digit, whatever the length of the number. The left-hand edge is not fixed in the same way: a $3$-digit number and a $5$-digit number start in different places.

Test it with $473 + 52$. Aligned from the right, the $2$ is under the $3$ and the $5$ under the $7$:

$$473 + 52 = 525.$$

Aligned from the left by mistake, the $5$ falls under the $4$ and the $2$ under the $7$, so the $52$ is effectively read as $520$, and the sum comes out as $473 + 520 = 993$. That is wrong by $468$.

There is a second reason for working from the right. A carry always moves to the left: ten units become one ten, ten tens become one hundred. So the result of a column is needed before the next column on its left can be finished. Starting at the right is the only order in which every column has its carry ready when it is needed.

Aligning from the right puts digits of equal place value, units with units and tens with tens, into the same column, and only equal place values may be added directly. The units place is the one fixed end of every number.

Misaligning goes wrong at once: $473 + 52$ should be $525$ but left-aligned gives $993$. Working right to left also means each carry is ready before the next column needs it.

Question 4

In Step 3, why cannot the value of carry be more than $1$?

Solution. The carry is the tens part of a column total, so it can be as large as the column total allows. Find the biggest total a column can ever have.

A column in Step 3 adds three things: two digits and the carry coming in. Each digit is at most $9$. We shall show that the incoming carry is at most $1$, and the argument is a short induction.

  • First column (Step 2). There is no carry yet, so the total is at most $9 + 9 = 18$. A total of $18$ or less is smaller than $20$, so the tens part is $0$ or $1$: the carry is $0$ or $1$.
  • Every later column (Step 3). Suppose the carry coming in is $0$ or $1$. Then the total is at most $$9 + 9 + 1 = 19.$$ Again this is less than $20$, so its tens part is $0$ or $1$ and the carry going out is $0$ or $1$.

Each column therefore passes on a carry of $0$ or $1$ to the next, and the first column starts correctly. Hence the carry is never more than $1$ at any stage.

A carry of $2$ would need a column total of at least $20$, and with digits capped at $9$ that is out of reach. Running through all $10 \times 10 \times 2$ choices of two digits and a carry confirms that $19$ is the largest total possible.

The largest total a column can have is $9 + 9 + 1 = 19$, which is less than $20$, so its tens part is at most $1$.

This holds in every column: the first has no carry in and totals at most $18$, so it passes on $0$ or $1$; if the carry in is $0$ or $1$, the next total is at most $19$ and so passes on $0$ or $1$ again.

Question 5

What happens if we do not include the fifth step in the algorithm above? Give examples where the algorithm will work correctly and where it will fail to work.

Solution. Step 5 handles the carry left over after the last column. Without it, that carry is simply thrown away. So the algorithm goes wrong exactly when the last column (the leftmost one) produces a carry of $1$, and is fine otherwise.

Examples where it works without Step 5. The leftmost column gives a carry of $0$, so nothing is lost.

  • $1234 + 4321$: the columns give $5, 5, 5, 5$ with no carries at all, so the answer is $5555$.
  • $4768 + 3457$ from Question 1: the leftmost column is $4 + 3 + 1 = 8$, a carry of $0$, so the answer $8225$ comes out correctly.

Examples where it fails. The leftmost column makes a carry of $1$, so the true answer has one more digit than the numbers added.

  • $5000 + 7000$: the first three columns give $0$, and the thousands column gives $5 + 7 = 12$, so we write $2$ and carry $1$. Without Step 5 the carry disappears and the bottom row reads $2000$, instead of $12000$. The answer is wrong by $10000$, which is exactly the value of the lost carry.
  • $473 + 695$, the book’s own example: the tens column gives $16$, so we write $6$ and carry $1$; the hundreds column gives $4 + 6 + 1 = 11$, so we write $1$ and carry $1$. Without Step 5 the answer reads $168$ instead of $1168$.

In every failure the answer lacks its leading $1$. The rule is simple: the algorithm needs Step 5 precisely when the sum has more digits than the longer addend.

Without Step 5 the carry out of the leftmost column is lost. The algorithm still works whenever that carry is $0$, for example $1234 + 4321 = 5555$ and $4768 + 3457 = 8225$.

It fails whenever the sum has an extra digit: $5000 + 7000$ would read $2000$ instead of $12000$, and $473 + 695$ would read $168$ instead of $1168$.

Common mistakes

  • Question 1, treating a column total of exactly $10$ as “no carry”. A total of $10$ is a units digit of $0$ with a carry of $1$; the printed wording (“more than $10$”) leaves the case out, and a student who follows it literally leaves a column blank.
  • Question 2, aligning from the left. A $3$-digit number added to a $5$-digit one goes under the last three digits, not the first three. The mistake adds the short number shifted two places too far left, so the total is wrong by a large, avoidable amount.
  • Question 2, forgetting the carry in the empty columns. The columns beyond the shorter number still have to be processed, because a carry can pass through them, as in $99999 + 101$.
  • Question 3, giving “because that is the rule” as the answer. The reason is place value: only digits worth the same may be added together.
  • Question 4, saying the carry is at most $1$ because $9 + 9 = 18$. That covers the first column only. In later columns there is a carry coming in as well, and the real maximum is $9 + 9 + 1 = 19$; the argument needs both.
  • Question 5, saying Step 5 is “just for neatness”. It is for correctness: without it $5000 + 7000$ gives $2000$, wrong by the value of the carry that was dropped.

Practise next

  • Think and Reflect, Question 1 of this chapter — asks you to finish the argument that grouping by units, tens and hundreds really is why the algorithm works, which is the proof behind Questions 3 to 5 above.
  • Exercise Set 11.2 — moves from adding to finding the greatest common divisor, where the same habit of asking “which input would break this step?” is used on lists of divisors.
Keep track of what you have finished — create a free account.

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.

Ask your doubt

Stuck on this question? Ask Shiwam directly.

A free account lets you post a doubt on any question, keep track of the exercises you have finished, and come back to the answer later.

Create a free accountI already have one