Modular Subtraction and Division
Modular Subtraction
Modular subtraction is a straightforward operation within the realm of modular arithmetic. It follows intuitively from the properties of modular addition.
Definition: Given two integers and , and modulus , the modular subtraction of from modulo is defined as finding an integer such that:
This is equivalent to finding a number that, when added to , gives modulo .
Example:
Find such that . We can calculate directly: . Since , we have .
Modular subtraction is closed under the set of integers modulo m. That is, the result of modular subtraction is always an integer between 0 and m-1.
Modular Division
Modular division is more complex than modular subtraction and is not always defined.
Definition: Given two integers and , and modulus , the modular division of by modulo is defined as finding an integer such that:
This is often called the modular multiplicative inverse of modulo .
Not Always Defined
Unlike modular addition and subtraction, modular division is not always defined. For example, consider the equation There is no integer that satisfies this equation.
Is there a way when the division is possible and when it is not? We will figure this out soon!
The things turn out to be rather complicated. On the one hand, it is bad: it is nice when the computations and calculations are simple. On the other hand, this is good: complicated things are crucial for cryptography.