Glam Prestige Journal

Bright entertainment trends with youth appeal.

$\begingroup$

I need to calculate $2$ modulus $3$ as $2<3$ then the answer should be $2$ but instead in a math problem they use it as $-1$. Is this possible? thanks

$\endgroup$ 4

1 Answer

$\begingroup$

The mathematical expression $a \equiv b \pmod c$, which is read "$a$ is equivalent to $b$ modulo $c$", means that $c$ divides the difference $b - a$ (or $a - b$, since it cannot divide one without dividing the other). So because $(2) - (-1) = 3$ is a multiple of $3$, we get $2 \equiv -1 \pmod 3$. Indeed $$\ldots \equiv -7\equiv -4 \equiv -1 \equiv 2 \equiv 5 \equiv 8\equiv \ldots \pmod 3$$ So it is not a single number equivalent to $2 \bmod 3$, but an entire class of numbers.

Sometimes - particularly when dealing with computers - it is useful to have a single representative of that class instead of the whole thing. Such a representative value is called a "residue", and a "complete set of residues" is a value for all possible classes modulo $c$. Now the most obvious choice for a complete set of residues is the values $\{0, 1, \ldots, c-1\}$. But this is only one possible choice, and depending on the problem at hand, it may not be the most convenient choice. So there is no universally established convention here.

In computer science, you don't have the luxury of redefining the meaning according to the problem at hand. So most computer languages will define $a \bmod b$ to be the residue between $0$ and $b$. But in mathematics such notations can vary with the context. So somewhere around this proof, or in the book or course it came from, they should have specified a meaning (unless you mixed up the notation "$-1 \equiv 2 \pmod 3$" with the notation "$2\bmod 3$").

$\endgroup$ 4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy