Mathematics I / Divisibility and the Division Algorithm
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
  1. Write 17 as 5q + r in three different ways. What is missing without the constraint?
  2. 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.

Read the lesson: Divisibility and the Division Algorithm →

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