Why should the sign of remainder be same as dividend?

1.5k Views Asked by At

I was reading binary division from this site and this statement came across that "remainder will have the same sign as the dividend". But why? Like from the utmost conceptual level, the very basic idea of remainders and negative numbers.

2

There are 2 best solutions below

2
On

It is a very important convention since we usually take our dividends to be positive. This is also in other contexts called the modulus, and the remainder the residue. Thus given a modulus $d> 0$ and an integer $n,$ we have that there are always integers $q$ and $r\ge 0$ such that $$n=qd+r.$$ whatever negativity is absorbed by the first part, in particular with the quotient $q.$

0
On

I'm going to hazard a guess at why someone might adopt a convention that the remainder should have the same sign as the dividend. (As others have noted, the usual convention, when writing $n=qd+r$ is that $0\le r\lt|d|$, where, to fix terminology, $n$ is called the dividend, $q$ the quotient, $d\not=0$ the divisor, and $r$ the remainder. This convention is convenient for most number-theoretic purposes, although occasionally one wants to use the convention $-|d|/2\lt r\le |d|/2$.)

Let's start with a non-controversial example: $17$ divided by $5$. No one, I hope, objects to writing

$$17=3\cdot5+2$$

for the answer. Now the easiest thing to do, if we put a negative sign in front of the $17$, is to write

$$-17=-3\cdot5-2$$

which we can interpret as either

$$-17=(-3)\cdot5-2$$

if we are dividing $-17$ by $5$, or as

$$-17=3\cdot(-5)-2$$

if we are dividing $-17$ by $-5$. (The final combination of signs, $17$ divided by $-5$, is $17=(-3)\cdot(-5)+2$.)

In other words, the convention used in the OP's link begins by taking absolute values of both the dividend and the divisor, does the non-controversial calculation to get absolute values for the quotient and remainder, and then inserts signs in the appropriate places to turn $|n|=|q||d|+|r|$ into $n=qd+r$. The key here is that the final adjustment doesn't affect the digits of any of the numbers, only the numbers' signs. Given the link's computer-sciencey nature, that makes sense as a desirable feature for a convention.