[Math] Quotient and Remainder of Numbers

discrete mathematicsdivisibility

May I ask what is the logic behind the quotient and remainder for numbers in such situation.

  n      = q x d + r 
  11 / 5 = 2 x 5 + 1    (Therefore, quotient is 2, and the remainder is 1)

  However, when we have a negative value,

  -11 / 5 = -3 x 5 + 4 (The quotient becomes -3 even though it shows 2 in the calculator)

Can I safely say that whenever there is a negative number as the result (-11 in this case, the quotient and remainder will be different from what we see on the calculators? (eg. -11 / 5 = 2.2)?

Best Answer

Let $n$ and $d$ be integers with $d \neq 0$. When we write $$n = qd + r$$ it is usually understood that $0 \leq r < |d|$.

Since $$11 = 2 \cdot 5 + 1$$ we obtain $$\frac{11}{5} = \frac{2 \cdot 5 + 1}{5} = \frac{2 \cdot 5}{5} + \frac{1}{5} = 2 + 0.2 = 2.2$$

Using division with remainder yields $$-11 = -3 \cdot 5 + 4$$ Thus, $$-\frac{11}{5} = \frac{-3 \cdot 5 + 4}{5} = -\frac{3 \cdot 5}{5} + \frac{4}{5} = -3 + 0.8 = -2.2$$ However, it is sometimes convenient to use negative remainders. We can simply change each sign in the equation $11 = 2 \cdot 5 + 1$ to obtain $$-11 = -2 \cdot 5 - 1$$ so $$-\frac{11}{5} = \frac{-2 \cdot 5 - 1}{5} = -\frac{2 \cdot 5}{5} - \frac{1}{5} = -2 - 0.2 = -2.2$$ Using positive or negative remainders leads to the same result.

When we write $2.2$, the integer part of $2.2$ is $\lfloor 2.2 \rfloor = 2$, the greatest integer less than $2.2$. On the other hand, the integer part of $-2.2$ is $\lceil -2.2 \rceil = -2$, the least integer greater than $-2.2$.

More generally, the integer part of any nonnegative real number expressed in decimal form $x$ is $\lfloor x \rfloor$, the greatest integer less than $x$, while the integer part of any negative real number expressed in decimal form is $\lceil x \rceil$, the least integer greater than $x$.

What your calculator shows you is the quotient plus the remainder expressed in decimal form, so $-3 + 0.8$ is expressed as $-2.2$.