Modular Inverses
Multiplicative inverse
Let be our set that has some notion of multiplication and a neutral element , such that for all elements . Then a multiplicative inverse of an element is defined as follows:
If is number such that the multiplicative inverse exists, then we define division by a simply as multiplication by the inverse:
In modular arithmetic, a number has a multiplicative inverse if and only if and are coprime. Since in that case, we know from the Extended Euclidean Algorithm that there are numbers and , such that the following equation holds:
If we take the modulus on both sides, the term vanishes, which tells us that is the multiplicative inverse of in modular arithmetic.
The situation where the modulus is a prime number is of particular interest, because in these cases, all remainder classes must have modular inverses, since for prime and any . In fact, Fermat’s Little Theorem provides a way to compute multiplicative inverses in this situation, since, in case of a prime modulus and , we get the following:
This tells us that the multiplicative inverse of a residue class in modular arithmetic is precisely .
Additive inverse
The definition of multiplicative inverse has an analog definition for addition called the additive inverse. In the case of integers, the neutral element with respect to addition is 0, since for all integers . The additive inverse always exists, and is given by the negative number , since .
Last updated