Skip to content

Home/ NCERT Solutions for Class 9 Maths (Ganita Manjari)/ Class 9 Maths Ganita Manjari Chapter 11: The World of Algorithms Solutions

Class 9 Maths Ganita Manjari Chapter 11: The World of Algorithms Solutions

Ganita Manjari Class 9 Chapter 11: All Exercises Solutions

Step-by-step solutions for The World of Algorithms, written in the way examiners expect: given data, working, and a clear final answer.

  • Class 9
  • Maths
  • Ganita Manjari
  • 4 Exercises
  • 15 Questions
Exercise 11.1 · 5 Questions

Exercise 11.1: The column-addition algorithm

Testing the step-by-step algorithm for adding two numbers column by column, with a carry.

Key ideas before you start

  • Algorithm: a finite list of precise steps that always gives the correct result.
  • Column addition: add digits from right to left; if a column sum is 10 or more, write the units digit and carry 1 to the next column.
  • The last step writes down any carry left after the leftmost column.
Exercise 11.1 · Trying the algorithm

Exercise 11.1, Question 1: Add two 4-digit numbers by following the steps of the algorithm. Is the result correct?

Show step-by-step solution
ColumnUnitsTensHundredsThousands
2468 + 13578 + 7 = 15 → 5, carry 16 + 5 + 1 = 12 → 2, carry 14 + 3 + 1 = 82 + 1 = 3
2468 + 1357 = 3825, which is correct. The algorithm also gives 4586 + 3414 = 8000, provided the carry rule says “10 or more” (a column sum of exactly 10 must also carry).
Exercise 11.1 · Different lengths

Exercise 11.1, Question 2: What happens when a 5-digit number is added to a 3-digit number using the algorithm?

Show step-by-step solution

The shorter number has no digits in the thousands and ten-thousands columns. Treat those missing digits as 0.

12345 + 00321 = 12666
It works if the shorter number is padded with zeros on the left, so every column has two digits to add.
Exercise 11.1 · Alignment

Exercise 11.1, Question 3: Why must the numbers be aligned from the right?

Show step-by-step solution
Aligning from the right puts units under units, tens under tens, and so on. Only digits with the same place value can be added together.
Exercise 11.1 · Size of the carry

Exercise 11.1, Question 4: Why can the carry never be more than 1?

Show step-by-step solution
Largest column sum = 9 + 9 + 1 (carry) = 19
Any column sum is at most 19, so the carry to the next column is either 0 or 1.
Exercise 11.1 · The last step

Exercise 11.1, Question 5: What happens if the last step (writing down the final carry) is left out? Give an example where the answer is still right and one where it goes wrong.

Show step-by-step solution
ExampleWhat happensResult
1234 + 4321No carry out of the thousands column5555 (correct anyway)
9999 + 9999A carry of 1 is left after the last column9998 without the step; 19998 with it
Without the last step the algorithm fails whenever the leftmost column produces a carry.
Exercise 11.2 · 3 Questions

Exercise 11.2: Algorithms on lists; LCM and divisors

Designing algorithms that compare sorted lists, find the LCM, and list divisors efficiently.

Key ideas before you start

  • divisors(n): check each j from 1 to n and keep j if n mod j = 0.
  • Divisors come in pairs (j, nj), so it is enough to check j with j² ≤ n.
  • LCM: the smallest number that is a multiple of both numbers.
Exercise 11.2 · Comparing lists

Exercise 11.2, Question 1: List 1 and List 2 are in increasing order. Write an algorithm to find (i) the elements of List 1 that are not in List 2, (ii) the elements of List 2 that are not in List 1.

Show step-by-step solution

(i) Put a pointer at the start of each list. Repeat while List 1 has elements left:

  • If List 2 is finished, or the current element of List 1 is smaller than that of List 2: output it and move the List 1 pointer.
  • If the two elements are equal: move both pointers (it is common, so do not output it).
  • If the List 1 element is bigger: move the List 2 pointer.

(ii) Use the same algorithm with the roles of the two lists swapped.

Example: List 1 = [1, 2, 3, 6], List 2 = [1, 3, 5, 9] gives (i) [2, 6] and (ii) [5, 9].
Exercise 11.2 · LCM algorithm

Exercise 11.2, Question 2: Describe an algorithm to find the LCM of two numbers m and n.

Show step-by-step solution
  • List the multiples of m: m, 2m, 3m, …, nm.
  • List the multiples of n: n, 2n, …, mn.
  • Use the algorithm for common elements of two sorted lists; the first common element is the LCM.
Example: multiples of 4 are 4, 8, 12, … and of 6 are 6, 12, …; the first common one is 12 = lcm(4, 6). (Faster: lcm(m, n) = m × ngcd(m, n).)
Exercise 11.2 · Divisors in pairs

Exercise 11.2, Question 3: Divisors of n occur in pairs. (i) How many numbers between 1 and n must be checked to find all divisors? (ii) Does the GCD algorithm still work if the divisors are listed in pairs?

Show step-by-step solution

(i) If j divides n, so does nj, and one of the pair is at most √n. So we only need to check j = 1, 2, … while j² ≤ n, and write both j and nj.

(ii) The GCD algorithm takes the last common divisor, which works only if the lists are in increasing order. Listing in pairs breaks the order: for 12 and 18 the paired lists give common divisors [1, 2, 6, 3], and the last one is 3, not the GCD 6.

(i) Only about √n numbers (e.g. 1 to 4 for n = 18). (ii) Not as it is; the paired lists must be sorted first, or we must take the largest common divisor.
Exercise 11.3 · 2 Questions

Exercise 11.3: Improving the GCD algorithm

Changing the order in which divisors are checked to reach the GCD faster.

Key ideas before you start

  • The GCD is the largest common divisor, so searching from the top lets us stop at the first one found.
Exercise 11.3 · Checking downwards

Exercise 11.3, Question 1: How does the algorithm change if the divisors of n are checked from n down to 1?

Show step-by-step solution
The lists of divisors come out in decreasing order, so the GCD is the first (leftmost) common divisor instead of the last. Example: gcd(12, 18) = 6 appears first.
Exercise 11.3 · Stop early

Exercise 11.3, Question 2: What happens if common divisors are checked from min(m, n) down to 1?

Show step-by-step solution

Check d = min(m, n), min(m, n) − 1, … and stop at the first d that divides both m and n.

That first d is the GCD, and we do not need to list all divisors. For 12 and 18: 12 no, 11 no, …, 6 yes ⇒ gcd = 6.
End of Chapter · 5 Questions

End of Chapter: Euclid’s algorithm and primes

Using the improved Euclid’s algorithm and writing algorithms for primes and prime factorisation.

Key ideas before you start

  • Improved Euclid’s algorithm: gcd(m, n) = gcd(n, m mod n), repeated until the remainder is 0. The last non-zero divisor is the GCD.
  • Prime: a number n ≥ 2 with exactly two divisors, 1 and n.
End of Chapter · Euclid’s algorithm

End of Chapter, Question 1: Using the improved Euclid’s algorithm, find: (i) gcd(375, 825)   (ii) gcd(51000, 81000)   (iii) gcd(1789287, 237656)   (iv) gcd(2587392, 157656)

Show step-by-step solution

(i)

825 = 2 × 375 + 75;   375 = 5 × 75 + 0 ⇒ gcd = 75

(ii)

81000 = 1 × 51000 + 30000; 51000 = 1 × 30000 + 21000; 30000 = 1 × 21000 + 9000; 21000 = 2 × 9000 + 3000; 9000 = 3 × 3000 + 0

(iii) Remainders

125695, 111961, 13734, 2089, 1200, 889, 311, 267, 44, 3, 2, 1, 0 ⇒ gcd = 1

(iv) Remainders

2587392 = 16 × 157656 + 64896; then 27864, 9168, 360, 168, 24, 0 ⇒ gcd = 24
(i) 75   (ii) 3000   (iii) 1   (iv) 24
End of Chapter · Why Euclid works

End of Chapter, Question 2: Let m ≥ n. Show that d divides both m and n if and only if d divides both n and (m mod n).

Show step-by-step solution

Write m = qn + r, where r = m mod n.

  • If d | m and d | n, then d | (m − qn) = r. So d divides n and r.
  • If d | n and d | r, then d | (qn + r) = m. So d divides m and n.
The pairs (m, n) and (n, m mod n) have exactly the same common divisors, so they have the same GCD.
End of Chapter · prime(n)

End of Chapter, Question 3: Write an algorithm prime(n) that checks whether n is prime. (Hint: use divisors(n).)

Show step-by-step solution
  • If n < 2, return “not prime”.
  • Compute L = divisors(n).
  • If L has exactly two elements (1 and n), return “prime”; otherwise return “not prime”.
Example: divisors(13) = [1, 13] ⇒ prime; divisors(15) = [1, 3, 5, 15] ⇒ not prime.
End of Chapter · primedivisors(n)

End of Chapter, Question 4: Write an algorithm primedivisors(n) that lists the prime divisors of n. (Hint: filter divisors(n).)

Show step-by-step solution
  • Compute L = divisors(n).
  • Keep only those d in L for which prime(d) says “prime”.
Example: divisors(180) = [1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 18, 20, 30, 36, 45, 60, 90, 180]; primedivisors(180) = [2, 3, 5].
End of Chapter · Prime factorisation

End of Chapter, Question 5: Write an algorithm for the prime factorisation of n. (i) How can the factorisation of 180 be represented? (ii) How can two factorisations be compared to find the GCD?

Show step-by-step solution
  • For each prime p in primedivisors(n): count how many times p divides n (keep dividing by p until it no longer divides).
  • Record the pair (p, count).
(i) 180 = 2² × 3² × 5 → [(2, 2), (3, 2), (5, 1)]
(ii) 252 = 2² × 3² × 7 → [(2, 2), (3, 2), (7, 1)]

For each prime in both lists, take the smaller count: 2², 3² (5 and 7 are not common).

gcd(180, 252) = 2² × 3² = 36.
FAQs

Common questions on Chapter 11

What is an algorithm?

A finite sequence of clear steps that solves a problem and always stops with the correct answer.

Why is Euclid’s algorithm faster than listing divisors?

It replaces (m, n) by the smaller pair (n, m mod n) at every step, so the numbers shrink very quickly. Listing divisors needs checking up to n numbers.

Why is the carry in column addition never more than 1?

The largest possible column sum is 9 + 9 + 1 = 19.

Practise more with Abhyaskul

Join our Telegram channel for new solutions, PDFs and exam updates.

Other programmes

Chat on WhatsApp
error: Content is protected !!