-2

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...

Bill Dubuque
  • 272,048
Roy
  • 9
  • Welcome to Maths SX! First, it should be written as $;7\equiv 2\pmod 5$. It is read as ‘$7$ is congruent to $2$ modulo $5$’. It simply means that $7$ and $2$ have the same remainder when divided by $5$. – Bernard Oct 30 '21 at 09:51
  • @Bernard so it's the same as writing: 7 mod(5) ≡ 2 mod(5)? – Roy Oct 30 '21 at 10:17
  • what about the way this is read when we have multiple '≡' like example 2? – Roy Oct 30 '21 at 10:18
  • When you write $7\bmod{(5)}=2\bmod{(5)}$ (you shouldn't use $:\equiv:$ in this case), it means that $7$ and $2$ have the same congruence class. F.y.i., the notation $èquivis obtained with the command\equiv. The notation of your last example is not quite correct for me; one should writemod 5` only once, at the end. – Bernard Oct 30 '21 at 13:08
  • Standard notation is $, 7\equiv 2\pmod{! 5}.,$ or $,7\bmod 5 = 2,$ for your first, and $,7\equiv 2\equiv 12\pmod{! 5}$ for your second. See the linked dupe for further detail. – Bill Dubuque Oct 30 '21 at 17:39

2 Answers2

0

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:

  • one is an operation, you write it $\quad x \bmod m=r$

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.


  • the other is an equivalence, you write it $\quad x\equiv y\pmod{m}$

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$).

zwim
  • 28,563
  • 1
    I corrected the \mods to '\bmods – Bill Dubuque Oct 30 '21 at 17:54
  • @BillDubuque Yes, thanks. There indeed should be no space between x and mod in this case. However you removed curly braces after pmod, they are mandatory for numbers with more than 1 digit, e.g. 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
  • Yes, but the braces were not needed in the case where I removed them. Ditto for the bmod case above it. – Bill Dubuque Oct 30 '21 at 20:42
0

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).

  • @OP Beware that the above is non-traditional due to the huge amount of whitespace used in the displayed congruences. Note that $\LaTeX$ has built-in commands for traditional notation, viz. \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