Lecture 13
We’ve developed techniques to find one solution. Euclid’s algorithm gives us that Then, we can work backwards to find a solution to :
So and we multiply both sides by to get or in other words, that , gives a solution.
Now, you might wonder whether this is the only solution.
There’s a way of analysing this. Suppose we have two solutions: Subtracting, we get Dividing out by the greatest common divisor, we get or This means that, as divides the right-hand side, then we also have . But since and are coprime, we have by So we can write . But then we can solve to get , and it’s easy to check that any such works.
Hence the general solution is
While I haven’t stated (and certainly haven’t proved) any theorems about it, this approach works perfectly well in general, as you can imagine.
Common divisors and the gcd
Here’s a useful result about common divisors.
Proposition
Let and be positive integers. Any common divisor of and is a divisor of the greatest common divisor.
Proof
If and , then for any . Hence is a divisor of the numbers obtained after every step of Euclid’s algorithm, and so it is a divisor of the gcd.
We defined the gcd to be the greatest of all common divisors. This property is arguably a more natural one: this says that the gcd is somehow the “best” common divisor.
As an unexpected advantage, if we think of the gcd as being defined in this way, then we can get that . This was undefined previously.
Modular arithmetic
Congruences
Repeatedly over the last few lectures (and the last few problem sheets) we have seen appearances of lots of things like:
odd numbers;
even numbers;
remainders upon division;
numbers of the form or , and so on.
All these things look pretty similar, and it’s time we got ourselves a language for discussing these things better.
Definition: We say that is congruent to modulo if . Often we abbreviate, and say congruent mod .
We use the notation to indicate that and are congruent modulo .
For example, indeed, the fact that these two positive integers have the same last two digits means that their difference is a multiple of .
We can now say that an even number is a number congruent to (modulo ), and an odd number is a number congruent to (modulo ).
Rather than saying that “ is of the form ”, we can say that “ is congruent to , modulo ”.
Arguments about time frequently involve understandings of congruences. For example, I was born on a Sunday, and the closing ceremony of the 2012 Summer Olympics took place on a Sunday too. So the number of days since the former is congruent to the number of days since the latter, modulo .
Notice that saying that is congruent to , modulo , is exactly the same as saying that is a multiple of (since it’s saying that ).
As we’ve defined it, a congruence modulo doesn’t say that two things are equal, just that their difference is a multiple of .
But it does behave suspiciously like an equality, as we’re about to see.