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 . 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.
A case such as 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:
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
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 there is no final carry, so omitting the step happens not to change the answer.
Corrected addition algorithm and reflections
- 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.
- Starting in the units column, add its two digits and the carry. Call the total s.
- Write the units digit of s in the answer. Set carry to 0 if s < 10; otherwise set it to 1.
- Move one column to the left and repeat until all original columns have been processed.
- If carry is 1, write it at the left of the answer. Report the resulting number, removing unnecessary leading zeros.
| Column for 4326 + 5784 | Calculation | Write | Carry to next column |
|---|---|---|---|
| Units | 0 | 1 | |
| Tens | 1 | 1 | |
| Hundreds | 1 | 1 | |
| Thousands | 0 | 1 | |
| Final carry | No columns remain | 1 at the left | Stop |
Page 39, reflection 1: a column total s can be written as , where r is a digit and c is the next carry. At place value , this becomes . 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.
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).
| n | Positive divisors |
|---|---|
| 18 | 1, 2, 3, 6, 9, 18 |
| 375 | 1, 3, 5, 15, 25, 75, 125, 375 |
| 825 | 1, 3, 5, 11, 15, 25, 33, 55, 75, 165, 275, 825 |
| 15 | 1, 3, 5, 15 |
| 135 | 1, 3, 5, 9, 15, 27, 45, 135 |
| 775 | 1, 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 , followed by , 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 and List 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.
- Let L be the larger of m and n.
- Check L, 2L, 3L, … in that order.
- 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 .
Once a correct GCD algorithm is available, a faster alternative is:
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 . If j divides n, record j and . 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 , 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:
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:
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 write with . Then:
- Input non-negative integers m and n, not both zero.
- If , report m and stop.
- Compute r, the remainder when m is divided by n.
- 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.
These give and . For and 2, with integer , the first remainder is 1 and the second is 0, so exactly two division reductions suffice.
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 and its remainder 2 on division by , 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)
| Dividend | Divisor | Quotient | Remainder |
|---|---|---|---|
| 825 | 375 | 2 | 75 |
| 375 | 75 | 5 | 0 |
Check: 75 divides both original numbers; the remainder chain proves that every common divisor divides this final nonzero value.
(ii) (51000, 81000)
| Dividend | Divisor | Quotient | Remainder |
|---|---|---|---|
| 81000 | 51000 | 1 | 30000 |
| 51000 | 30000 | 1 | 21000 |
| 30000 | 21000 | 1 | 9000 |
| 21000 | 9000 | 2 | 3000 |
| 9000 | 3000 | 3 | 0 |
Check: 3000 divides both original numbers; the remainder chain proves that every common divisor divides this final nonzero value.
(iii) (1789287, 237656)
| Dividend | Divisor | Quotient | Remainder |
|---|---|---|---|
| 1789287 | 237656 | 7 | 125695 |
| 237656 | 125695 | 1 | 111961 |
| 125695 | 111961 | 1 | 13734 |
| 111961 | 13734 | 8 | 2089 |
| 13734 | 2089 | 6 | 1200 |
| 2089 | 1200 | 1 | 889 |
| 1200 | 889 | 1 | 311 |
| 889 | 311 | 2 | 267 |
| 311 | 267 | 1 | 44 |
| 267 | 44 | 6 | 3 |
| 44 | 3 | 14 | 2 |
| 3 | 2 | 1 | 1 |
| 2 | 1 | 2 | 0 |
Check: 1 divides both original numbers; the remainder chain proves that every common divisor divides this final nonzero value.
(iv) (2587392, 157656)
| Dividend | Divisor | Quotient | Remainder |
|---|---|---|---|
| 2587392 | 157656 | 16 | 64896 |
| 157656 | 64896 | 2 | 27864 |
| 64896 | 27864 | 2 | 9168 |
| 27864 | 9168 | 3 | 360 |
| 9168 | 360 | 25 | 168 |
| 360 | 168 | 2 | 24 |
| 168 | 24 | 7 | 0 |
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 and let , where . Let d be a positive integer.
Forward: if d divides m and n, it divides . Thus it divides n and r. Reverse: if d divides n and r, it divides . Thus it divides m and n. The two pairs have exactly the same common divisors, so their greatest common divisors agree.
The condition is needed because “m mod 0” is undefined. When , the algorithm stops before taking a remainder.
E3. Algorithm prime(n)
Divisor-list version, matching the hint:
- Input an integer n. If n < 2, report “not prime” and stop.
- Compute the list of positive divisors of n.
- If the list contains exactly two values, report “prime”; otherwise report “not prime”.
For example, divisors, so 13 is prime. Divisors, 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 . 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.
- Start an empty list P.
- Compute divisors(n). For each divisor d, run prime(d).
- If prime(d) reports true, append d to P.
- Report P.
For , the output is [2, 3, 5]. This lists the distinct prime divisors, not repeated prime factors. For , 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.
- Set remaining = n, , and start an empty factor list.
- While , 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.
- If , append the pair (d, e). Increase d by 1 and repeat Step 2.
- 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 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):
(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:
For , 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.
