Download Let m be a positive integer. Show that a mod m = b mod m if a ≡ b

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Georg Cantor's first set theory article wikipedia , lookup

Vincent's theorem wikipedia , lookup

List of important publications in mathematics wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

Addition wikipedia , lookup

Fundamental theorem of algebra wikipedia , lookup

Chinese remainder theorem wikipedia , lookup

Theorem wikipedia , lookup

Factorization of polynomials over finite fields wikipedia , lookup

Elementary mathematics wikipedia , lookup

Fermat's Last Theorem wikipedia , lookup

Wiles's proof of Fermat's Last Theorem wikipedia , lookup

Collatz conjecture wikipedia , lookup

List of prime numbers wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Quadratic reciprocity wikipedia , lookup

Transcript
Discrete Mathematics: Solutions to Homework 4
1. (8%) Let m be a positive integer. Show that a mod m = b mod m if a ≡ b (mod m)
Sol:
Assume that a ≡ b (mod m). This means that m|a−b, say a−b = mc, so that a = b+mc.
Now let us compute a mod m. We know that b = qm+r for some nonnegative r less than
m (namely, r = b mod m). Therefore we can write a = qm + r + mc = (q + c)m + r. By
definition this means that r must also equal a mod m. That is what we wanted to prove.
2. (5%) Show that if a ≡ b (mod m) and c ≡ d (mod m), where a, b, c, d, and m are integers
with m≥2, then a − c ≡ b − d (mod m)
Sol:
From a ≡ b (mod m) we know that b = a + sm for some integer s. Similarly, d = c + tm.
Subtracting, we have b − d = (a − c) + (s − t)m, which means that a − c ≡ b − d (mod
m).
3. (3%) Which memory location is assigned by the hashing function h(k) = k mod 101 to
the records of insurance company customers with the Social Security number 104578690?
Sol:
We need to compute k mod 101 by dividing by 101 and finding the remainders. This
can be done with a calculator that keeps 13 digits of accuracy internally. Just divide
the number by 101, subtract off the integer part of the answer, and multiply the fraction
that remains by 101. The result will be almost exactly an integer, and that integer is the
answer, the answer is 58.
4. (4%) Decrypt message EOXH MHDQV encrypted using the Caesar cipher.
Sol:
We just need to “subtract 3” from each letter, i.e., f (p) = (p − 3) mod 26.
For example , E goes down to B, and B goes down to Y. So EOXH MHDQV is decrypted
to BLUE JEANS.
EOXH MHDQV
5 15 24 8 13 8 4 17 22
2 12 21 5 10 5 1 14 19
BLUE JEANS
5. (10%) Determine whether each of these integers is prime, verifying some of Mersenne’s
claims.
(a) (2%) 27 − 1
(b) (2%) 29 − 1
(c) (2%) 211 − 1
(d) (4%) 213 − 1
Sol:
We need to find a factor if there is one, or else check all possible prime divisors up to the
square root of the given number to verify that there is no nontrivial divisor.
(a) 27 − 1 = 127. Division by 2, 3, 5, 7, and 11 shows that these are not factors. since
√
127 < 13, we are done; 127 is prime.
(b) 29 − 1 = 511 = 7 · 73, so the number is not prime.
(c) 211 − 1 = 2047 = 23 · 89, so the number is not prime.
(d) 213 − 1 = 8191. Division by 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53,
√
59, 61, 67, 71, 73, 79, 83 and 89 shows that these are not factors. Since 8191 < 97,
we are done, so 8191 is prime.
6. (4%) If the product of two integers is 27 38 52 711 and their greatest common divisor is
23 34 5, what is their least common multiple?
Sol:
Because the product of the greatest common divisor and the least common multiple of
two numbers is the product of the tow numbers. Therefore the number is (27 · 38 · 52 ·
711 )/(23 · 34 · 5) = 24 · 34 · 5 · 711 .
7. (6%) Use the Euclidean algorithm to find
(a) gcd(123, 277).
(b) gcd(1529, 14038).
Sol:
To apply the Euclidean algorithm, we divide the larger number by the smaller, replace
the larger by the smaller and the smaller by the remainder of this division, and repeat this
process until the remainder is 0. At that point, the smaller number is the greatest common
divisor.
(a) gcd(123, 277) = gcd(123, 31) = gcd(31, 30) = gcd(30, 1) = gcd(1, 0) = 1
(b) gcd(1529, 14038) = gcd(1529, 277) = gcd(277, 144) = gcd(144, 133) = gcd(133, 11) =
gcd(11, 1) = gcd(1, 0) = 1.
8. (6%) Show that 937 is an inverse of 13 modulo 2436.
Sol:
We need to show that 13·937 ≡ 1 (mod 2436), or in other words, that 13·937−1 = 12180
is divisible by 2436. A calculator shows that it is, since 12180 = 2436 · 5.
9. (12%) This exercise outlines a proof of Fermat’s Little Theorem.
(a) Suppose that a is not divisible by the prime p. Show that no two of the integers
1·a, 2·a, · · ·, (p − 1)·a are congruent modulo p.
(b) Conclude from part (a) that the product of 1, 2, · · ·, p−1 is congruent modulo p to the
product of a, 2a, · · ·, (p − 1)a, Use this to show that (p − 1)! ≡ ap−1 (p − 1)! (mod p).
(c) Use Theorem 2 to show from part (b) that ap−1 ≡1 (mod p) if p - a. [Hint:Use
Lemma 2 to show that p does not divide (p − 1)! and then use Theorem 2. Alternatively, use Wilson’s Theorem.]
(d) Use part (c) to show that ap ≡ a(mod p) for all integers a.
Sol:
(a) If two of these integers were congruent modulo p, say ia and ja, where 1 ≤ i < j <
p, then we would have p|ja − ia, or p|(j − i)a. By Lemma 1, since a is not divisible
by p, p must divide j − i. But this is impossible, since j − i is a positive integer less
than p. Therefore no two of these integers are congruent modulo p.
(b) By part (a), since no two of a, 2a, · · · , (p − 1)a are congruent modulo p, each must
be congruent to a different number form 1 to p − 1. Therefore if we multiply them
all together, we will obtain the same product, modulo p, as if we had multiplied all
the numbers from 1 to p − 1. In symbols,
eccgroupecca · 2a · 3a · · · (p − 1)a ≡ 1 · 2 · 3 · · · (p − 1) (mod p).
The left-hand side of this congruence is clearly (p − 1)! · ap−1 , and the right-hand
side is just (p − 1)!, as desired.
(c) Wilson’s Theorem says that (p − 1)! is congruent to −1 modulo p. Therefore the
congruence in part (b) says that (−1) · ap−1 ≡ − 1(mod p). Multiplying both sides
by −1, we see that ap−1 ≡ 1(mod p), as desired.
Note that we already assumed the hypothesis that p - a in part (a).
(d) If p|a, then both sides of ap ≡ a (mod p) are 0 modulo p, so the congruence holds.
If not, then we just multiply the result obtained in part (c) by a
10. (10%) Find all solutions to the system of congruences.
x ≡ 2(mod 3)
x ≡ 1(mod 4)
x ≡ 3(mod 5)
Sol:
Since 3, 4, and 5 are pairwise relatively prime, we can use the Chinese Remainder
Theorem. The answer will be unique module 3·4·5 = 60. Using the notation in the text,
we have a1 = 2, m1 = 3, a2 = 1, m2 = 4, a3 = 3, m3 = 5 m = 60, M1 = 60/3 = 20,
M2 = 60/4 = 15, M3 = 60/5 = 12. Then we need to find inverses yi of Mi modulo mi
for i = 1, 2, 3. This can be done by inspection (trial and error), since the modulo here are
so small, or systematically using the Euclidean algorithm; we find that y1 = 2, y2 = 3,
and y3 = 3. Thus our solution is x = 2·20·2 + 1·15·3 + 3·12·3 = 233 ≡ 53 (mod 60).
So the solutions are all integers of the form 53 + 60k, where k is an integer.
11. (8%) Use the Chinese Remainder Theorem to show that an integer a, with 0 ≤ a <
m = m1 m2 · · ·mn , where the integers m1 , m2 , · · ·, mn are pairwise relatively prime, can
be represented uniquely by the n-tuple (a mod m1 , a mod m2 ,· · ·, a mod mn ).
Sol:
This is just a restatement of the Chinese Remainder Theorem. Given any such a we can
certainly compute a mod m1 , a mod m2 , · · · , a mod mn to represent it. The Chinese
Remainder Theorem says that there is only one nonnegative integer less than m yielding
each n-tuple, so the representation is unique.
12.
(a) (6%) Use Fermat’s Little Theorem to compute 3302 mod 5, 3302 mod 7, and 3302
mod 11
(b) (6%) Use your results from part (a) and the Chinese Remainder Theorem to find
3302 mod 385. (Note that 385 = 5·7·11).
Sol:
(a) By Fermat’s Little Theorem we know that 34 ≡ 1 (mod 5); therefore 3300 =
(34 )75 ≡ 175 ≡ 1 (mod 5), and so 3302 = 32 · 3300 ≡ 9 · 1 = 9 (mod 5), so 3302
mod 5 = 4. Similarly, 36 ≡ 1 (mod 7); therefore 3300 = (36 )50 ≡ 1 (mod 5), and
so 3302 = 32 · 3300 ≡ 9 (mod 7), so 3302 mod 7 = 2. Finally, 310 ≡ 1 (mod 11);
therefore 3300 = (310 )30 ≡ 1 (mod 11), and so 3302 = 32 · 3300 ≡ 9 (mod 11), so
3302 mod 11 = 9.
(b) Since 3302 is congruent to 9 modulo 5, 7, and 11, it is also congruent to 9 modulo 385.
(This was a particularly trivial application of the Chinese Remainder Theorem.)
13.
(a) (6%) Express each nonnegative integer a less than 15 using the pair (a mod 3, a
mod 5)
(b) (6%) Explain how to use the pairs from part (a) to add 4 and 7.
Sol:
(a) It is straightforward to calculate the remainders when the integers from 0 to 14 are
divided by 3 and by 5. For example, the remainders when 10 is divided by 3 and
5 are 1 and 0, respectively, so we represent 10 by the pair (1, 0). The exercise is
simply asking us to tabulate these remainders, as in Example 7 of section 3.7.
eccg0 = (0, 0)eccg3 = (0, 3)eccg6 = (0, 1)eccg9 = (0, 4)eccg12 = (0, 2)
eccg1 = (1, 1)eccg4 = (1, 4)eccg7 = (1, 2)eccg10 = (1, 0)ecc13 = (1, 3)
eccg2 = (2, 2)eccg5 = (2, 0)eccg8 = (2, 3)eccg11 = (2, 1)ecc14 = (2, 4)
(b) To add 4 and 7, we first find that 4 is represented by (1, 4) and 7 is represented by
(1, 2). Adding coordinate-wise, we see that the sum is represented by (1+1, 4+2) =
(2, 6) = (2, 1); we are working modulo 5 in the second coordinate. Then we find
(2, 1) in the table obtained in (a) and see that it represents 11. Therefore we conclude
that 4 + 7 = 11. Note that we can only compute answer less than 3 · 5 = 15 using
this method.
Extra Exercise
1. Show that if a, b, c, and d are integers such that a|c and b|d, then ab|cd.
Sol:
Under the hypotheses, te have c = as and d = bt for some s and t. Multiplying we obtain
cd = ab(st), which means that ab|cd, as desired.
2. What sequence of pseudorandom numbers is generated using the linear congruential generator xn+1 = (4xn + 1) mod 7 with seed x0 = 3?
Sol:
x0 = 3
x1 = 4x0 + 1 mod 7 = 6
x2 = 4x1 + 1 mod 7 = 4
x3 = 4x2 + 1 mod 7 = 3 = x0
3. What are the greatest common divisors and least common multiples of these pairs of
integers?
(a) 22 ·33 ·55 , 25 ·33 ·52
(b) 2·3·5·7·11·13, 211 ·39 ·11·1714
Sol:
(a) gcd(22 ·33 ·55 , 25 ·33 ·52 )= 22 ·33 ·52
lcm(22 ·33 ·55 , 25 ·33 ·52 )= 25 ·33 ·55
(b) gcd(2·3·5·7·11·13, 211 ·39 ·11·1714 )= 2·3·11
lcm(2·3·5·7·11·13, 211 ·39 ·11·1714 )= 211 ·39 ·5·7·11·13·1714