[Math] How to find remainder of denominator is greater than numerator

modular arithmetic

I am learning modular arithmetic and trying to figure out, how to find remainder where denominator is greater than numerator?

For example:

i) $2 \bmod 5 =$ ?

I tried to solve this but I got 0 as remainder whereas in calculators it is $2$ . I was solving it with regular math operators like adding 0 and value after points.

ii) $-2 \bmod 5$ = ?

Also I wanted to know, how to handle negative number in modular arithmetic?

Best Answer

Here is a realisation that helped me out back when I was learning modular arithmetic: Don't think of the symbol $\!\!\!\pmod k$ as an operation, but rather as part of the relation $\equiv$. For instance, $$ 7\equiv 2\pmod 5 $$ doesn't mean that if you take $7$ and apply the "modulo five" operation to it, you get $2$ (or the other way around). It rather means that $7$ and $2$ are in some sense "five-similar", i.e. they are both equally far away from any multiples of $5$. Think $7=_5 2$, if that makes any sense to you.

That way, you can also use, for instance $$ 1974 \equiv -1\pmod 5 $$ which might be helpful since $-1$ is often much easier to handle than $4$ in a lot of arithmetic, like if you were told to calculate $1974^{37}$ modulo $5$.

PS. The phrase "five-similar" is just something I came up with right now, and is not in any way conventional terminology. Unless you explain it, there is real risk that no one will understand it.

Related Question