Division Algorithm examples [00DF]
- April 7, 2026
Example [00DG]
- April 7, 2026
What is the quotient and remainder when 101 is divided by 11?
According to the division algorithm, there exist q and r such that 101 = 11q + r and 0 \leq r < 11. We find that 101 = 11 \cdot 9 + 2, so q = 9 and r = 2. We could also express this as \begin {align*} 101 \mathbin {\mathbf {div}} 11 &= 9 \\ 101 \mathbin {\mathbf {mod}} 11 &= 2 \end {align*}
Example [00DH]
- April 7, 2026
What about when 55 is divided by 11? In this case we have 55 \mathbin {\mathbf {div}} 11 = 5 and 55 \mathbin {\mathbf {mod}} 11 = 0.
Example [00DI]
- April 7, 2026
What is 7 \mathbin {\mathbf {mod}} 11? This situation is sometimes confusing for students just learning about the % operator in a programming language, but applying the definition, we seek (q and) r such that 0 \leq r < 11 and 11 = 7q + r. The only values that fit the bill are q = 0 and r = 7. In other words, if we try to divide 7 by 11, we find that 0 copies of 11 fit into 7, and we are left with the same 7 we started with.
Example [00DJ]
- April 7, 2026
What is the result of dividing -24 by 11? If we think purely in terms of “how many copies of 11 will fit” we might think the quotient is -2, but that would result in a remainder of -2, which is not in the required range! In fact, -24 = 11 \cdot (-3) + 9, so the quotient is -3 with a remainder of 9.