Is there any relationship between remainder obtained through modulo 2 binary division and remainder obtained in a normal decimal division?

853 Views Asked by At

For some cases, modulo 2 binary division is giving the same remainder as a base 10 modulus but for some cases it is not. Is there some relationship between the two remainders? Example:-

1.) q = 101000110100000
p = 110101
modulo 2 binary division remainder = 01110
and  In base 10,
q = 20896
p = 53
and q%p = 14 which is the same as 01110

2.) q = 11001001000
p = 1001
modulo 2 binary division remainder is 011
and In base 10,
q = 1608
p = 9
and q%p = 6 which is different from 011.

So is there some relationship or it is totally unrelated? I want to know if I can derive base 2 modulo division remainder by doing decimal modulus.

1

There are 1 best solutions below

4
On

The ramainder doesn't depend upon the base that you choose to express it. Given two natural numbers $p$ and $q$, the remainder of the division of $p$ by $q$ is the only number $r\in\{0,1,\ldots,q-1\}$ which can be written as $p-d\times q$ for some non-negative integer $d$.