Read · 1 min
How can we solve linear congruences? A tool that comes handy when it comes to solving congruences is a multiplicative inverse. A multiplicative inverse for in modulo exists if and only if . A multiplicative inverse for is denoted as where
If the numbers are small enough, it will usually be easy to find the multiplicative inverse by guessing and checking. However, there is a way where you will find it for sure, but may take a bit longer. So now let's go through a problem.
Solve for .
Solution: Like what we would do for linear equations with integers, subtract from each side, resulting in . If you realize the multiplicative inverse of modulo is , because , then we can multiply each side by resulting in
However, if we didn't realize that the multiplicative inverse of is , then we know that we are looking for some integers and such that . Recall that we said that was a requirement for the equation to be solvable. This agrees with Bezout's Lemma, which says that this equation has an integer solution.
Now let's find that solution. By the division algorithm, we know Substituting the first equation into the second and expanding, we have So, we know that . Then, we proceed in the same way. Note that this is just a small example, so it is easily guessible. When the numbers get larger, this will be more practical.
Most linear congruences can be solved this way, however, the congruences in the form where is not equal to cannot be solved using multiplicative inverses, since there is no inverse when is not equal to , as shown in the solution.