पढ़ो पथPadhoPath
🏆 PadhoPath Challenge चल रहा है: मुफ़्त क्विज़, खेलते ही प्रमाण-पत्र, आख़िरी तारीख़ 10 दिसंबर। अभी खेलें →PadhoPath Challenge is on: free quiz, certificate right away, last date 10 Dec. Play now →

PadhoPath › Class 9 › Maths › Chapter 11 › NCERT

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

Easy step-by-step answers to all 18 exercise questions of the NCERT book. Read in Hindi

अपडेट: 24 नवंबर 2026Updated: 24 Nov 2026

Go to question: Exercise Set 11.1-1 · Exercise Set 11.1-2 · Exercise Set 11.1-3 · Exercise Set 11.1-4 · Exercise Set 11.1-5 · Think and Reflect (11.1)-1 · Think and Reflect (11.1)-2 · Think and Reflect (11.2)-1 · Exercise Set 11.2-1 · Exercise Set 11.2-2 · Exercise Set 11.2-3 · Exercise Set 11.3-1 · Exercise Set 11.3-2 · End-of-Chapter Exercises-1 · End-of-Chapter Exercises-2 · End-of-Chapter Exercises-3 · End-of-Chapter Exercises-4 · End-of-Chapter Exercises-5

Exercise Exercise Set 11.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?

✔ Answer:

Take 4758 + 2693 (any two 4-digit numbers will do).

Write them one below the other with the digits aligned from the right.

  • Units: 8 + 3 = 11, which is more than 10. Write 1, carry = 1.
  • Tens: 5 + 9 + 1 = 15. Write 5, carry = 1.
  • Hundreds: 7 + 6 + 1 = 14. Write 4, carry = 1.
  • Thousands: 4 + 2 + 1 = 7, less than 10. Write 7, carry = 0.
  • No more digits on the left and carry = 0, so we write nothing more.

Answer: 7451. Yes, the steps give the correct result (4758 + 2693 = 7451).

One small gap: the steps say "less than 10" and "more than 10" but do not say what to do when the column sum is exactly 10. It should be treated like "10 or more" (write 0, carry 1).

Exercise Exercise Set 11.1, Question 2

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

✔ Answer:

Take 52841 + 679. After aligning from the right, only the first three columns have two digits; in the last two columns the shorter number has no digit.

Step 3 says "add the two digits and the carry", but there is only one digit. The steps do not tell us what to do, so followed strictly they do not handle this case.

Fix: treat the missing digits as 0 (write leading zeros: 00679).

  • Units: 1 + 9 = 10, write 0, carry 1.
  • Tens: 4 + 7 + 1 = 12, write 2, carry 1.
  • Hundreds: 8 + 6 + 1 = 15, write 5, carry 1.
  • Thousands: 2 + 0 + 1 = 3, write 3, carry 0.
  • Ten-thousands: 5 + 0 = 5, write 5.

Answer: 53520. The steps work correctly once missing digits are treated as 0.

Exercise Exercise Set 11.1, Question 3

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

✔ Answer:

Each column stands for one place value: units, tens, hundreds, ... Only digits of the same place value can be added together.

Every number has its units digit on the right, so aligning from the right puts units under units, tens under tens, and so on.

Example: for 52841 + 679, if we aligned from the left we would add 5 (ten-thousands) to 6 (hundreds), which is wrong.

Answer: Aligning from the right makes sure digits of the same place value are added together.

Exercise Exercise Set 11.1, Question 4

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

✔ Answer:

In Step 3 we add two digits and the carry coming from the column on the right.

  • Each digit is at most 9, and the carry is at most 1 (we check this step by step).
  • The first carry (from Step 2) is 0 or 1 because 9 + 9 = 18, which gives carry 1.
  • If the carry is at most 1, then the largest possible column sum is 9 + 9 + 1 = 19.
  • 19 = 10 + 9, so the new carry is again 1 (at most).

So every carry is 0 or 1.

Answer: The biggest possible column total is 9 + 9 + 1 = 19, which is less than 20, so the carry to the next column is never more than 1.

Exercise Exercise Set 11.1, 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.

✔ Answer:

Step 5 says: if carry = 1 at the end, write 1 to the left of the bottom row.

Without Step 5, a carry out of the leftmost column is lost.

  • Works correctly when the last carry is 0. Example: 123 + 456 = 579 (no carry at the end).
  • Fails when the last carry is 1. Example: 473 + 695. We get 8, 6, 1 in the three columns, so the answer is 168 instead of 1168. Another example: 99 + 1 gives 00 instead of 100.

Answer: Without Step 5 the algorithm works only when there is no carry out of the leftmost column; otherwise the answer is short by a leading 1.

Exercise Think and Reflect (11.1), Question 1

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

✔ Answer:

Write each number as groups of units, tens, hundreds, ... For example 473 = 4 hundreds + 7 tens + 3 units and 695 = 6 hundreds + 9 tens + 5 units.

  • Add the groups of the same kind: units: 3 + 5 = 8 units.
  • Tens: 7 + 9 = 16 tens. But 10 tens make 1 hundred, so 16 tens = 1 hundred + 6 tens. Keep 6 tens, carry 1 hundred.
  • Hundreds: 4 + 6 + 1 (carried) = 11 hundreds = 1 thousand + 1 hundred. Keep 1 hundred, carry 1 thousand.
  • Thousands: 0 + 0 + 1 = 1 thousand.

So the sum is 1 thousand 1 hundred 6 tens 8 units = 1168.

In general, if a column total is s, write s = 10 \(\times\) (carry) + (digit). The digit stays in that column and the carry is 10 of this group made into 1 of the next bigger group. Making a group of 10 into 1 bigger group never changes the total value, so after all columns are done, the written digits represent exactly the sum of the two numbers.

Answer: The algorithm adds group by group and exchanges every 10 of a group for 1 of the next group, which keeps the total value unchanged; hence it gives the correct sum.

Exercise Think and Reflect (11.1), Question 2

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

✔ Answer:

Only the alignment step changes.

1. Write the numbers one below the other so that the decimal points are in the same vertical line (this lines up tenths under tenths, hundredths under hundredths, ...).

2. If one number has fewer digits after the decimal point, add zeros at the end to make them equal. (Example: 12.75 and 3.5 become 12.75 and 3.50.)

3. Add column by column from the rightmost digit to the left, with carry, exactly as before (the carry passes over the decimal point as usual).

4. Put the decimal point in the answer directly below the decimal points above.

Example: 12.75 + 3.50 = 16.25.

Answer: Align the decimal points (not the right ends), pad with zeros, add as before, and place the decimal point in the same column in the answer.

Exercise Think and Reflect (11.2), 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?

✔ Answer:

The algorithm checks every j = 1, 2, 3, ..., n and adds j to the list if j divides n.

  • n = 15: check 1 to 15 (15 checks). divisors(15) = [1, 3, 5, 15].
  • n = 135: check 1 to 135 (135 checks). divisors(135) = [1, 3, 5, 9, 15, 27, 45, 135].
  • n = 775: check 1 to 775 (775 checks). divisors(775) = [1, 5, 25, 31, 155, 775].

Answer: The number of checks equals the number itself. So the work grows in proportion to the value of the number: if the number becomes 10 times as big, the work becomes 10 times as much (one more digit means 10 times the work).

Exercise Exercise Set 11.2, 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. (ii) Write an algorithm to find elements in List 2 that are not present in List 1.

✔ Answer:

(i) Algorithm to find elements of List 1 not in List 2

1. Start with an empty list called only-in-1.

2. For each number x in List 1:

  • Look through List 2. If x does not appear in List 2, add x to only-in-1.

3. Report only-in-1.

Example: List 1 = [1, 3, 5, 15], List 2 = [1, 3, 5, 11, 25]. Only 15 is missing from List 2, so only-in-1 = [15].

(ii) Same algorithm with the two lists exchanged

1. Start with an empty list called only-in-2.

2. For each number y in List 2: if y does not appear in List 1, add y to only-in-2.

3. Report only-in-2.

(For the same example, only-in-2 = [11, 25].)

Note: because both lists are in increasing order, we can stop searching List 2 as soon as we meet a number bigger than x. This makes the algorithm faster.

Exercise Exercise Set 11.2, Question 2

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

✔ Answer:

The lcm of m and n is the smallest number that both m and n divide. It is at least max(m, n) and at most m \(\times\) n (since m \(\times\) n is a common multiple).

Algorithm to find lcm(m, n)

1. Let j = max(m, n).

2. If m divides j and n divides j, report j as the lcm and stop.

3. Otherwise, increase j by 1 and go back to Step 2.

Because we try j in increasing order, the first j that works is the smallest common multiple. The algorithm always stops by j = m \(\times\) n.

Example: lcm(4, 6): j = 6 (4 does not divide 6), 7, 8 (6 does not divide 8), 9, 10, 11 fail, j = 12 works (4 and 6 both divide 12). So lcm = 12.

Answer: Start from the larger number and go up one by one until you reach the first number divisible by both. (Another way: lcm(m, n) = (m \(\times\) n) / gcd(m, n), using any gcd algorithm.)

Exercise Exercise Set 11.2, 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? (ii) If we list out the divisors in pairs, will our gcd algorithm still work in the manner we have described?

✔ Answer:

(i) If d divides n, then n/d also divides n, and they form a pair (d, n/d). In each pair the smaller number is at most the square root of n (because if both were bigger than the square root, their product would be more than n).

So we only need to examine j = 1, 2, 3, ... up to the square root of n. Whenever j divides n, we write down both j and n/j (only once if they are equal, as in n = 36 with j = 6).

Example: n = 18. The square root is about 4.2, so check 1, 2, 3, 4 only: (1, 18), (2, 9), (3, 6) are found and 4 fails. That is 4 checks instead of 18.

Answer: About the square root of n numbers (1 up to the square root of n) are enough.

(ii) The pairs give the list 1, 2, 3, 6, 9, 18 only after we arrange it: the small numbers come in increasing order, but the partners n/d come in decreasing order. So the list written pair by pair, [1, 18, 2, 9, 3, 6], is not in increasing order.

Our gcd algorithm reports the rightmost element of the common-divisor list as the largest one, which depends on the list being in increasing order. Checking whether x is in the other list still works, but Step 5 would give a wrong answer.

Answer: Not exactly. We must first sort the lists into increasing order (or pick the largest common divisor by comparing all of them); then the algorithm works.

Exercise Exercise Set 11.3, 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?

✔ Answer:

If we check j = n, n-1, ..., 1, the divisors are added in decreasing order. For example divisors(18) = [18, 9, 6, 3, 2, 1].

  • The lists of divisors of m and n are both in decreasing order.
  • The list of common divisors (made by going through the divisors of m in order) is also in decreasing order.
  • So the greatest common divisor is now the leftmost (first) element of the list, not the rightmost.

Only Step 5 changes: "Report the first element of common-divisors as gcd(m, n)".

Example: gcd(375, 825): common divisors = [75, 25, 15, 5, 3, 1], first element 75.

Also, we could stop as soon as we find the first number of divisors-of-m that is in divisors-of-n; that number is the gcd.

Answer: Everything is the same except that we report the first (leftmost) element instead of the last one.

Exercise Exercise Set 11.3, 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?

✔ Answer:

The last algorithm keeps most-recent-common-divisor and scans k = 2, 3, ..., min(m, n).

If we scan k = min(m, n), min(m, n) - 1, ..., 1 instead, the first k that divides both m and n is the greatest common divisor, because we are going from the biggest possible value downwards.

  • So we can stop immediately at the first such k, and we do not need to keep updating most-recent-common-divisor.
  • Since 1 divides every number, the scan always stops (at worst at k = 1).

Example: gcd(6, 12): min = 6; k = 6 divides both, so the gcd is 6 after one check (the forward scan needed all values from 2 to 6).

But when the gcd is small (for example gcd(97, 89) = 1) we still check almost all numbers down to 1, so in the worst case the work is still about min(m, n).

Answer: The first common divisor found going downwards is the gcd, so we can stop early; this is often faster but not faster in the worst case.

Exercise End-of-Chapter Exercises, Question 1

Compute the following using the improved version of Euclid's algorithm. (i) gcd(375, 825) (ii) gcd(51000, 81000) (iii) gcd(1789287, 237656) (iv) gcd(2587392, 157656)

✔ Answer:

Rule: gcd(m, n) = gcd(n, m mod n) with m >= n; stop when the remainder is 0 (the last non-zero number is the gcd).

(i) gcd(375, 825): reverse to gcd(825, 375).

  • 825 = 2 \(\times\) 375 + 75, so gcd(375, 75)
  • 375 = 5 \(\times\) 75 + 0

gcd = 75

(ii) gcd(51000, 81000): reverse to gcd(81000, 51000).

  • 81000 = 1 \(\times\) 51000 + 30000
  • 51000 = 1 \(\times\) 30000 + 21000
  • 30000 = 1 \(\times\) 21000 + 9000
  • 21000 = 2 \(\times\) 9000 + 3000
  • 9000 = 3 \(\times\) 3000 + 0

gcd = 3000

(iii) gcd(1789287, 237656):

  • 1789287 = 7 \(\times\) 237656 + 125695
  • 237656 = 1 \(\times\) 125695 + 111961
  • 125695 = 1 \(\times\) 111961 + 13734
  • 111961 = 8 \(\times\) 13734 + 2089
  • 13734 = 6 \(\times\) 2089 + 1200
  • 2089 = 1 \(\times\) 1200 + 889
  • 1200 = 1 \(\times\) 889 + 311
  • 889 = 2 \(\times\) 311 + 267
  • 311 = 1 \(\times\) 267 + 44
  • 267 = 6 \(\times\) 44 + 3
  • 44 = 14 \(\times\) 3 + 2
  • 3 = 1 \(\times\) 2 + 1
  • 2 = 2 \(\times\) 1 + 0

gcd = 1 (the numbers are co-prime)

(iv) gcd(2587392, 157656):

  • 2587392 = 16 \(\times\) 157656 + 64896
  • 157656 = 2 \(\times\) 64896 + 27864
  • 64896 = 2 \(\times\) 27864 + 9168
  • 27864 = 3 \(\times\) 9168 + 360
  • 9168 = 25 \(\times\) 360 + 168
  • 360 = 2 \(\times\) 168 + 24
  • 168 = 7 \(\times\) 24 + 0

gcd = 24

Answer: (i) 75 (ii) 3000 (iii) 1 (iv) 24

Exercise End-of-Chapter Exercises, 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.

✔ Answer:

Let m = q \(\times\) n + r, where q is the quotient and r = m mod n is the remainder.

(a) Suppose d divides m and n. Write m = ad and n = bd. Then r = m - q \(\times\) n = ad - q x bd = (a - qb)d. So d divides r = m mod n. Hence d divides both n and m mod n.

(b) Suppose d divides n and r (= m mod n). Write n = xd and r = yd. Then m = q \(\times\) n + r = q \(\times\) xd + yd = (qx + y)d. So d divides m. Hence d divides both m and n.

By (a) and (b), d divides m and n if and only if d divides n and m mod n. So the pairs (m, n) and (n, m mod n) have exactly the same common divisors, hence the same gcd.

Answer: Verified (as shown above).

Exercise End-of-Chapter Exercises, 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)?)

✔ Answer:

Algorithm prime(n)

1. Compute the list divisors(n) using the algorithm for divisors.

2. Count the numbers in this list.

3. If the count is exactly 2, report "n is prime". Otherwise report "n is not prime".

Why it works: a prime has exactly two divisors, 1 and itself. The number 1 has only one divisor (the list is [1]), so it is correctly reported as not prime; a composite number has at least three divisors.

Examples:

  • n = 7: divisors(7) = [1, 7], count 2, so prime.
  • n = 12: divisors(12) = [1, 2, 3, 4, 6, 12], count 6, so not prime.
  • n = 1: divisors(1) = [1], count 1, so not prime.

Answer: n is prime exactly when divisors(n) has exactly 2 elements.

Exercise End-of-Chapter Exercises, 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.)

✔ Answer:

Algorithm primedivisors(n)

1. Compute the list D = divisors(n).

2. Start with an empty list called prime-divisors.

3. For each number x in D:

  • Use prime(x) (from Question 3). If x is prime, add x to prime-divisors.

4. Report prime-divisors.

Example: n = 18. D = [1, 2, 3, 6, 9, 18]. 1 is not prime, 2 is prime, 3 is prime, 6, 9, 18 are not prime. So prime-divisors = [2, 3].

Example: n = 30. D = [1, 2, 3, 5, 6, 10, 15, 30]. The primes are 2, 3, 5, so the answer is [2, 3, 5].

Answer: Keep only those divisors x of n for which prime(x) is true.

Exercise End-of-Chapter Exercises, 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^2 \times 3^2 \times 5^1\). How would you represent this? (ii) How would you compare the prime factorisations of two numbers?

✔ Answer:

Algorithm to find the prime factorisation of n

1. Start with an empty list called factors. Let r = n and p = 2.

2. While r is greater than 1:

  • If p divides r, add p to factors and replace r by r / p (keep the same p).
  • Otherwise, increase p by 1.

3. Report factors.

Why only primes get added: when we reach a p, all smaller primes have already been divided out completely from r, so a composite p can never divide r.

Example n = 180: p = 2: 180 to 90 to 45, so factors = [2, 2]. 2 does not divide 45, so p = 3: 45 to 15 to 5, factors = [2, 2, 3, 3]. p = 4 does not divide 5; p = 5: 5 to 1, factors = [2, 2, 3, 3, 5].

(i) Representation: as a list of (prime, exponent) pairs in increasing order of the prime: [(2, 2), (3, 2), (5, 1)]. (Or simply the list [2, 2, 3, 3, 5] with repeats.)

(ii) Comparing two factorisations (to get the gcd):

  • For each prime p in the first list, look for p in the second list.
  • If it is found, the common part is p raised to the smaller of the two exponents. If it is not found, p is not a common factor.
  • Multiply all the common parts to get the gcd.

Example: 180 = (2,2),(3,2),(5,1) and 150 = (2,1),(3,1),(5,2). Common parts: 2^1, 3^1, 5^1, so gcd = 2 \(\times\) 3 x 5 = 30. (Taking the larger exponent for every prime would give the lcm, 900.)

Answer: See algorithm above; represent as (prime, exponent) pairs and take the smaller exponent of each common prime to get the gcd.

Class 9 Maths — NCERT solutions for all chapters

📲 On this chapter in the PadhoPath app: daily homework, 25 practice questions, why every wrong answer is wrong, and a report for parents. Free till 31 Dec 2026.
Start freeRead the chapter summary

Answers are written by PadhoPath in its own words. Questions are from the NCERT textbook exercises.

PadhoPath क्या है?What is PadhoPath?

PadhoPath (पढ़ो पथ) Samjho Bharat की मुफ़्त पढ़ाई वेबसाइट और ऐप है: कक्षा 1 से 12, NCERT पाठ्यक्रम, हिंदी और English में।PadhoPath is a free study website and app by Samjho Bharat for Class 1 to 12, based on the NCERT syllabus, in Hindi and English.

मुफ़्त शुरू करेंStart freeऔर जानेंLearn more

💬 WhatsApp
मुफ़्त शुरू करेंStart free💬 WhatsApp