NCERT Solutions for Class 9 Maths Chapter 11: The World of Algorithms

9NCERT Ganita Manjari · solved

This chapter explains what an algorithm is: a precise, step-by-step procedure that always reaches the answer. Using column addition and the greatest common divisor (gcd) as examples, we learn to write algorithms with lists and named values, to justify why they work, and to compare how fast they are, ending with Euclid's subtraction method and Āryabhaṭa's division method for the gcd.

NCERT Ganita Manjari, reprint 2026-27 · Checked on · 24 questions and parts

Download PDF

Exercise Set 11.1 (page 38)

  1. 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?

    Show solution
    1. Sample: 4768 + 3594. Step 1: write 3594 below 4768 with the units digits aligned
    2. Step 2: 8 + 4 = 12, more than 10: write 2, carry = 1
    3. Step 3: 6 + 9 + 1 = 16: write 6, carry = 1
    4. Step 4 (repeat Step 3): 7 + 5 + 1 = 13: write 3, carry = 1; then 4 + 3 + 1 = 8, less than 10: write 8, carry = 0
    5. Step 5: carry is 0, so nothing more is written. Result: 8362. Check: 4768 + 3594 = 8362 ✓
    6. Note: the printed steps say 'less than 10' and 'more than 10', so a column sum of exactly 10 (e.g. 5 + 5) is not covered; it should read '10 or more', as the text before the algorithm says

    Answer: Yes, e.g. 4768 + 3594 = 8362. (The second case in Steps 2 and 3 should be 'equal to or more than 10', otherwise a column sum of exactly 10 is not handled.)

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

    Show solution
    1. Sample: 45678 + 789. The first three columns work: 8 + 9 = 17 (write 7, carry 1), 7 + 8 + 1 = 16 (write 6, carry 1), 6 + 7 + 1 = 14 (write 4, carry 1)
    2. In the fourth column Step 3 says 'add the two digits', but the lower number has no digit there
    3. The steps do not say what to do, so strictly they do not handle this case
    4. Fix: treat a missing digit as 0 (write 789 as 00789). Then 5 + 0 + 1 = 6 (carry 0) and 4 + 0 + 0 = 4
    5. Result 46467. Check: 45678 + 789 = 46467 ✓

    Answer: Not exactly: Step 3 assumes both numbers have a digit in every column. If we fill the missing places with 0s, the steps work (45678 + 789 = 46467).

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

    Show solution
    1. The rightmost digit of every number is its units digit, the next is tens, and so on
    2. Aligning from the right puts units under units, tens under tens, hundreds under hundreds
    3. Only digits of the same place value can be added together
    4. Example: aligning 473 and 25 from the left would add 2 tens to 4 hundreds and give a wrong answer; 473 + 25 = 498

    Answer: So that digits of the same place value (units, tens, hundreds, …) are added together.

  4. Question 4. In Step 3, why cannot the value of carry be more than 1?

    Show solution
    1. In the first column the largest sum is 9 + 9 = 18, so the carry is 0 or 1
    2. In any later column the largest sum is 9 + 9 + 1 = 19, which is less than 20
    3. So the sum always has a tens digit of 0 or 1, and the carry stays 0 or 1

    Answer: Because the largest possible column sum is 9 + 9 + 1 = 19, which is less than 20.

  5. 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.

    Show solution
    1. Step 5 writes the last carry as a new leftmost digit
    2. Without it, the algorithm works whenever the leftmost column adds to less than 10: e.g. 234 + 512 = 746 ✓
    3. It fails whenever the leftmost column gives a carry: e.g. 473 + 695 would give 168 instead of 1168
    4. Another failure: 95 + 7 would give 02 instead of 102

    Answer: The final carry would be lost. It still works when the last column sum is below 10 (234 + 512 = 746) but fails otherwise (473 + 695 would wrongly give 168, not 1168).

Think and Reflect (page 39)

  1. Question 1. See if you can complete the argument about grouping by units, tens, hundreds, … to justify why the addition algorithm works.

    Show solution
    1. Write each number as groups: 473 = 4 hundreds + 7 tens + 3 units; 695 = 6 hundreds + 9 tens + 5 units
    2. Adding group by group: 3 + 5 = 8 units; 7 + 9 = 16 tens; 4 + 6 = 10 hundreds
    3. 16 tens = 1 hundred + 6 tens: the new hundred is carried to the hundreds group, which becomes 11 hundreds
    4. 11 hundreds = 1 thousand + 1 hundred: carry 1 thousand
    5. Total = 1 thousand + 1 hundred + 6 tens + 8 units = 1168
    6. In general each column adds groups of the same size; since 10 groups of one size make 1 group of the next size, a column total of 10 or more sends a carry of 1 to the left

    Answer: Each column adds groups of equal size (units, tens, hundreds, …); whenever a column gets 10 or more, ten of those groups form one group of the next place, which is exactly the carry. So the digit-by-digit sum equals the true total.

  2. Question 2. How would you modify the algorithm to add two decimal fractions?

    Show solution
    1. Step 1 changes: write the numbers so that the decimal points are one below the other (this puts tenths under tenths, hundredths under hundredths)
    2. If one number has fewer decimal places, fill the empty places on the right with 0s
    3. Add from the rightmost column exactly as before, with carries
    4. Put the decimal point in the answer directly below the other decimal points
    5. Example: 12.75 + 3.6 → 12.75 + 03.60 = 16.35

    Answer: Align the decimal points (not the rightmost digits), pad with zeros, add column by column with carries as before, and place the decimal point below the others.

Think and Reflect (page 41)

  1. Question 1. 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?

    Show solution
    1. 15: check j = 1, 2, …, 15; divisors(15) = [1, 3, 5, 15] (15 checks)
    2. 135: check j = 1 to 135; divisors(135) = [1, 3, 5, 9, 15, 27, 45, 135] (135 checks)
    3. 775: check j = 1 to 775; divisors(775) = [1, 5, 25, 31, 155, 775] (775 checks)
    4. The number of checks equals the number itself, so the work grows in proportion to the size of the number: 775 needs about 50 times as many checks as 15

    Answer: divisors(15) = [1, 3, 5, 15], divisors(135) = [1, 3, 5, 9, 15, 27, 45, 135], divisors(775) = [1, 5, 25, 31, 155, 775]; the work grows in proportion to the number (n checks for n).

Exercise Set 11.2 (page 43)

  1. Question 1. 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.

    Show solution
    1. 1. Start with an empty list only-in-1
    2. 2. For each number x in List 1: if x does not appear in List 2, add x to the end of only-in-1
    3. 3. Report only-in-1 (it is in increasing order, because List 1 is)
    4. Example: List 1 = divisors(375), List 2 = divisors(825) gives only-in-1 = [125, 375]

    Answer: Start with an empty list; for each x in List 1, add x if it is not in List 2; report the list.

    (ii) Write an algorithm to find elements in List 2 that are not present in List 1.

    Show solution
    1. 1. Start with an empty list only-in-2
    2. 2. For each number y in List 2: if y does not appear in List 1, add y to the end of only-in-2
    3. 3. Report only-in-2
    4. Example: with the same lists, only-in-2 = [11, 33, 55, 165, 275, 825]

    Answer: The same algorithm with the roles of the lists swapped: for each y in List 2, add y if it is not in List 1.

  2. Question 2. Describe an algorithm to compute the least common multiple (lcm) of two numbers.

    Show solution
    1. Algorithm to find lcm(m, n):
    2. 1. For each j in the sequence 1, 2, 3, …, n: if j × m is divisible by n, report j × m as lcm(m, n) and stop
    3. It always stops by j = n, because n × m is divisible by n; the first multiple of m that n divides is the least common multiple
    4. Example lcm(6, 8): 6 (no), 12 (no), 18 (no), 24 (yes) → 24
    5. Another way: lcm(m, n) = m × n ÷ gcd(m, n); check 6 × 8 ÷ 2 = 24 ✓

    Answer: Go through the multiples m, 2m, 3m, … and report the first one that is divisible by n (or compute m × n ÷ gcd(m, n)).

  3. Question 3. 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 n to find all the divisors of n?

    Show solution
    1. Each pair is (j, n ÷ j); the smaller number of a pair satisfies j × j ≤ n, i.e. j ≤ √n
    2. So we only check j = 1, 2, …, up to √n; each j that divides n gives the pair (j, n ÷ j)
    3. Example n = 18: √18 ≈ 4.2, so check 1, 2, 3, 4 and get (1, 18), (2, 9), (3, 6)

    Answer: Only the numbers from 1 to √n (about √n numbers instead of n).

    (ii) If we list out the divisors in pairs, will our gcd algorithm still work in the manner we have described?

    Show solution
    1. Listing by pairs gives lists that are not in increasing order: divisors(18) = [1, 18, 2, 9, 3, 6], divisors(9) = [1, 9, 3]
    2. Common divisors, scanning the first list: [1, 9, 3]; its rightmost element is 3
    3. But gcd(18, 9) = 9, so 'report the rightmost element' gives a wrong answer
    4. Fix: report the largest element of the common-divisors list, or sort the lists first

    Answer: Not as described: the lists are no longer in increasing order, so the rightmost common divisor need not be the gcd (e.g. it gives 3 for gcd(18, 9) = 9). We must pick the largest common divisor instead.

Exercise Set 11.3 (page 45)

  1. Question 1. How would our original algorithm change if we computed the divisors of n by examining the numbers from 1 to n in reverse order, from n down to 1?

    Show solution
    1. The lists of divisors would be in decreasing order, e.g. divisors(18) = [18, 9, 6, 3, 2, 1]
    2. The list of common divisors would also be decreasing, e.g. for 375 and 825: [75, 25, 15, 5, 3, 1]
    3. So the gcd is now the leftmost (first) element, and the rightmost element is always 1
    4. Step 5 must change to: report the leftmost element of common-divisors as gcd(m, n)

    Answer: The lists would be in decreasing order, so the gcd would be the first (leftmost) element of common-divisors; the last step must be changed accordingly.

  2. Question 2. What about the last algorithm described above? What happens when we look at common divisors starting from min(m, n) and work backwards to 1?

    Show solution
    1. Going down from min(m, n), the first k that divides both m and n is the largest common divisor
    2. So we can stop at once and report that k as the gcd; there is no need for most-recent-common-divisor
    3. (If we kept scanning and updating, we would end with 1, which is wrong, so the algorithm must stop at the first common divisor)
    4. Example gcd(6, 12): start at k = 6, which divides both, so gcd = 6 after one check
    5. It saves time when the gcd is large, but when the gcd is 1 we still check every number down to 1

    Answer: The first common divisor found is the gcd, so we stop there; this is faster when the gcd is large but no faster in the worst case (gcd = 1).

End-of-Chapter Exercises (page 50)

  1. Question 1. Compute the following using the improved version of Euclid's algorithm.

    (i) gcd(375, 825)

    Show solution
    1. 375 < 825, so compute gcd(825, 375)
    2. 825 = 2 × 375 + 75 → gcd(375, 75)
    3. 375 = 5 × 75 + 0 → gcd(75, 0) = 75

    Answer: gcd(375, 825) = 75

    (ii) gcd(51000, 81000)

    Show solution
    1. Reverse: gcd(81000, 51000)
    2. 81000 = 1 × 51000 + 30000 → gcd(51000, 30000)
    3. 51000 = 1 × 30000 + 21000 → gcd(30000, 21000)
    4. 30000 = 1 × 21000 + 9000 → gcd(21000, 9000)
    5. 21000 = 2 × 9000 + 3000 → gcd(9000, 3000)
    6. 9000 = 3 × 3000 + 0 → gcd(3000, 0) = 3000

    Answer: gcd(51000, 81000) = 3000

    (iii) gcd(1789287, 237656)

    Show solution
    1. 1789287 = 7 × 237656 + 125695
    2. 237656 = 1 × 125695 + 111961
    3. 125695 = 1 × 111961 + 13734
    4. 111961 = 8 × 13734 + 2089
    5. 13734 = 6 × 2089 + 1200
    6. 2089 = 1 × 1200 + 889; 1200 = 1 × 889 + 311; 889 = 2 × 311 + 267
    7. 311 = 1 × 267 + 44; 267 = 6 × 44 + 3; 44 = 14 × 3 + 2
    8. 3 = 1 × 2 + 1; 2 = 2 × 1 + 0 → gcd(1, 0) = 1

    Answer: gcd(1789287, 237656) = 1 (the numbers are coprime).

    (iv) gcd(2587392, 157656)

    Show solution
    1. 2587392 = 16 × 157656 + 64896
    2. 157656 = 2 × 64896 + 27864
    3. 64896 = 2 × 27864 + 9168
    4. 27864 = 3 × 9168 + 360
    5. 9168 = 25 × 360 + 168
    6. 360 = 2 × 168 + 24
    7. 168 = 7 × 24 + 0 → gcd(24, 0) = 24

    Answer: gcd(2587392, 157656) = 24

  2. Question 2. Assume that m ≥ n. Verify that d divides m and n if and only if d divides both n and m mod n.

    Show solution
    1. Divide m by n: m = qn + r, where r = m mod n and 0 ≤ r < n
    2. Suppose d divides m and n: m = ad, n = bd. Then r = m − qn = ad − qbd = (a − qb)d, so d divides r
    3. Conversely, suppose d divides n and r: n = bd, r = cd. Then m = qn + r = qbd + cd = (qb + c)d, so d divides m
    4. So the common divisors of (m, n) and of (n, m mod n) are exactly the same; hence gcd(m, n) = gcd(n, m mod n)
    5. Example: m = 33, n = 7, m mod n = 5; 33 = 4 × 7 + 5, and both pairs have only the common divisor 1

    Answer: Since m = qn + (m mod n), any number dividing m and n divides m mod n = m − qn, and any number dividing n and m mod n divides m. So the two pairs have the same common divisors.

  3. Question 3. Write an algorithm prime(n) to check if n is prime. (Hint: A prime number p has exactly two distinct factors, 1 and p. Can you make use of divisors(n) to write out prime(n)?)

    Show solution
    1. Algorithm prime(n):
    2. 1. Let list-of-divisors be the list obtained by computing divisors(n)
    3. 2. If list-of-divisors has exactly 2 elements, report 'n is prime'
    4. 3. Otherwise, report 'n is not prime'
    5. Examples: divisors(13) = [1, 13] → prime; divisors(15) = [1, 3, 5, 15] → not prime; divisors(1) = [1] → not prime

    Answer: Compute divisors(n); n is prime exactly when this list has 2 elements (1 and n).

  4. Question 4. Write an algorithm primedivisors(n) to compute the list of divisors of n that are prime numbers. (Hint: Compute divisors(n) and then filter out the primes in this list.)

    Show solution
    1. Algorithm primedivisors(n):
    2. 1. Let list-of-divisors be divisors(n)
    3. 2. Start with an empty list prime-divisors
    4. 3. For each number d in list-of-divisors: if prime(d) reports 'prime', add d to prime-divisors
    5. 4. Report prime-divisors
    6. Example n = 60: divisors [1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60] → prime-divisors = [2, 3, 5]

    Answer: Compute divisors(n) and keep only those d for which prime(d) is true; e.g. primedivisors(60) = [2, 3, 5].

  5. Question 5. 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 2² × 3² × 5¹. How would you represent this?

    Show solution
    1. Algorithm factorise(n): set x = n and start with an empty list factors
    2. For each p in primedivisors(n): set count = 0; while p divides x, divide x by p and add 1 to count; add the pair (p, count) to factors
    3. Report factors
    4. For 180: primedivisors = [2, 3, 5]; 180 → 90 → 45 (2 twice), 45 → 15 → 5 (3 twice), 5 → 1 (5 once)
    5. Represent it as a list of (prime, power) pairs in increasing order of the primes

    Answer: As the list of pairs [(2, 2), (3, 2), (5, 1)].

    (ii) How would you compare the prime factorisations of two numbers?

    Show solution
    1. Go through the primes that appear in both lists
    2. For each such prime take the smaller of its two powers; primes in only one list are left out
    3. gcd = product of these primes raised to the smaller powers (for the lcm, use every prime with the larger power)
    4. Example: 180 = [(2, 2), (3, 2), (5, 1)], 168 = [(2, 3), (3, 1), (7, 1)]
    5. Common primes 2 and 3: 2^min(2,3) × 3^min(2,1) = 2² × 3 = 12; check gcd(180, 168) = 12 ✓

    Answer: Match the common primes and take the smaller power of each; their product is the gcd (e.g. gcd(180, 168) = 2² × 3 = 12).

Key points of The World of Algorithms (quick revision)

  • An algorithm is a systematic, step-by-step procedure built from basic steps we already know how to do.
  • Column addition works because we add units with units, tens with tens, and so on; every 10 of one place becomes a carry of 1 to the next place.
  • Steps may repeat ('for each j from 1 to n') or depend on a condition ('if j divides n, add j to the list').
  • A list such as [1, 2, 3, 6, 9, 18] is a data structure; giving names to such values (list-of-divisors, j) makes an algorithm clear.
  • First gcd algorithm: list the divisors of both numbers, keep the common ones, report the largest. Its work grows with the size of the numbers.
  • Euclid's rule: for m ≥ n, gcd(m, n) = gcd(n, m − n); and gcd(m, 0) = m.
  • Āryabhaṭa's division (long division) method: gcd(m, n) = gcd(n, m mod n), where m mod n is the remainder of m ÷ n; it needs far fewer steps.
  • For every algorithm we must justify that it is correct and can count how many steps it takes (its efficiency).

How these solutions were checked

  • Every question of the NCERT Ganita Manjari reprint for 2026-27 is here, in the book's order and numbering.
  • Every answer is worked out in full, then checked by substituting it back or recomputing it (algebra and calculus answers are verified by differentiation or computer algebra).
  • Where the book has a misprint, or its printed answer differs from the correct one, the solution says so and shows why, so you can trust what you write in the exam.
  • Found something that looks wrong? Tell us about it, and we correct it and update this page and its PDF.

Questions

How many exercises are there in Class 9 Maths Chapter 11 The World of Algorithms?

6 (Exercise Set 11.1 (page 38), Think and Reflect (page 39), Think and Reflect (page 41), Exercise Set 11.2 (page 43), Exercise Set 11.3 (page 45), End-of-Chapter Exercises (page 50)), with 24 questions and parts in all. Every one is solved on this page.

Can I download the Class 9 Maths Chapter 11 The World of Algorithms NCERT solutions as a PDF?

Yes. The PDF has every question and its solution, free to download and print, with no sign-in.

Questions are from the NCERT textbook Ganita Manjari for Class 9; the solutions are written by beMahan.All Class 9 NCERT solutions