Section 4.3 Solving Congruences
Objectives
- Determine if an integer has a multiplicative inverse, and find it if it exists.
- Solve linear congruences by using properties of congruence and/or finding the multiplicative inverse.
Video: Solving Congruences
When we are asked to solve for
Example 4.3.1. Solving for .
Solve for \(x\) in the congruence \(2x \equiv 4 \Mod{9}\text{.}\)
Before looking at the solution, try it yourself first! What value(s) of \(x\) will satisfy the congruence?
We need to find all values of \(x\) so that \(9 \mid (2x - 4)\text{,}\) or \(9 \mid 2(x-2)\text{.}\)
Since \(\gcd(2,9) = 1\text{,}\) by Checkpoint 1.3.13 we have \(9 \mid (x-2)\text{,}\) which means \(x \equiv 2 \Mod{9}\text{.}\)
Note that this is no different from applying Proposition 4.2.15 directly: since \(\gcd(2,9) = 1\text{,}\) we can safely divide both sides by 2 to obtain \(x \equiv 2 \Mod{9}\text{.}\)
This means that the congruence class \([2]\) is the solution to \(2x \equiv 4 \Mod{9}\text{,}\) or that all integers in \(\{\ldots,-16,-7,2,11,\ldots\}\) satisfy the congruence.
The final answer in the above example is typical of solutions to congruences: since we are working modulo
Example 4.3.2. Solve for .
Solve the congruence
and express your answer using congruence classes of the original modulus.
We can apply Proposition 4.2.15 here to divide through by 2, and we get
Modulo 10, this is the same as
So the original congruence has two solutions in \(\{[0],[1],\ldots,[9]\}\text{,}\) namely \([3]\) and \([8]\text{.}\)
Checkpoint 4.3.3. Solve Each Congruence.
Solve each congruence for \(x\text{,}\) paying special attention to your usage of Proposition 4.2.15.
- \(\displaystyle 3x \equiv 9 \Mod{10}\)
- \(\displaystyle 5x + 2 \equiv 27 \Mod{15}\)
- \(\displaystyle -11x - 3 \equiv 30 \Mod{7}\)
Checkpoint 4.3.4. Solve Another One.
Proposition 4.2.15 cannot be used to solve the congruence
since we cannot divide both sides by 2.
Solve the congruence by trial-and-error.
There are only 7 congruence classes to check, since we are working modulo 7.
Video: Multiplicative Inverses
We've seen that dividing both sides by a constant is not always possible. Recall instead that in the real numbers, division by a nonzero number
We define a similar concept for modular arithmetic.
Definition 4.3.5. Multiplicative Inverse.
Given natural numbers
We can denote this inverse as
In Definition 4.3.5 we are really saying that any number in
where
Checkpoint 4.3.6. Checkpoint 4.3.4 Again.
Show that modulo 7, any number in \([4]\) is a multiplicative inverse of 2. Then use this fact to solve the congruence
from Checkpoint 4.3.4.
You may have noticed that in Definition 4.3.5 we required that
Checkpoint 4.3.7. When does have an Inverse Modulo
Let \(a, n \in \mathbb{N}\text{.}\) Prove that \(a\) has an inverse modulo \(n\) if and only if \(\gcd(a,n) = 1\text{.}\)
Prove both directions separately. Theorem 1.3.7 will be useful in both cases.
For brevity, we make use of the following terminology for integers that have inverses under a particular modulus.
Definition 4.3.8. Unit Modulo .
If Checkpoint 4.3.9. The Multiplicative Inverse is Unique.
Given \(a, n \in \mathbb{N}\) such that \(\gcd(a,n) = 1\text{,}\) prove that the multiplicative inverse of \(a\) modulo \(n\) is unique (up to congruence class).
Assume that \(c\) and \(d\) are both multiplicative inverses of \(a\) modulo \(n\text{.}\) Show that \(c \equiv d \Mod{n}\text{.}\)
Checkpoint 4.3.10. Uniqueness of Solutions.
Use the previous exercise to argue that
has a unique solution (up to congruence class) if \(\gcd(a,n) = 1\text{.}\)
Does the converse hold? That is, if we know that
has a unique solution, can we conclude that \(\gcd(a,n) = 1\text{?}\)
Checkpoint 4.3.11. Solve These Congruences.
Solve the congruences:
- \(\displaystyle 5x - 7 \equiv 9 \Mod{11}\)
- \(\displaystyle 3 - 2x \equiv 3 - 5x \Mod{7}\)
- \(\displaystyle 21x + 35 \equiv 9 \Mod{19}\)
Checkpoint 4.3.12. How Many Solutions?
Since \(\gcd(6,16) \gt 1\text{,}\) the number 6 has no multiplicative inverse modulo 16. Solve the congruences
and
How many solutions do you get for each one (modulo 16)?