Let’s talk about congruences and solutions two concepts that might make your brain hurt but are actually pretty simple once you get the hang of them. Congruence is like a secret handshake between numbers: they have some special relationship with each other that only mathematicians can understand (or at least pretend to).
So, what’s congruent? Well, let’s say we have two numbers, x and y. If the remainder when you divide x by m is equal to the remainder when you divide y by m, then those two numbers are congruent modulo m (or just “congruent” for short).
For example: 17 is congruent to 3 modulo 4 because if we divide both of them by 4 and take the remainder, we get 1 as the remainder for both. On the other hand, 20 is not congruent to 5 modulo 6 because when you divide 20 by 6, the remainder is 0, but when you divide 5 by 6, the remainder is 1.
Now that we know what congruence means, solutions. A solution to a congruence is just any number x that satisfies the original equation (modulo m). For example: if our congruence was 2x + 3 \equiv 7 \pmod{10}, then a possible solution would be x = 5, because when we plug in 5 for x and do the math, we get 2(5) + 3 = 13. When we take the remainder of 13 divided by 10, it’s 3 which is what our original congruence said should happen!
But not all congruences have solutions. For example: if our congruence was 2x \equiv 9 \pmod{5}, then there are no possible values of x that will make this true (because the remainder when you divide 9 by 5 is always 4, and we can’t get a remainder of 0 or 1 with any multiple of 2).
So, how do we solve congruences? Well, it depends on whether there are solutions or not. If there are no possible solutions (like in our example above), then you just have to accept that fact and move on. But if there are solutions, then you can use a technique called “modular arithmetic” to find them.
Here’s an example: let’s say we want to solve the congruence 3x \equiv 12 \pmod{17}. To do this, we first write out all of the numbers from 0 to 16 (because anything greater than that will just repeat itself). Then, for each number on our list, we calculate what happens when we multiply it by 3 and take the remainder when dividing by 17.
Here’s what that looks like:
| x | 0 | 1 | 2 | … | 14 | 15 | 16 |
|—|—|—|—|—|—|—|
| 3x (mod 17) | 0 | 3 | 9 | … | 84 | 111 | 147 |
Now, we look for the first row where our “3x” column matches one of the other columns. In this case, that happens when x = 26 (because if we multiply 26 by 3 and take the remainder when dividing by 17, we get 0). So, x = 26 is a solution to our congruence!
But wait what about all of those other numbers that didn’t match? Well, they don’t matter because if you add or subtract any multiple of 17 from one of the solutions (like adding or subtracting 34), then you get another solution. So, we can just pick any number in our list and add or subtract multiples of 17 until we find a solution that works for us.
And there you have it congruences and solutions!