In school I learned that there are four basic arithmetic operations: addition, subtraction, multiplication, and division. I always wondered why modulus is not a basic arithmetic operation. Is there any explanation that is also understandable by a math noob?
Why is modulus not a basic arithmetic operation?
-
0An "operation" like addition or subtraction takes _two_ arguments and outputs one number. The term modulus usually is used with complex numbers but with real numbers it is the same as absolute value. The absolute value is a function of _one_ number. – 2012-09-27
4 Answers
When I learned division in elementary school, I learned "remainder" at the same time. I think it is mostly terminological that this is not called an "operation", because the division algorithm produces both the whole number quotient and the remainder of division of two natural numbers, at the same time.
On the other hand, when we move to the rationals, "remainder of division" is no longer a very interesting operation, because the rationals are a field. Students are taught to stop using the division algorithm and start using a different algorithm to divide fractions. This is perhaps a reason that the remainder operation is de-emphasized. But students are certainly still able to compute remainders if they are asked to; they just don't describe it as an "arithmetical operation".
Here’s a suggestion that you may or may not like. The operation you’re talking about, which takes $m$ and $n$ and finds the smallest nonnegative number congruent to $m$ modulo $n$, does not make sense everywhere, in particular in every field, whereas $+$, $-$, $\times$, and $/$ do. Taking residue modulo $n$ does not make sense in any structure that has characteristic $p$, and more generally is extremely problematic in any structure without an order. How could you define your “$z\mod{(2+i)}$” in the ring of Gaussian integers, for instance?
Even in an ordered ring that isn’t a field, like ${\mathbb{Z}}_{(2)}$, which is the set of all rational numbers with only odd numbers in the denominator, what would your “$2/3\mod{2}$” be? Some of the commenters would seem to accept $2/3$ as the value, but any algebraist would say that it should be $0$, because $2/3$ is in the unique maximal ideal of the local ring ${\mathbb{Z}}_{(2)}$.
If you're thinking of treating $x\pmod{y}$ as a binary operation, then that operation is not commutative or even associative on the integers. It also looks like it can't have an identity (on the right or on the left).
If that's the operation you have in mind, then it's really badly behaved: it's just not in the same class with the usual operations.
Further note of explanation While writing this I completely forgot about the viewpoint of subtraction and division as operations in their own right. This is mainly because long ago I let them blur into addition and multiplication and promptly forgot about them. They are a little bit like this!
However there doesn't seem to be any analogue of "addition" or "multiplication" in the case of "mod as an operation", so I'm still inclined to say it's not of the same class.
-
1Wow, this is the smarmiest downvote I've ever gotten :) – 2012-09-24
I'll tell you exactly why :)
Imagine the most fundamental type of modulus which is called the least common positive residue. An example is 23 mod 5 which is equal to 3. It's the smallest (least) positive number that satisfies the mod.
Then you can show that for a least common positive residue that x mod y is the same as x-y(floor(x/y)). For our example I'll plug the example in for you.
23 -5(floor(23/5))
23 -5(floor(4.6))
Note: floor is a special kind of rounding which means to aggressively round down at the decimal so 4.6 goes to 4. No matter the decimal place in floor you cut it. Ceiling is opposite it means to aggressively round up, so 4.1 will become 5 in ceiling, the only exception is 4.0 in ceiling will be 4. Now we continue.
23 -5(4) 23 - 20 = 3
So now you know that the reason mod isn't considered a basic operation is because it involves the use of subtraction, multiplication, division, and aggressive rounding.
It's possible that you can consider the modulus to be an algorithm instead of an operation.