3.3 Solving Simultaneous Pairs of Linear Congruences

advertisement
3.3 Solving Simultaneous Pairs of Linear Congruences
Consider the two linear congruences
x ≡ 2 mod 5
and
x ≡ 1 mod 3.
Integers satisfying the first congruence include
... − 8, −5, 2, 7, 12, 17, 22, 27, 32, .. .
Those satisfying the second include
.. − 8, −5, −3, 1, 4, 7, 10, 13, 16, 19, 22, .. .
So −8, 7 and 22 satisfy both congruences simultaneously. What other
integers satisfy both simultaneously?
Example Solve the system
x ≡ 2 mod 5
and
x ≡ 1 mod 3.
Solution Write x ≡ 2 mod 5 as x = 2 + 5k for some k ∈ Z and write
x ≡ 1 mod 3 as x = 1 + 3` for some ` ∈ Z. Equate to get 2 + 5k = 1 + 3`, or
3` − 5k = 1. We could solve this using Euclid’s Algorithm, though here it is
as easy to stare and see that ` = 2, k = 1, is a solution, while
(k, `) = (1 + 3t, 2 + 5t) , t ∈ Z
is the general solution. Thus the x that satisfy both congruences are
x = 2 + 5 (1 + 3t) = 7 + 15t, t ∈ Z,
i.e. x ≡ 7 mod 15.
Example for student. Solve
x ≡ 16 mod 17 and x ≡ 3 mod 13.
Example Now consider
x ≡ 2 mod 6 and
x ≡ 1 mod 4.
Integers satisfying the first congruence include
..., 2, 8, 14, 20, 26, ...
1
while
..., 1, 5, 9, 13, 17, 21, ...
satisfy the second. These lists have nothing in common, the first contains
even integers the second odd integers. Thus there are no simultaneous solutions to the two congruences.
We exclude this second example by demanding that the moduli of the
two congruences are coprime. If we do that we can show that the system
always has a solution:
Theorem Chinese Remainder Theorem
Let m1 and m2 be coprime integers, and a1 , a2 integers. Then the simultaneous congruences
x ≡ a1 mod m1 and x ≡ a2 mod m2
have exactly one solution with 0 ≤ x ≤ m1 m2 − 1.
Proof Not given in this course.
3.4 Solving Simultaneous Triplets of Linear Congruences
Example Solve the system
2x ≡ 3 mod 5, 3x ≡ 4 mod 7 and 5x ≡ 7 mod 11.
Solution Left to students, but do in pairs. So first solve
2x ≡ 3 mod 5 and 3x ≡ 4 mod 7,
getting x ≡ 34 mod 35. Next solve
x ≡ 34 mod 35 and 5x ≡ 7 mod 11
getting what?
You should never get such questions wrong, since you can substitute your
answer back into the original congruences to see it works.
3.5 Non-linear congruences
As an example of the use of congruences we can use them to show when
some Diophantine equations do not have a solution. This is quite a negative
application - we do not prove that the equations have solutions.
2
Idea Given a Diophantine Equation first assume it has integer solutions.
Then look at the equation modulo an appropriate modulus.
Find a contradiction.
Example Show there are no integer solutions to 166361x + 4043y = 25.
Solution Assume it has integer solution. Look at the equation modulo
13. Both 166361 and 4043 are divisible by 13 (as seen in previous Chapter) and so the left hand side of the equation is ≡ 0 mod 13. But the right
hand side is 25 ≡ 12 mod 13. Thus the equation becomes 0 ≡ 12 mod 13, a
contradiction.
We actually proved this result in the previous Chapter. The hardest past
of this method is choosing the appropriate modulus.
Though in this course we do not show how to solve non-linear congruences,
we can show when such congruences have no solutions.
Example (c.f. PJE problem 19.2.6, p.236) There are no integral solutions
to 15x2 − 7y 2 = 1.
Solution Assume there is a solution (x0 , y0 ) ∈ Z2 , so 15x20 − 7y02 = 1.
Look at the equation modulo 7, to get 15x20 ≡ 1 mod 7 or x20 ≡ 1 mod 7.
Looking at the possible values of x mod 7 we see
x mod 7 x2 mod 7
0
0
1
1
2
4
3
2
4
2
4
5
6
1
Hence x0 ≡ 1 or 6 mod 7. Unfortunately this doesn’t tell us that the original
equation has no solutions.
Look at the equation modulo 3, to get −7y02 ≡ 1 mod 3 or 2y02 ≡ 1 mod 3.
We see if this is possible or not by testing each possible value for y.
y mod 3 2y 2 mod 3
0
0
1
2
2
2.
In no case do we get 2y 2 ≡ 1 mod 3. So our assumption that 15x2 − 7y 2 = 1
has a solution has led to a contradiction. Hence it has no integer solutions.
3
Example (for student) Show that 2a3 − 5b3 = 1 has no integer solutions.
Hint Look at the equation modulo 7.
The question now is, how do we find the appropriate modulus?
There is no method for finding the right modulus, we have to look at
the original equation with different moduli, trying to find a case that has
no solutions. If, for all moduli we choose, the resulting congruence has a
solution there is a chance that the original equation has solutions, but if so
these have to be found by other means.
4
Appendix
1) An example of the use of congruences:
Example Show that the integer ar ar−1 ...a2 a1 a0 (r ≥ 2) in decimal notation
is divisible by 11 if, and only if, ar (−1)r + ar−1 (−1)r−1 + ... + a2 − a1 + a0
is divisible by 11.
Solution First note that if a ≡ b mod 11 and 11|b then 11|a. So it suffices
to prove that
ar ar−1 ...a2 a1 a0 ≡ ar (−1)r + ar−1 (−1)r−1 + ... + a2 − a1 + a0 mod 11.
Next note that 10 ≡ −1 mod 11 and so 10n ≡ (−1)n mod 11 for all n ≥ 1.
Thus
ar ar−1 ...a2 a1 a0 = ar 10r + ar−1 10r−1 + ... + a2 102 + a1 10 + a0
≡ ar (−1)r + ar−1 (−1)r−1 + ...
... + a2 (−1)2 + a1 (−1) + a0 mod 11
≡ ar (−1)r + ar−1 (−1)r−1 + ... + a2 − a1 + a0 mod 11,
as required.
Particular example of the use of this test 1 Is 240 − 1 divisible by 11?
From a calculator 240 − 1 = 1099511627775. Here r = 12 and so we
consider
1 − 0 + 9 − 9 + 5 − 1 + 1 − 6 + 2 − 7 + 7 − 7 + 5 = 0.
This is divisible by 11 as, is thus, 240 − 1.
Question for students. Find other factors of 240 − 1.
Particular example of the use of this test 2. Is 235 + 1 divisible by 11?
From a calculator 235 + 1 = 34359738369. Hence r = 10 and so we
consider
3 − 4 + 3 − 5 + 9 − 7 + 3 − 8 + 3 − 6 + 9 = 0.
This is divisible by 11 as is thus 235 + 1.
Question for students. Use the method of successive squaring to find 235 mod 11
and thus give an alternative proof of 235 + 1 ≡ 0 mod 11.
5
2) Theorem Chinese Remainder Theorem (for two linear congruences)
Let m1 and m2 be coprime integers, and a1 , a2 integers. Then the simultaneous congruences
x ≡ a1 mod m1 and
x ≡ a2 mod m2
have exactly one solution with 0 ≤ x ≤ m1 m2 − 1.
Proof Not given in this course. (Not in PJE) Since (m1 , m2 ) = 1 we can
find integers b1 , b2 such that
m2 b1 ≡ 1 mod m1 and
m1 b2 ≡ 1 mod m2 .
Set
x∗ = m2 b1 a1 + m1 b2 a2 .
Then x∗ ≡ (m2 b1 ) a1 ≡ a1 mod m1 and x∗ ≡ (m1 b2 ) a2 ≡ a2 mod m2 .
Of course, this x∗ may not lie between 0 and m1 m2 − 1. But if y ∗ is
another common solution to the system of congruences then x∗ ≡ y ∗ mod m1
and x∗ ≡ y ∗ mod m2 . So both m1 and m2 divide x∗ − y ∗ . Since (m1 , m2 ) = 1
we must have m1 m2 divides x∗ − y ∗ , so only one such solution lies between
0 and m1 m2 − 1.
Example Solve
x ≡ 16 mod 17 and x ≡ 3 mod 13.
Solution using the Chinese Remainder Theorem. Need solve 13b1 ≡ 1 mod 17
and 17b2 ≡ 1 mod 13, that is 4b2 ≡ 1 mod 13.
The first congruence can be written as −4b1 ≡ 1 mod 17 for which we
note that −4 × 4 = −16 ≡ 1 mod 17 so b1 = 4.
For the second congruence note that 4 × (−3) = −12 ≡ 1 mod 13. So we
take b2 = −3 ≡ 10 mod 13.
Finally evaluate x∗ = 13 × 4 × 16 + 17 × 10 × 3 = 1342 ≡ 16 mod 221.
Example for student. Solve
x ≡ 16 mod 17 and x ≡ 3 mod 13
using the method in the notes.
It should be apparent that the Chinese Remainder Theorem was a far
more involved process. Its virtue is that it can be generalized to systems of
any number of linear congruences.
6
Theorem Chinese Remainder Theorem (for n linear congruences)
Let m1 , m2 , ..., mn be integers such that ******, and a1 , a2 , ..., an integers.
Then the simultaneous congruences
x ≡ a1 mod m1 ,
x ≡ a2 mod m2 ,
..
.
x ≡ an mod mn
have exactly one solution with 0 ≤ x ≤ m1 m2 ...mn − 1.
Proof not given here.
3) a) Other factors of 240 − 1?
We know 11 is a factor, and
240 − 1
= 99955602525.
11
A number that ends in 5 is divisible by 5:
99955602525
= 19991120505.
5
And again
19991120505
= 3998224101.
5
You may know the result that if the sums of the digits of a number is divisible
by 3 then so is the original number. In this case
3 + 9 + 9 + 8 + 2 + 2 + 4 + 1 + 0 + 1 = 39
a multiple of 3, so
3998224101
= 1332741367.
3
We have now run out of tricks. In fact
1332741367 = 17 × 31 × 41 × 61681,
where 61681 has no further factors. Hence
240 − 1 = 3 × 52 × 11 × 17 × 31 × 41 × 61681.
7
b) Other factors of 235 + 1 :
235 + 1 = 3 × 11 × 43 × 281 × 86171.
4) Example (for student) Show that
Solutioni)
a mod 7
0
1
2
3
4
5
6
2a3 − 5b3 = 1 has no integer solutions.
a3 mod 7
0
1
1
6
1
6
6
Hence
a3 ≡ 0, 1 or 4 mod 7.
Thus
a3 mod 7
0
0
1
1
0
6
6
1
6
b3 mod 7
0
1
0
1
6
0
6
6
1
2a3 − 5b3 mod 7
0
−5 ≡ 2
2
−3 ≡ 4
−30 ≡ 5
12 ≡ 5
−18 ≡ 3
−28 ≡ 0
7 ≡ 0.
In no row do we see a final result of 1, hence 2a3 − 5b3 is never ≡ 1 mod 7,
hence no n ≡ 1 mod 7 can be written as 2a3 − 5b3 for integers a and b.
8
Download