So, I am studying modular division right now, and I want to clarify one thing.
$a = b \mod m$
and
$a = b \pmod m$
Is the top one $b = mk + a$ ($k$ is an integer)
and the bottom one is $a = mk + b$?
or are both of them used interchangeably?
So, I am studying modular division right now, and I want to clarify one thing.
$a = b \mod m$
and
$a = b \pmod m$
Is the top one $b = mk + a$ ($k$ is an integer)
and the bottom one is $a = mk + b$?
or are both of them used interchangeably?
Sometimes, particularly in computer science, $a \bmod 7$ is used to denote the element in $\{0,1,\ldots,6\}$ that is congruent to $a$ modulo $7$. In this context, $\bmod$ is an operator.
(This relates to programming. In C, the % operator will return a least non-negative residue for non-negative inputs.)
The notation $\pmod 7$ indicates an equivalence relation on the integers, with $a \equiv b \pmod 7$ whenever $7$ divides $a-b$.
Note that the above is not universal. Sometimes $\pmod 7$ is also used for the operator and $\bmod$ is used for the equivalence relation.
\pmod for a binary operator is doing it wrong. That should always be \bmod.
– dfeuer
Sep 23 '13 at 04:27
Both notations are the same and identical.
Also, notice that if $b=mk+a$ then $a=b+m(-k)$. But since we only require $k$ to be an integer, we can write it as $a=b+mq$ where $q=-k$. So both ways of writing are the same from the viewpoint of number theory.
\equiv) is probably better than $=$ in this context. Also, the $a\equiv b \pmod n$ notation seems to be more common than $a\equiv b \mod n$. Finally, the parenthesized version is even less likely to be confused with $a=b\bmod n$ (\bmod), which is a different beast altogether (and more likely to be seen in CS than math). – dfeuer Sep 22 '13 at 23:53