0

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?

MJD
  • 65,394
  • 39
  • 298
  • 580
More Code
  • 221
  • 2
    They are notations for the same thing, and the two notions you describe are actually identical. – Najib Idrissi Sep 22 '13 at 23:42
  • As @nik says, these are equivalent notations and the expressions for $b$ and $a$ are no different. To see this, let's get $a-b$ on both sides. In your first you have $a-b = -mk$ for some $k$ and in the second you have $a-b = mk'$ for some $k'$. Clearly, $k' = -k$ so these are the same. – Cameron Williams Sep 22 '13 at 23:44
  • 1
    Note that $\equiv$ (\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
  • possible duplicate of What is i (mod p)? – MJD Sep 23 '13 at 01:27

2 Answers2

3

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.

dfeuer
  • 9,069
1

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.

user66733
  • 7,379