Opening your dashboard
Class 9 Maths Chapter 11: The World of Algorithms Solutions
15 textbook questions with step-by-step answers, free to read, for CBSE 2026-27.
Get talked through Ch 11, not just shown the answer
Reading a finished solution is not the same as being able to do it. The AI tutor takes one question at a time and works it with you, in your own words, until you can.
- Ask it out loud, in your own words
- It gives you the next step, not the answer
- Stuck on part (ii)? Start there
15 questions with solutions
2–5 marks · Mixed difficulty
The first 12 solutions are on this page. This chapter is a long one, so the rest open on their own page to keep this one quick to load.
- 13 marks
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?
Solve with AIWritten solution
Take the two 4-digit numbers 4738 and 2596.
Step 1: Write the numbers one below the other with the digits aligned from right to left.
Steps 2 to 4: Add the columns from right to left, one at a time, using the carry.
The working, column by column:
Column Digits Carry in Sum Write Carry out units 8 + 6 0 14 4 1 tens 3 + 9 1 13 3 1 hundreds 7 + 5 1 13 3 1 thousands 4 + 2 1 7 7 0 Step 2 (units): , which is more than 10, so write 4 and set carry to 1.
Step 3 (tens): , more than 10, so write 3 and set carry to 1.
Step 4 repeats Step 3 (hundreds): , write 3, carry 1.
Step 4 repeats Step 3 (thousands): , less than 10, write 7, carry 0. There are no more digits on the left.
Step 5: The carry is 0, so nothing more is written.
So , which is correct.
But the steps do not always work when followed literally. Step 2 and Step 3 only say what to do when the sum is less than 10 or more than 10. They say nothing about a sum of exactly 10. Try 3347 + 2729:
Units: , write 6, carry 1. Tens: , write 7, carry 0. Hundreds: . The sum is neither less than 10 nor more than 10, so the steps tell us neither what to write nor what carry to set. Following them precisely, we are stuck.
If we read "more than 10" as "10 or more" (as the text before the algorithm says: carry when the total is equal to or more than 10), we write 0, carry 1, and then thousands: , giving , which is correct.
Conclusion: For numbers where no column adds up to exactly 10, the steps give the correct result. To work for all numbers, the second case in Steps 2 and 3 should read "If the sum is 10 or more".
- 23 marks
Question 2
What happens if you add a 5-digit number to a 3-digit number. Do our steps handle this situation correctly?
Solve with AIWritten solution
Take 48765 + 734. Aligned from right to left, the 3-digit number has no digits in the thousands and ten thousands columns.
Column Digits Carry in Sum Write Carry out units 5 + 4 0 9 9 0 tens 6 + 3 0 9 9 0 hundreds 7 + 7 0 14 4 1 thousands 8 + (no digit) 1 9 9 0 ten thousands 4 + (no digit) 0 4 4 0 Units: , write 9, carry 0. Tens: , write 9, carry 0. Hundreds: , write 4, carry 1.
Thousands: Step 3 says "add the two digits and the current value of carry", but there is only one digit, 8. We must treat the missing digit as 0: , write 9, carry 0.
Ten thousands: again only one digit, , write 4.
So , which is correct.
Do the steps handle this correctly? Only if we make an assumption the steps do not state. Step 3 speaks of "the two digits", and Step 4 says to repeat "until there are no more digits on the left", which does not make clear whether it means no more digits in either number or in both. If we stopped when the shorter number ran out, we would get only 499, which is wrong; and we would also have no rule for a carry going into a column that has just one digit.
The steps work correctly if we add the rule: if one number has no digit in a column, take that digit to be 0 (equivalently, write 734 as 00734), and repeat Step 3 until both numbers have no more digits on the left.
- 32 marks
Question 3
Why is it important to align the columns from right to left?
Solve with AIWritten solution
The algorithm adds digits that have the same place value: units with units, tens with tens, hundreds with hundreds, and so on. In the Indian place-value system the rightmost digit of every number is its units digit, so aligning from the right puts digits of equal place value in the same column.
Numbers with different numbers of digits do not start with the same place value. If we align from the left, we add digits of different place values. For example, aligning 473 and 2695 from the left puts the 4 hundreds of 473 under the 2 thousands of 2695:
This actually adds , but the correct sum is .
Aligning from the right also makes sense of the carry: a carry from one column is a group of ten, and it must go into the column that is worth ten times as much, which is the next column to the left. So the columns must be aligned from right to left, and added from right to left.
- 42 marks
Question 4
In Step 3, why cannot the value of carry be more than 1?
Solve with AIWritten solution
Each digit is at most 9.
In Step 2 (the units column) there is no carry yet, so the largest possible sum is . This is less than 20, so the carry set in Step 2 is 0 or 1.
In Step 3 we add two digits and a carry of at most 1, so the largest possible sum is
which is also less than 20. So the sum has a units digit and at most one ten, and the new carry is again 0 or 1.
Since every column starts with a carry of at most 1 and produces a carry of at most 1, the carry can never be more than 1 at any column. (For example, : every column gives or , and every carry is 1.)
- 53 marks
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.
Solve with AIWritten solution
Step 5 writes the final carry. Without it, a carry of 1 coming out of the leftmost column would simply be lost, and the answer would be short by one digit.
The algorithm still works whenever the leftmost column adds up to less than 10, so the final carry is 0. For example, : units , tens , hundreds , final carry 0, giving 688. This is correct, and Step 5 was not needed.
The algorithm fails whenever the leftmost column produces a carry. For example, : units , carry 0; tens , write 6, carry 1; hundreds , write 1, carry 1. Without Step 5 the bottom row reads 168, but the correct sum is 1168. Similarly, would give 2 instead of 12, and would give 1000 instead of 11000.
So without Step 5 the algorithm is correct only when the sum has the same number of digits as the longer number.
- 64 marks
Question 6
Suppose List 1 and List 2 are two lists of numbers in increasing order.
(i) Write an algorithm to find elements in List 1 that are not present in List 2.
(ii) Write an algorithm to find elements in List 2 that are not present in List 1.
Solve with AIWritten solution
(i) A simple algorithm, in the style of the gcd algorithm:
-
Start with an empty list only-in-1.
-
For each number in List 1: if does not appear in List 2, add to only-in-1.
-
Report only-in-1.
Because both lists are in increasing order, we can do better and go through each list only once, keeping a position in each list:
-
Start with an empty list only-in-1. Let be the first element of List 1 and the first element of List 2.
-
If List 2 is finished, add and all the remaining elements of List 1 to only-in-1, and go to Step 6.
-
If : cannot appear later in List 2 (the later elements are even larger), so add to only-in-1 and move to the next element of List 1.
-
If : is present in List 2, so move to the next element of List 1 and to the next element of List 2.
-
If : move to the next element of List 2.
After doing whichever one of Steps 3, 4 and 5 applies, repeat from Step 2 until List 1 is finished.
-
Report only-in-1.
Example. List 1 (the divisors of 375) and List 2 (the divisors of 825).
- : 1 is in both lists; move on in both lists.
- : 3 is in both lists; move on in both lists.
- : 5 is in both lists; move on in both lists.
- : move on in List 2.
- : 15 is in both lists; move on in both lists.
- : 25 is in both lists; move on in both lists.
- : move on in List 2.
- : move on in List 2.
- : 75 is in both lists; move on in both lists.
- : 125 cannot be in List 2, so add 125 to the result.
- : move on in List 2.
- : move on in List 2.
- : 375 cannot be in List 2, so add 375 to the result.
Result: elements of List 1 not in List 2 .
(ii) This is the same algorithm with the roles of the two lists exchanged:
-
Start with an empty list only-in-2. Let be the first element of List 2 and the first element of List 1.
-
If List 1 is finished, add and all the remaining elements of List 2 to only-in-2, and go to Step 6.
-
If : add to only-in-2 and move to the next element of List 2.
-
If : move both and to the next elements of their lists.
-
If : move to the next element of List 1.
After doing whichever one of Steps 3, 4 and 5 applies, repeat from Step 2 until List 2 is finished.
-
Report only-in-2.
With the same two lists (now scanning List 2 against List 1):
- : 1 is in both lists; move on in both lists.
- : 3 is in both lists; move on in both lists.
- : 5 is in both lists; move on in both lists.
- : 11 cannot be in List 1, so add 11 to the result.
- : 15 is in both lists; move on in both lists.
- : 25 is in both lists; move on in both lists.
- : 33 cannot be in List 1, so add 33 to the result.
- : 55 cannot be in List 1, so add 55 to the result.
- : 75 is in both lists; move on in both lists.
- : move on in List 1.
- : 165 cannot be in List 1, so add 165 to the result.
- : 275 cannot be in List 1, so add 275 to the result.
- : move on in List 1.
- List 1 is finished, so 825 is added to the result.
Result: elements of List 2 not in List 1 .
Each step moves forward in at least one list, so the scan takes at most (length of List 1 + length of List 2) comparisons, instead of searching the whole of List 2 for every element of List 1.
-
- 73 marks
Question 7
Describe an algorithm to compute the least common multiple (lcm) of two numbers.
Solve with AIWritten solution
The lcm of and is the smallest number that is a multiple of both. The multiples of are , so we check them in increasing order and stop at the first one that divides.
Algorithm to find lcm(m, n)
-
Set to 1.
-
If divides , report as lcm(m, n) and stop.
-
Otherwise, increase by 1 and repeat Step 2.
The algorithm always stops: when , the number is a multiple of both, so we never go beyond . Since we check the multiples of in increasing order, the first common multiple we meet is the least one. (It is quicker to take as the larger of the two numbers, so fewer multiples are checked.)
Example 1: lcm(18, 12), with , .
-
: 18; 12 does not divide 18.
-
: 36; 12 divides 36. Report lcm(18, 12) = 36.
Example 2: lcm(825, 375), with , . The multiples of 825 are 825, 1650, 2475, 3300, 4125. 375 does not divide the first four, but . So lcm(825, 375) = 4125.
Another way, using a gcd algorithm from this chapter: compute and report . For example, , so
which agrees with Example 2.
-
- 84 marks
Question 8
(Challenge) Divisors occur in pairs. For instance, the divisors of 18 are (1, 18), (2, 9) and (3, 6).
(i) If we write out divisors in pairs, how many numbers do we have to examine between 1 and to find all the divisors of ?
(ii) If we list out the divisors in pairs, will our gcd algorithm still work in the manner we have described?
Solve with AIWritten solution
(i) If divides , then so does , and . In each pair, the smaller number satisfies (if both numbers of a pair were larger than this, their product would be more than ).
So we only need to examine the numbers while . Each time divides , we write down the pair . The number of values to examine is the largest whole number whose square is at most , that is, about , instead of .
For 18: but , so we examine only 1, 2, 3, 4 (4 numbers instead of 18) and get the pairs (1, 18), (2, 9), (3, 6). For 825 we examine 1 to 28 (since and ), 28 numbers instead of 825.
(When is a perfect square, one pair has two equal numbers, for example (6, 6) for 36, and we write that divisor only once.)
(ii) Not without a change. Our gcd algorithm reports the rightmost element of the list of common divisors, which is the gcd only because the lists of divisors are in increasing order. A list written in pairs is not in increasing order: for 18 it is [1, 18, 2, 9, 3, 6].
Try gcd(375, 825). Written in pairs,
divisors(375)
divisors(825)
Checking each divisor of 375 in turn against the second list gives the common divisors . The rightmost element is 25, but . So the algorithm, as described, gives a wrong answer.
To make it work, change the last step to "report the largest element of common-divisors" (scan the list keeping the largest so far), or first arrange the divisors in increasing order (write the smaller numbers of the pairs from left to right, then the larger numbers from right to left). With either change the answer is 75, and the algorithm is still correct.
- 93 marks
Question 9
How would our original algorithm change if we computed the divisors of by examining the numbers from 1 to in reverse order, from down to 1?
Solve with AIWritten solution
Examining still finds every divisor, but the list of divisors is now in decreasing order. For 825 it is .
If only divisors-of-n is reversed (divisors-of-m still in increasing order): Step 4 only asks whether each in divisors-of-m appears in divisors-of-n, which does not depend on order. The list common-divisors is built in the order of divisors-of-m, so it is still increasing. For gcd(375, 825) it is , and Step 5 (report the rightmost element) still gives 75. Nothing needs to change.
If we compute every list of divisors in reverse order (so divisors-of-m is reversed too), common-divisors comes out in decreasing order: for gcd(375, 825) it is . Now the gcd is the leftmost element, so Step 5 must change to "Report the leftmost (first) element of the list common-divisors as gcd(m, n)". Reporting the rightmost element would give 1, which is wrong.
This version has a bonus: the first common divisor we find is already the gcd, so in Step 4 we can stop as soon as we find one that appears in divisors-of-n; there is no need to build the whole list.
- 103 marks
Question 10
What about the last algorithm described above? What happens when we look at common divisors starting from and work backwards to 1?
Solve with AIWritten solution
In the last algorithm, most-recent-common-divisor is updated every time we find a common divisor. Scanning upwards, each new common divisor is larger, so the last one found is the gcd.
If we scan backwards, from down to 1, the common divisors appear in decreasing order. The first common divisor we meet is the greatest one, so it is the gcd. If we kept updating most-recent-common-divisor, it would be overwritten by smaller and smaller common divisors and end up as 1, which is wrong. So the algorithm changes to:
- For each from down to 1: if divides both and , report as gcd(m, n) and stop.
The scan always stops, at the latest when , because 1 divides every number. We do not even need the starting value 1 for most-recent-common-divisor.
Example 1: , . , and divides both 6 and 12, so after just 1 check (the upward scan needed 5 checks, to 6).
Example 2: gcd(375, 825). We check and the first dividing both is 75. That is checks, against checks for the upward scan from 2 to 375.
So working backwards gives the same answer and usually saves work, because we stop early. But in the worst case, when the gcd is 1, we still examine every number from down to 1; for example gcd(100, 99) takes 99 checks. The work still grows with the value of the numbers, not with the number of digits.
- 115 marks
Question 11
Compute the following using the improved version of Euclid's algorithm.
(i)
(ii)
(iii)
(iv)
Solve with AIWritten solution
The improved (division) version of Euclid's algorithm for :
-
If , reverse the numbers and compute .
-
If , report the answer as .
-
Otherwise, reduce the problem to computing , where is the remainder when is divided by .
(i)
Since , Step 1 reverses the numbers: compute .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
Since , Step 2 gives the answer .
Number of reductions: 2. So .
(ii)
Since , Step 1 reverses the numbers: compute .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
Since , Step 2 gives the answer .
Number of reductions: 5. So .
(iii)
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
Since , Step 2 gives the answer .
Number of reductions: 13. So .
(iv)
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
, so . Step 3 reduces the problem to .
Since , Step 2 gives the answer .
Number of reductions: 7. So .
Final answers: (i) 75, (ii) 3000, (iii) 1, (iv) 24. Note that (iii), with 7-digit numbers, needed only 13 reductions, while the subtraction version needed 7 reductions for the much smaller pair 375 and 825 in (i).
-
- 123 marks
Question 12
Assume that . Verify that divides and if and only if divides both and .
Solve with AIWritten solution
Divide by : let be the quotient and the remainder, so
(This is the same as subtracting from repeatedly, times.)
If divides and : write and for natural numbers , . Then
so divides (when this still holds, since ). And divides already. So divides both and .
If divides and : write and for whole numbers , . Then
so divides . And divides already. So divides both and .
In terms of tiles: if blocks of size tile and , then removing copies of from leaves , which is also tiled; and putting copies of back onto gives , which is tiled.
Check with numbers: , , , so . The common divisors of 60 and 16 are 1, 2, 4, and the common divisors of 16 and 12 are also 1, 2, 4. The two sets of common divisors are the same, so . This is exactly why the improved Euclid algorithm may replace by .
- 133 marks
Question 13
Write an algorithm to check if is prime.
(Hint: A prime number has exactly two distinct factors, 1 and . Can you make use of to write out ?)
- 143 marks
Question 14
(Challenge) Write an algorithm to compute the list of divisors of that are prime numbers.
(Hint: Compute and then filter out the primes in this list.)
- 154 marks
Question 15
(Challenge) We can also find the gcd of two numbers by computing prime factorisation of both the numbers. Try to write an algorithm to compute the prime factorisation of a number.
(i) The prime factorisation of 180 is . How would you represent this?
(ii) How would you compare the prime factorisations of two numbers?
What Class 9 Maths Ch 11 covers
The sections of the chapter, in the order the book takes them. Every question above comes from one of these.
- 01Adding Numbers
- 02Greatest Common Divisor
- 03Data Structures
More ways to study this chapter
The same chapter asked three other ways. Practise it, revise it, and see what the board has set on Ch 11 before.
Class 9 Maths Ch 11 questions students ask
How many questions are there in Class 9 Maths Ch 11?
15 questions. Every one is solved step by step on this page.
Are these Class 9 Maths solutions free?
Yes. Every question and its full working is free to read, with no account needed.
Can I download the Class 9 Maths Ch 11 solutions as a PDF?
There is no PDF to download. Every solution is on this page instead, which means it is searchable, always the current syllabus, and readable on a phone. Use your browser's print option if you want it on paper.
