Can someone tell me what's the exact correct way to read the following:
7=2 mod(5)?
Sometimes I see:
7 = 2 mod(5) = 12 mod(5)
and I get confused how to read this or what it means...
Can someone tell me what's the exact correct way to read the following:
7=2 mod(5)?
Sometimes I see:
7 = 2 mod(5) = 12 mod(5)
and I get confused how to read this or what it means...
For a modulus $m$ and a number $x$ let consider the Euclidean division $x=mq+r$
with $q\in\mathbb Z$ and $0\le r\le m-1$, when I use $q$ and $r$ in what's follow, I refer specifically to these ones.
There are two notations:
Notice an equal sign is employed and the result is always $r$.
The mathjax code is x \bmod m = r
.
This operation consist in returning the reminder in the euclidean division.
Notice a congruent sign $\equiv$ is employed, that we used parenthesis.
The mathjax code is x\equiv y\pmod{m}
.
However here, it is not mandatory to have $y=r$, the following are also true, $x\equiv y+m\pmod{m}$, $\ x\equiv y-m\pmod{m}$, $\ x\equiv r+10m\pmod{m}$, $\cdots$
We have the definition
$$x\equiv y\pmod{m}\iff \exists k\in\mathbb Z\mid x=mk+y$$
In particular, $k$ can be any integer, not necessarily $q$ (and then $k=q\iff y=r$).
So you can use it like that for instance, chaining $\equiv$ signs and just write the modulus once at the end:
$6^2\equiv 36\equiv 35+1\equiv 7\times 5+1\equiv 1\pmod 7$
$6^2\equiv (7-1)^2\equiv (-1)^2\equiv 1\pmod 7$
Of course the goal is often ultimately to reduce $x$ to its reminder $r$, but you can use other $y$ for intermediary results (here for instance $y=-1$ is exploited profitably in the second reduction of $6^2$).
x\pmod 13
$x\pmod 13$ versus x\pmod {13}
$x\pmod{13}$, so I put it back.
– zwim
Oct 30 '21 at 20:38
The notation is what it is, even if it is a bit awkward.
Ideally you would have a better "infix" relational symbol for $x\equiv y\pmod m$, e.g. something like $x\equiv_m y$. That would enable you to write things like:
$$\begin{array}{rcl}7&\equiv_5&2\\&\equiv_5&12\end{array}$$
However, this is uncommon, and all we usually have is the traditional notation:
$$\begin{array}{rcll}7&\equiv&2&\pmod 5\\&\equiv&12&\pmod 5\end{array}$$
(with some people even putting $=$ instead of $\equiv$, and putting the whole lot into a single line - which all adds to confusion).
\pmod
and \bmod
and \mod
. For example, 7\equiv 2\pmod 5
$\rightarrow 7\equiv 2\pmod 5\ \ $
– Bill Dubuque
Oct 30 '21 at 17:49
is obtained with the command
\equiv. The notation of your last example is not quite correct for me; one should write
mod 5` only once, at the end. – Bernard Oct 30 '21 at 13:08