Practice question · Multiple choice
The division algorithm insists the remainder satisfies 0 ≤ r < a. Both 17 = 5·3 + 2 and 17 = 5·2 + 7 are arithmetically correct. Why does only the first count?
Hints
- Write 17 as 5q + r in three different ways. What is missing without the constraint?
- Ask what "the remainder of 17 mod 5" could mean if several answers were allowed.
Show the answer
A. Because the constraint is what makes quotient and remainder unique.
Why
Both equations are true arithmetic, and without the range condition you could also write 17 = 5·1 + 12, indefinitely, the constraint buys uniqueness, which is what lets 'the remainder' be spoken of at all. Note the negative case: −17 = 5·(−4) + 3 gives 3, and many languages return −2 instead, which is a frequent source of bugs.
Practise Divisibility and the Division Algorithm
The app has 6 more questions on this lesson, and keeps your place in the course. Mathematics I is free to start.
More questions on Divisibility and the Division Algorithm
- Select every integer below that divides 84.
- Order the steps of the proof that if a divides b and a divides c, then a divides b + c.
- Since 47 = 6 x 6 + 11 is a true equation, it gives the quotient and remainder of 47 divided by 6.
- A hash function reduces a key modulo the table size. Why do implementations favour a prime table size?