In our algebra and calculus classes, where we worked in \(\Q\) and \(\R\text{,}\) all non-zero numbers had multiplicative inverses. For example, \(5^{-1} = \frac15\) since \(5^{-1}\cdot 5 = 1\text{.}\) But \(\frac15 \not \in \Z\text{,}\) so itβs not an object that we can use in modular arithmetic.
When weβre working with only integers, in particular in congruence classes modulo an integer \(m\text{,}\) fractions arenβt a thing. Some numbers, though, do have multiplicative inverses. Theyβre special, and we explore them in this section.
Why do we care? At this point, the only algebraic equations we can solve are of the form \(x + b \equiv c\pmod{m}\text{.}\) The multiplicative inverses help us solve the algebraic, affine equations, \(ax + b \equiv c\pmod{m}\text{.}\)
Let \(a\) be an integer and \(m\) a positive integer. We define a multiplicative inverse of \(a\) modulo \(m\) to be an integer \(b\) such that \(ab \equiv 1 \pmod{m}\text{.}\)
Since \(3 \cdot 5\equiv 1 \pmod{7}\text{,}\) we say that \(3\) is a multiplicative inverse of 5 modulo 7. Similarly, 5 is a multiplicative inverse of 3 modulo 7.
We say that \(3\) is a multiplicative inverse, rather than the multiplicative inverse, because every number in the congruence class \([3]_7\) is also an inverse! Observing that \(-4 \in [3]_7\text{,}\) and \(10\in [3]_7\text{,}\) we can check that:
Letβs create a multiplication table modulo 9. The following Sage code does it for us. You can change the variable n to other numbers to quickly generate other multiplication tables.
6 does not have an inverse modulo 9. See in the 6th column (or equivalently, 6th row), that there is never a value 1; no number multiplied by 6 gives 1.
Any number that has a 1 in its row/column has an inverse. These are 1, 2, 4, 5, 7, 8. The other numbers: 3, 6 (and 0) do not have multiplicative inverses.
Computing a multiplication table is tedious if we just want to find a multiplicative inverse to solve a linear congruence. Similarly, guess-and-check is generally inefficient. Now we turn to a powerful fact that gives rise to an algorithm to find inverses.
First, since \(\gcd(11,20)=1\text{,}\) there is a unique solution to this recurrence. Using either the Euclidean Algorithm or guessing-and-checking, notice that \(11\cdot11=121\equiv 1\pmod{20}\text{,}\) so \(11^{-1} \equiv 11\pmod{20}\text{.}\) So we have:
Since \(\gcd(6,10) =2 \ne 1\text{,}\) there isnβt a unique solution! We canβt use the Euclidean Algorithm to find our inverse and instead have to rely on trial and error.
We begin first by finding \(\gcd(8,28)=4\text{,}\) so there will not be a unique solution, but instead zero or four. Because \(4 \divides 20\text{,}\) there will be four solutions reduced modulo 28.
Applying the method of solving congruences with multiple solutions, we need to find the first solution. Running through possible values of \(x = 0, 1, 2, 3\dots\text{,}\) we note that \(8\cdot 6 = 48 \equiv 20 \pmod{28}\) so that \(x_0=6\) is the first solution. Then all solutions will be of the form:
\begin{gather*}
x = 6 + \frac{28t}{4} \text{ for } t \in \Z_4
\end{gather*}
Plug in the values \(t=0, 1, 2, 3\) to find the complete solution set of \(x=6, 13, 20, 27\)
To find the initial solution, test values of \(x=0, 1, 2, \dots\) to find the first solution is \(x_0 = 3\) Applying the formula we find all solutions to be:
\begin{gather*}
x = 3 + \dfrac{49t}{7} \text{ for } t \in \Z_7
\end{gather*}
Plug in the values \(t=0, 1, 2, 3, 4, 5, 6\) to find the complete solution set of \(x=3, 10, 17, 24, 31, 38, 45\)
Here, since the coefficient of \(x\) isnβt relatively prime to the modulus there are either multiple answers per modulus or no solution.
Each of \(x \equiv 2 \pmod{9}\text{,}\)\(x\equiv 5 \pmod{9}\text{,}\) and \(x \equiv 8 \pmod{9}\) satisfy the given equation. We can summarize this as \(x \equiv 2 \pmod{3}\)
Since \(\gcd(3,26) = 1\text{,}\) there is a unique inverse. Using the Euclidean Algorithm we find that \(3^{-1} \equiv 9 \pmod{26}\text{.}\) Doing the algebra:
\begin{align*}
3x \amp= 19 \pmod{26}\\
(3^{-1})3x \amp=(3^{-1}) 19 \pmod{26}\\
x \amp\equiv (9) 19 \pmod{26}\\
x \amp\equiv 171 \pmod{26}\\
x \amp\equiv 15 \pmod{26}
\end{align*}
Here \(\gcd(13, 26) = 2\) so there is no unique solution. Instead, there are either no solutions or two solutions! But since the gcd doesnβt divide \(7\text{,}\) there are in fact no solutions to this congruence.
Since \(\gcd(8, 426) = 2\text{.}\) Like the previous question there are either no solutions or two solutions. This time since the gcd does divide 16, we will have two solutions! The first is obviously \(x=2\text{,}\) and the second will be, applying NoteΒ 3.4.12:
\begin{align*}
x \amp= 2 + \dfrac{426}{2}\\
\amp= 215
\end{align*}
This time the modulus is 425, so we have \(\gcd(425, 8) = 1\) meaning a unique solution exists the system. The Euclidean algorithm finds that \(8^{-1} = -53 \pmod{425}\text{,}\) and solving the expression gives:
\begin{align*}
8x \amp= 16 \pmod{426}\\
(8^{-1})8x \amp=(8^{-1}) 16 \pmod{425}\\
x \amp\equiv (-53) 16 \pmod{425}\\
x \amp\equiv -848 \pmod{425}\\
x \amp\equiv 2 \pmod{425}
\end{align*}
... which actually is both obvious and hilarious. It shows that even if we donβt notice the obvious solution, the method will give us the correct result!
This time, as before, \(\gcd(8, 426) = 2\text{,}\) so there are either zero or two solutions. But since there the gcd doesnβt divide \(23\text{,}\) there is no solution to the congruence.