Why is, for the modulus operation, the notation $A\equiv C \pmod B$ used instead of $A \text{ mod } B = C$? Or alternatively $\text{mod}(A,B) = C$ or, as in many programming languages, $A\text{ } \% \text{ } B = C$.
Why the notation $A\equiv C \pmod B$ instead of $A \text{ mod } B = C$?
111 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 3 best solutions below
On
The notation $m\equiv n\pmod{k}$ means $$ k\mid (m-n) $$ In words, $k$ divides $m-n$.
On the other hand, $m\bmod k$ denotes the unique number $n$ with $0\le n<k$ such that $$m\equiv n\pmod{k}$$ (under a very common convention).
As an example, $42\bmod 8=2$, but we can also write $42\equiv 34\pmod{8}$.
On
The familiar
a % b
or
mod(a, b)
found in many programming languages is a function from the integers to the set $\{0, 1, \ldots, b-1\}$ (or something very similar). That function finds surprisingly little use in mathematics, however, so little that there's no standard notation for it that I know of.
On the other hand, the notion of "equivalence mod $a$", where integers $x$ and $y$ are considered equivalent if their difference $x-y$ happens to be divisible by $a$, comes up a lot, so mathematicians invented a notation for it: they write $$ x \equiv y \bmod a. $$
The "equivalence classes" for this relation, e.g., for $a = 3$, the three sets $$ \{\ldots, -6, -3, 0, 3, 6, \ldots \} \\ \{\ldots, -5, -2, 1, 4, 7, \ldots \} \\ \{\ldots, -4, -1, 2, 5, 8, \ldots\} $$ have the property that each one contains exactly ONE of the numbers between $0$ and $a-1$, so we often use those to indicate which set we're talking about, writing something like
$$ \bar{0} = \{\ldots, -6, -3, 0, 3, 6, \ldots \} \\ \bar{1} =\{\ldots, -5, -2, 1, 4, 7, \ldots\} \\ \bar{2} =\{\ldots, -4, -1, 2, 5, 8, \ldots\} $$
to "name" the equivalence classes. Since there's no easy way, in a computer, to write down an infinite set, programmers decided to use these "names" (dropping the bar) to denote the equivalence class.
Because $A\equiv C\pmod{B}$ and $A\bmod B=C$ mean very different things. The first just says that $A-C$ is a multiple of $B$, so for a given $A$ and $B$ there are infinitely many different values of $C$ making it true. The second says that $C$ is the unique integer in the set $\{0,1,\ldots,B-1\}$ for which $A-C$ is a multiple of $B$.
To put it a bit differently, the first expresses a relation; it’s analogous to the expression $A=C$ that also expresses a relation between $A$ and $C$. The $\bmod$ in the second is a binary operation on its arguments, analogous to the $+$ in $A+B$: like $A+B$, $A\bmod B$ returns a unique value.