1
$\begingroup$

In the remark section of my textbook, it says that $a \space \mathbf{div} \space d = \lfloor a/d\rfloor$ and $a \space \mathbf {mod}\space d = a - d$.

Take $a = 15$ and $d = 4 \gt 0$.

$$15 \space \mathbf{div} \space 4 =\lfloor15/4\rfloor = 3$$

$$15 \space \mathbf {mod}\space 4 = 3 \neq 15 - 4 = 11$$

Am I mistaken?

enter image description here

$\endgroup$
  • $\begingroup$ It probably is ${a \bmod d=a−d*q }$ $\endgroup$ – Zang MingJie Oct 26 '18 at 7:56
  • $\begingroup$ You are right, there's a typo. $3=15-4\color{red}{\cdot3}$. $\endgroup$ – Yves Daoust Oct 26 '18 at 8:34
0
$\begingroup$

You're right. The solution at the bottom of the page contradicts the definition of $\textrm{mod}$ given in the remark. In fact, $a \, \textrm{mod} \, b = a - a \, \textrm{div} \, d$

$\endgroup$
  • $\begingroup$ Ok, good. That's quite the error though. $\endgroup$ – Art Oct 26 '18 at 7:55
  • $\begingroup$ @Art I agree, that's a big mistake for a textbook! $\endgroup$ – Sam Streeter Oct 26 '18 at 7:57
0
$\begingroup$

You are true. Nevertheless, this is a good introduction to modular notation. Let us define a new operation with this notation "$\equiv$". We say that $a \equiv b \pmod m$ if $m |(a-b)$. Notice that, in this new definition, $3\equiv 7 \equiv 11 \equiv 15 \equiv 4k + 3 \pmod 4$ for any integer $k$. Meaning that $4|(7-3)$ and $4|(11-7)$ and also $4|(11-4)$ and so on. This notation is pronounced congruent to. Therefore, we say that $a$ is congruent to $b$ mod $m$ meaning that $a \equiv b \pmod m$.

$\endgroup$
0
$\begingroup$

For any $q$, $$a=qd+a-qd.$$

The quotient is the largest number for which the term $a-qd$ is positive, and we have

$$a=(a\,\mathbf{div}\,d)\,d+a-(a\,\mathbf{div}\,d)\,d=(a\,\mathbf{div}\,d)\,d+a\,\mathbf{mod}\,d,$$ with $$0\le a-(a\,\mathbf{div}\,d)\,d=a\,\mathbf{mod}\,d<d.$$

$\endgroup$
0
$\begingroup$

You are right. It should be $a\bmod d=a-qd$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.