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

Part II • NCERT first edition, August 2026

Class 9 Ganita Manjari Chapter 11 solutions: addition algorithms, divisor lists, GCD, LCM, prime tests and all exercise questions with worked steps.

What makes an algorithm reliable?

An algorithm is a precise sequence of executable steps. State the allowed inputs, initialise each stored value, specify every branch, and say when to stop. A worked example shows how a procedure runs; a justification explains why it works for every permitted input.

Exercise Set 11.1 — Addition

11.1-1. Follow the printed steps literally

Sample test: try 4326 + 5784. The first column has 6+4=106+4=10. The printed algorithm gives a branch for a sum less than 10 and a branch for a sum more than 10, but neither handles exactly 10. Therefore it cannot be followed to completion on this input. The intended second condition must be “10 or more”. With that repair the sum is 10110.

4326+5784=101104326+5784=10110

A case such as 1234+1111=23451234+1111=2345 works even with the printed wording because no column sum equals 10. One successful test does not establish that an algorithm always works.

11.1-2. Unequal numbers of digits

A five-digit number and a three-digit number leave blank positions in the shorter row. The printed steps do not explicitly say how to add a digit to a blank. Repair this by padding the shorter number on the left with zeros, or by stating that missing digits count as zero. For example:

12345+ 0067813023\begin{array}{r}12345\\+\,00678\\\hline13023\end{array}

11.1-3. Why right alignment matters

The rightmost digit is the units digit for every whole number. Right alignment places units under units, tens under tens and so on. Left-aligning unequal-length whole numbers would combine different place values. For decimals, align decimal points instead.

11.1-4. Why the carry is at most 1

9+9+1=199+9+1=19

Two base-ten digits are at most 9 each and the incoming carry is at most 1. A total from 0 to 19 creates at most one new ten. Initially the carry is 0; this bound then continues to hold for every column. It is a statement about adding two numbers; adding many rows at once can produce a larger carry.

11.1-5. Why the last carry must be written

Without Step 5, the result loses its leading digit when the leftmost column generates a carry. For 8000 + 4000, the correct result is 12000; omitting the final carry leaves only 2000. For 1234+1111=23451234+1111=2345 there is no final carry, so omitting the step happens not to change the answer.

Corrected addition algorithm and reflections

  1. Input two non-negative integers. Write their digits in base ten, right-align them and pad the shorter row with leading zeros. Set carry to 0.
  2. Starting in the units column, add its two digits and the carry. Call the total s.
  3. Write the units digit of s in the answer. Set carry to 0 if s < 10; otherwise set it to 1.
  4. Move one column to the left and repeat until all original columns have been processed.
  5. If carry is 1, write it at the left of the answer. Report the resulting number, removing unnecessary leading zeros.
Column for 4326 + 5784CalculationWriteCarry to next column
Units6+4+0=106+4+0=1001
Tens2+8+1=112+8+1=1111
Hundreds3+7+1=113+7+1=1111
Thousands4+5+1=104+5+1=1001
Final carryNo columns remain1 at the leftStop
4326+ 578410110\begin{array}{r}4326\\+\,5784\\\hline10110\end{array}

Page 39, reflection 1: a column total s can be written as s=10c+rs=10c+r, where r is a digit and c is the next carry. At place value 10k10^k, this becomes s10k=r10k+c10k+1s10^k=r10^k+c10^{k+1}. Writing r and carrying c preserves the total value. Each column is processed once, so the algorithm stops and the final answer equals the original sum.

Reflection 2: to add terminating decimal fractions, align decimal points, add trailing zeros until both fractional parts have the same number of places, and add from the rightmost fractional column using the same carry rule. Put the decimal point in the answer directly below the aligned points.

12.35+ 0.7013.05\begin{array}{r}12.35\\+\,0.70\\\hline13.05\end{array}

The number of column operations grows with the number of digits. Counting one dot per unit instead grows with the values of the numbers; that is why place-value addition is far more efficient for large inputs.

Divisor lists and in-text GCD examples

For a positive integer n, inspect each integer j from 1 through n, appending j to an initially empty list exactly when j divides n. This produces an increasing list with every positive divisor once. The assumed basic operation is a divisibility test (equivalently, checking whether the remainder is zero).

nPositive divisors
181, 2, 3, 6, 9, 18
3751, 3, 5, 15, 25, 75, 125, 375
8251, 3, 5, 11, 15, 25, 33, 55, 75, 165, 275, 825
151, 3, 5, 15
1351, 3, 5, 9, 15, 27, 45, 135
7751, 5, 25, 31, 155, 775

Page 41 reflection: this simple procedure performs n candidate tests, so it tests 15, 135 and 775 candidates for the three requested numbers. Increasing n increases the work in proportion to its value, not merely its number of digits.

The common divisors of 375 and 825 are 1, 3, 5, 15, 25 and 75; their largest is 75. For 54000 and 81000 the largest common divisor is 27000: it divides both, and the remainder calculation 81000=1(54000)+2700081000=1(54000)+27000, followed by 54000=2(27000)54000=2(27000), confirms that no larger common divisor is possible.

Exercise Set 11.2 — Lists, LCM and divisor pairs

11.2-1. Elements belonging to just one list

(i) Initialise an empty result. Visit each value in List 1 in order. If it does not occur in List 2, append it to the result. Report that result. (ii) Exchange the roles of List 1 and List 2 and repeat. If “elements” means distinct values and repeated values are allowed in the inputs, append a value only if it is not already in the result.

Example: List 1=[1,3,5,7]1=[1,3,5,7] and List 2=[3,4,7,9]2=[3,4,7,9] give [1, 5] in (i) and [4, 9] in (ii). These are different questions; neither result is a list of common elements.

11.2-2. An algorithm for the least common multiple

Assume m and n are positive integers.

  1. Let L be the larger of m and n.
  2. Check L, 2L, 3L, … in that order.
  3. At each candidate, test divisibility by both m and n. At the first common multiple, report it and stop.

The process stops no later than the product mn, which is a common multiple. Every common multiple is a multiple of L, and the candidates are visited in increasing order, so the first match is the least. For 6 and 8, candidates 8, 16 and 24 give LCM=24\mathrm{LCM}=24.

Once a correct GCD algorithm is available, a faster alternative is:

lcm⁡(m,n)=mngcd⁡(m,n)\operatorname{lcm}(m,n)=\frac{mn}{\gcd(m,n)}

Prime factorisation justifies the formula: for each prime, its exponents in the gcd and lcm are the smaller and larger exponents, whose sum is the sum of the two original exponents.

11.2-3. Using paired divisors

(i) Test the integers from 1 through ⌊n⌋\lfloor\sqrt n\rfloor. If j divides n, record j and nj\frac nj. If they are equal, record the common value only once. Every divisor above the square root has a partner below it, so no divisor is missed. For 18, only 1, 2, 3 and 4 need testing; for a square such as 36, include 6.

(ii) Pair-wise output need not be sorted. For 18 it might be [1, 18, 2, 9, 3, 6]. If all of these also divide the other number 36, taking the rightmost entry would wrongly give 6 instead of 18. Sort the common-divisor list before choosing its rightmost value, or explicitly take the largest value. The list order is part of the original algorithm’s justification.

Exercise Set 11.3 — Reverse scans

11.3-1. Reversing the original divisor-list scan

Scanning from n down to 1 produces a decreasing divisor list. If both lists and the common-divisor scan follow this decreasing order, the largest common divisor is the first common entry, not the last. You may stop when that first match is found. If only the second membership-test list is reversed while the first is still scanned upwards, the common output retains the first list’s increasing order; its last entry remains the gcd. What matters is the order in which candidates are appended.

11.3-2. Reversing the scan without lists

Start at the smaller of m and n and scan downwards. The first integer dividing both is their gcd, so report it immediately and stop. If you keep replacing the stored answer until reaching 1, you will end with 1 for every input and the algorithm will fail when the true gcd exceeds 1.

Subtraction, remainders and why the algorithms work

If m≥nm\ge n, subtracting n from m preserves common divisors: a divisor of m and n divides their difference, while a divisor of n and their difference divides their sum m. Thus:

gcd⁡(m,n)=gcd⁡(n,m−n)\gcd(m,n)=\gcd(n,m-n)
Common-divisor blocks survive subtractionm = 12n = 8m − n = 4444444
Common-divisor blocks survive subtraction. Each block has length 4. The same unit tiles 12, 8 and their difference 4.

For the subtraction algorithm, exchange the inputs whenever needed so the larger comes first; if the smaller is zero, return the larger. Otherwise subtract and repeat. Starting from (825, 375), the subtraction stages, with each pair reordered, are:

(825,375)→(450,375)→(375,75)→(300,75)(825,375)\to(450,375)\to(375,75)\to(300,75)
(300,75)→(225,75)→(150,75)→(75,75)→(75,0)(300,75)\to(225,75)\to(150,75)\to(75,75)\to(75,0)

There are seven subtractions; exchanges are bookkeeping, not additional subtraction reductions. Repeated subtraction can be slow when one input is much larger than the other.

Division combines repeated subtractions into one step. For n>0n>0 write m=qn+rm=qn+r with 0≤r<n0\le r<n. Then:

gcd⁡(m,n)=gcd⁡(n,r)\gcd(m,n)=\gcd(n,r)
  1. Input non-negative integers m and n, not both zero.
  2. If n=0n=0, report m and stop.
  3. Compute r, the remainder when m is divided by n.
  4. Replace m by the old n and n by r. Return to Step 2.

This version does not need a preliminary swap: if m < n, the first remainder is m, so the next pair is (n, m). The nonzero second entry strictly decreases, guaranteeing termination. For negative integer inputs, take absolute values first as an explicitly stated extension; the chapter itself works with positive inputs.

99=49(2)+1,2=2(1)+099=49(2)+1,\qquad2=2(1)+0
60=3(16)+12,16=1(12)+4,12=3(4)+060=3(16)+12,\quad16=1(12)+4,\quad12=3(4)+0

These give gcd⁡(99,2)=1\gcd \left(99,2\right)=1 and gcd⁡(60,16)=4\gcd \left(60,16\right)=4. For 2k+12k+1 and 2, with integer k≥1k\ge 1, the first remainder is 1 and the second is 0, so exactly two division reductions suffice.

Remainder-based GCD algorithmInput m, n ≥ 0; not both zeron = 0?YesReport m; stopNor = remainder of m ÷ nSet m ← old n; n ← r
Remainder-based GCD algorithm. The remainder is calculated before either input is replaced; division by zero is avoided by the decision step.

Textbook clarification (page 48): the explanatory sentence says that a common divisor should tile “m and m mod n”. It should say “n and m mod n”, consistent with the algorithm and the end-of-chapter question. For example, 2 divides m=12m=12 and its remainder 2 on division by n=5n=5, but 2 does not divide 5. The pair (m, remainder) is therefore not generally equivalent.

In the chapter’s comparison, remainder reductions grow slowly with the number of input digits; repeated subtraction can grow with the numerical value. A full running-time analysis would also account for the work required to perform each large-number division.

End-of-Chapter Exercises

E1. Compute the four GCDs using division

At each row divide the current first number by the second, then use the second number and the remainder as the next pair. The last nonzero divisor is the gcd.

(i) (375, 825)

DividendDivisorQuotientRemainder
825375275
3757550
gcd⁡(375,825)=75\gcd(375,825)=75

Check: 75 divides both original numbers; the remainder chain proves that every common divisor divides this final nonzero value.

(ii) (51000, 81000)

DividendDivisorQuotientRemainder
8100051000130000
5100030000121000
300002100019000
21000900023000
9000300030
gcd⁡(51000,81000)=3000\gcd(51000,81000)=3000

Check: 3000 divides both original numbers; the remainder chain proves that every common divisor divides this final nonzero value.

(iii) (1789287, 237656)

DividendDivisorQuotientRemainder
17892872376567125695
2376561256951111961
125695111961113734
1119611373482089
13734208961200
208912001889
12008891311
8893112267
311267144
2674463
443142
3211
2120
gcd⁡(1789287,237656)=1\gcd(1789287,237656)=1

Check: 1 divides both original numbers; the remainder chain proves that every common divisor divides this final nonzero value.

(iv) (2587392, 157656)

DividendDivisorQuotientRemainder
25873921576561664896
15765664896227864
648962786429168
2786491683360
916836025168
360168224
1682470
gcd⁡(2587392,157656)=24\gcd(2587392,157656)=24

Check: 24 divides both original numbers; the remainder chain proves that every common divisor divides this final nonzero value.

E2. Prove the remainder step in both directions

Assume m≥n>0m\ge n>0 and let m=qn+rm=qn+r, where r=m mod nr=m\bmod n. Let d be a positive integer.

Forward: if d divides m and n, it divides m−qn=rm-qn=r. Thus it divides n and r. Reverse: if d divides n and r, it divides qn+r=mqn+r=m. Thus it divides m and n. The two pairs have exactly the same common divisors, so their greatest common divisors agree.

The condition n>0n>0 is needed because “m mod 0” is undefined. When n=0n=0, the algorithm stops before taking a remainder.

E3. Algorithm prime(n)

Divisor-list version, matching the hint:

  1. Input an integer n. If n < 2, report “not prime” and stop.
  2. Compute the list of positive divisors of n.
  3. If the list contains exactly two values, report “prime”; otherwise report “not prime”.

For example, divisors(13)=[1,13]\left(13\right)=[1,13], so 13 is prime. Divisors(1)=[1]\left(1\right)=[1], so 1 is not prime. Divisors(12) has more than two values, so 12 is composite.

More efficient equivalent: test integers d from 2 while d2≤nd^2\le n. If any divides n, report “not prime” immediately. If the loop ends with no divisor, report “prime”. A composite number has a factor at most its square root, which proves the test is sufficient.

E4. Algorithm primedivisors(n)

Assume n is a positive integer.

  1. Start an empty list P.
  2. Compute divisors(n). For each divisor d, run prime(d).
  3. If prime(d) reports true, append d to P.
  4. Report P.

For n=180n=180, the output is [2, 3, 5]. This lists the distinct prime divisors, not repeated prime factors. For n=1n=1, the output is the empty list, since 1 has no prime divisor. Each listed item is both prime and a divisor; every such item appears in divisors(n), so none is missed.

E5. Prime factorisation and comparison of factorizations

Input: a positive integer n. The following trial-division algorithm records prime–exponent pairs.

  1. Set remaining = n, d=2d=2, and start an empty factor list.
  2. While d2≤remainingd^2\le\text{remaining}, set an exponent counter e to 0. Repeatedly divide remaining by d for as long as the remainder is zero, increasing e by 1 each time.
  3. If e>0e>0, append the pair (d, e). Increase d by 1 and repeat Step 2.
  4. When the loop ends, if remaining > 1, append (remaining, 1). Report the factor list.

Previously tested prime factors have been fully removed, so any later d that actually divides the remaining number must be prime. Once d2d^{2} exceeds the remaining number, a remaining value greater than 1 cannot be composite without having a smaller factor already removed. The procedure terminates because trial divisors increase and successful divisions decrease the remaining value.

(i) For 180, use [(2, 2), (3, 2), (5, 1)], where each pair means (prime, exponent):

180=22×32×51180=2^2\times3^2\times5^1

(ii) Compare the exponents of the same primes, treating a missing prime as exponent zero. For the gcd, take the smaller exponent of each common prime. For the lcm, take the larger exponent of every prime appearing in either number. For example:

180=22×32×5,168=23×3×7180=2^2\times3^2\times5,\qquad168=2^3\times3\times7
gcd⁡(180,168)=22×3=12\gcd(180,168)=2^2\times3=12
lcm⁡(180,168)=23×32×5×7=2520\operatorname{lcm}(180,168)=2^3\times3^2\times5\times7=2520

For n=1n=1, the factor list is empty and its product is understood as 1. Zero has no finite prime factorisation and is outside this algorithm’s stated input domain.

Algorithm checklist

Test the smallest permitted input, a square, a prime, equal inputs and unequal digit lengths where relevant. Check boundaries such as “exactly 10”, not just “less” and “more”. Distinguish a value from its position in a list, and prove that the stopping condition is eventually reached. Testing helps reveal mistakes; the mathematical justification establishes correctness.

Textbook and answer notes

Based on NCERT Ganita Manjari, Grade 9, Part II, first edition August 2026 (ISBN 978-93-5729-236-8). Question numbers follow the supplied textbook. Question cues are shortened; consult the book for the complete wording and original figures. Solutions and diagrams on this page are ClearStudy explanations. Open-ended responses are examples, not the only acceptable answers.

Scroll to Top