Sub topic 1
Dividend, divisor, quotient and remainder
Prerequisites
This chapter assumes you can do integer long division by hand and know what a factor and a multiple are. You should recognise a prime number and be comfortable with positive integer exponents. No modular arithmetic is needed. This chapter is where it starts.
The four parts of a division
When you divide one integer by another, four numbers are involved.
- The dividend is the number being divided.
- The divisor is the number you divide by.
- The quotient is the whole number of times the divisor fits into the dividend.
- The remainder is what is left over after those whole copies are taken out.
For 47 ÷ 6, the divisor 6 fits into 47 seven times, because 6 × 7 = 42. The leftover is 47 − 42 = 5. So the quotient is 7 and the remainder is 5.
The four numbers are tied together by one equation:
dividend = divisor × quotient + remainder
For this example, 47 = 6 × 7 + 5. Almost every remainder technique in CAT Quant starts from this equation, so it is worth being able to write it without thinking.
The division algorithm
The division algorithm is the statement that this decomposition always exists and is unique. For any integer a and any positive integer n, there is exactly one pair of integers q and r such that:
a = n × q + r, with 0 ≤ r < n
The condition 0 ≤ r < n is what makes the pair unique. Without it, 47 = 6 × 6 + 11 would also be a valid-looking equation. The remainder must be at least 0 and strictly less than the divisor. A remainder equal to the divisor means you can still take out one more copy of the divisor.
Two consequences are used constantly.
- When the divisor is n, there are exactly n possible remainders: 0, 1, ..., n − 1. Dividing by 5 can only give 0, 1, 2, 3 or 4.
- A remainder of 0 means the divisor divides the dividend exactly. "n divides a" and "a leaves remainder 0 on division by n" are the same statement.
q, r = divmod(47, 6)
print(q, r) # 7 5
print(47 == 6 * q + r) # True
print((-7) % 5) # 3The built-in divmod returns the quotient and remainder together. The last line shows a case that surprises many learners, covered below.
Visualising the remainder
Think of the dividend as a pile of items, packed into boxes of size n. The quotient is the number of full boxes. The remainder is the number of loose items that do not fill another box.
Working backwards from the equation
CAT questions often give you the remainder and ask for something else. The equation lets you rebuild the dividend.
If a number leaves remainder 4 on division by 9, then it has the form 9k + 4, where k is a non-negative integer (the quotient). So the number could be 4, 13, 22, 31, and so on. Each value is 9 more than the one before.
Worked example. A number leaves remainder 3 when divided by 8. What remainder does 5 times the number leave when divided by 8?
- Write the number as 8k + 3.
- Multiply by 5 to get 40k + 15.
- Split off multiples of 8: 40k is a multiple of 8, and 15 = 8 + 7.
- So 5 times the number is a multiple of 8 plus 7. The remainder is 7.
This approach works for any question of this kind, and the next chapters show shortcuts that skip the algebra.
Same remainder, different quotient
The quotient is not fixed by the remainder. In 9k + 4, k can be any non-negative integer. When a question says "a number leaves remainder 4 when divided by 9", it describes an infinite family of numbers, not a single one. If the question asks for a result that depends only on the remainder, the choice of k will not matter. If your answer changes with k, you have probably made an error, or the question is missing a condition.
Changing the divisor: a common trap
A frequent question type gives the remainder for one divisor and asks about another. Be careful here.
Suppose a number leaves remainder 17 when divided by 35. What is the remainder when it is divided by 7?
Write the number as 35k + 17. Since 35 is a multiple of 7, 35k contributes nothing to the remainder on division by 7. The remainder depends only on 17, and 17 = 2 × 7 + 3. The remainder is 3.
This worked because 7 divides 35. The general rule is that if d divides n, then the remainder of a number on division by d equals the remainder of (its remainder on division by n) on division by d. If d does not divide n, no such conclusion is possible. A number leaving remainder 17 on division by 35 could be 17 or 52, and these leave remainders 17 and 52 − 48 = 4 when divided by 12. The remainder on division by 12 is not determined.
| Information given | Divisor asked | Is the remainder determined? |
|---|---|---|
| Remainder 17 on division by 35 | 7 | Yes, it is 3 |
| Remainder 17 on division by 35 | 5 | Yes, it is 2 |
| Remainder 17 on division by 35 | 12 | No |
| Remainder 10 on division by 24 | 8 | Yes, it is 2 |
Remainders with negative numbers
The division algorithm requires 0 ≤ r < n, even when the dividend is negative. This is the convention used in CAT.
To find the remainder of −7 on division by 5, find the multiple of 5 at or below −7. That multiple is −10. Then −7 = 5 × (−2) + 3, so the remainder is 3, not −2.
A quick method: ignore the sign, find the remainder of the positive number, and subtract it from the divisor. For 7 ÷ 5 the remainder is 2, and 5 − 2 = 3. If the positive remainder is 0, the answer stays 0.
Python's % operator follows the same convention for a positive divisor, which is why (-7) % 5 printed 3 above. Not every language does this. In C and Java, -7 % 5 gives −2. If you check an answer by code, know which convention your language uses.
Special cases worth remembering
- Dividing by 1 always gives remainder 0, since 1 divides every integer.
- If the dividend is smaller than the divisor, the quotient is 0 and the remainder equals the dividend. For example, 4 ÷ 9 has quotient 0 and remainder 4.
- If the dividend is 0, both quotient and remainder are 0.
- The remainder can never be negative or equal to the divisor in the final answer.
Checking a division
You can always verify a division by rebuilding the dividend. Take 1234 ÷ 17.
- 17 × 72 = 1224, and 17 × 73 = 1241, which is too large. So the quotient is 72.
- The remainder is 1234 − 1224 = 10.
- Check: 17 × 72 + 10 = 1224 + 10 = 1234. ✓
- Check the range: 0 ≤ 10 < 17. ✓
The second check catches a common slip, where the quotient is chosen one too small and the remainder comes out larger than the divisor.
Common errors
- Giving a remainder equal to or larger than the divisor.
- Reporting a negative remainder as the final answer.
- Assuming a remainder on divisor n tells you the remainder on any other divisor. It only does so when the new divisor is a factor of n.
- Treating the quotient as fixed. It is a free variable, and good answers do not depend on its value.
- Forgetting that the quotient can be 0, so the smallest number with remainder r is r itself.
Exercise
A number leaves remainder 29 when divided by 45. (a) What is the remainder when it is divided by 9? (b) What is the remainder when it is divided by 15? (c) Can you find the remainder when it is divided by 10?
Show answer
Write the number as 45k + 29. (a) 45 is a multiple of 9, so only 29 matters. 29 = 3 × 9 + 2, so the remainder is 2. (b) 45 is a multiple of 15, and 29 = 1 × 15 + 14, so the remainder is 14. (c) No. 10 does not divide 45. Taking k = 0 gives the number 29, with remainder 9 on division by 10. Taking k = 1 gives 74, with remainder 4. The remainder is not determined.
Exercise
What is the remainder when −53 is divided by 8? Show the equation in the form a = n × q + r.
Show answer
The largest multiple of 8 that is at or below −53 is −56, which is 8 × (−7). Then −53 = 8 × (−7) + 3, so the remainder is 3. Check: 0 ≤ 3 < 8.
Exercise
A number leaves remainder 6 when divided by 11. What remainder does 4 times the number leave when divided by 11?
Show answer
Write the number as 11k + 6. Then 4 times the number is 44k + 24. Since 44k is a multiple of 11 and 24 = 2 × 11 + 2, the remainder is 2.