Download Here

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

Vincent's theorem wikipedia , lookup

Algorithm wikipedia , lookup

Fundamental theorem of algebra wikipedia , lookup

System of polynomial equations wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Factorization wikipedia , lookup

List of prime numbers wikipedia , lookup

Factorization of polynomials over finite fields wikipedia , lookup

Transcript
Homework 3 solutions, 550.371 Cryptology, Spring 2017
MATLAB code for Problems 1 and 2 are in an accompanying file.
Problem 3: [Trappe and Washington textbook, Section 3.13 on page 104, Problem 4]
a) Use the Euclidean Algorithm to compute gcd(30030, 257).
Solution: The following table contains Extended Euclid Algorithm iterate’s values:
iteration j
aj
0
2
3
4
5
6
7
8 9
30030 257 218
39
23
16
7
2
1 0
qj
1
116
1
5
1
1
2
3
2
1
1
6
7
13
33
112
xj
1
0
yj
0
1 116 117 701 818 1519 3856 13087
In particular, gcd(30030, 257) = 1. Incidentally, the integer combination of these numbers yielding 1
is: (112)(30030) + (−13087)(257) = 1.
b) Using the result of part (a), and the fact that 30030 = 2 · 3 · 5 · 7 · 11 · 13, show that 257 is prime.
Solution: To see if a number n is prime it is sufficient to check all primes less than or equal to
√
n to see if any are divisors of n; this is because if a number is composite and all primes in its
√
prime decomposition (at least two primes) are greater than n then, multiplying out we would get
√
√ √
n > n · n · · ·, a contradiction. Here, 257 = 16.03, thus primality of 257 may be verified by checking that the primes less than 17 are not divisors of 257. Indeed, as 30030 is the product of all of these
primes less than 17 and it doesn’t have a common prime divisor with 257, we conclude that 257 is prime.
Problem 4: [Trappe and Washington textbook, Section 3.13 on page 104, Problem 5]
a) Compute gcd(4883, 4369).
Solution: The following table contains Extended Euclid Algorithm iterate’s values:
iteration j
aj
0
1
2
3 4
4883 4369 514 257 0
qj
1
8
2
xj
1
0
1
8
yj
0
1
1
9
In particular, gcd(4883, 4369) = 257. Incidentally, the integer combination of these numbers yielding
257 is: (−8)(4883) + (9)(4369) = 257.
1
b) Factor 4883 and 4369 into products of primes.
Solution: Knowing (from previous problem) that 257 is prime and is a divisor of 4883 and 4369,
we divide 4883/257 and get 19 (a prime number), we divide 4369/257 and get 17 (a prime number).
Hence the desired prime decompositions are 4883 = 19 · 257 and 4369 = 17 · 257.
Problem 5: [Trappe and Washington textbook, Section 3.13 on page 104, Problem 6]
a) Let F1 = 1, F2 = 1, Fn+1 = Fn + Fn−1 define the Fibonacci numbers 1, 1, 2, 3, 5, 8, . . .. Use the
Euclidean Algorithm to compute gcd(Fn , Fn−1 ) for all n ≥ 1.
Solution: Note that, for all n ≥ 3, Fn+1 = 1 · Fn + Fn−1 is a division of Fn into Fn+1 with remainder
Fn−1 , since 0 ≤ Fn−1 < Fn . Thus, following Euclid Algorithm, gcd(Fn , Fn−1 ) = gcd(Fn−1 , Fn−2 ) =
gcd(Fn−2 , Fn−3 ) = gcd(2, 1) = 1.
b) Find gcd(11111111, 11111).
Solution: Euclid Algorithm iterates are 11111111, 11111, 111, 11, 1, 0, so gcd(11111111, 11111) = 1.
c) Let a = 111 · · · 11 be formed with Fn repeated 1’s, and let b = 111 · · · 11 be formed with Fn−1
repeated 1’s. Find gcd(a, b).
Solution: For all n, let Gn denote the number 111 · · · 1 formed with Fn ones. Note that, for all n ≥ 3,
the equation Gn+1 = 10Fn−1 · Gn + Gn−1 is a division of Gn into Gn+1 since the remainder Gn−1
satisfies 0 ≤ Gn−1 < Gn . Thus, following Euclid Algorithm, gcd(Gn , Gn−1 ) = gcd(Gn−1 , Gn−2 ) =
gcd(Gn−2 , Gn−3 ) = gcd(11, 1) = 1.
Problem 6:
a) (Due to F. Gobbo) Consider the polynomial p(x) = 8x2 − 488x + 7243. For x = 0, 1, 2, . . . , 61
compute p(x) and see if its absolute value is prime. You may use MATLAB’s “isprime” command.
b) (Due to E. Pegg) Consider the polynomial p(x) = x4 + 29x2 + 101. For x = 0, 1, 2, . . . , 19 compute
p(x) and see if it is prime. You may use MATLAB’s “isprime” command.
c) Prove that there does not exist a nonconstant polynomial q(x) with integer coefficients such that
for all positive integers x it holds that q(x) is prime. Hint: Think about q(a + b) if q(a) = b. Another
hint: If a polynomial q has an infinite number of points x where q(x) are all the same then q is a
constant polynomial.
2
Solution: By way of contradiction, suppose that there was indeed a nonconstant polynomial with
integer coefficients, say q(x) := cn xn + cn−1 xn−1 + · · · + c1 x + c0 , such that q(x) is prime for all positive
integers x. Choose and fix any positive integer a, and define b := q(a). Now, q(a + b) = cn (a + b)n +
P
n i n−i
n−1 i n−1−i
a b +cn−1 n−1
+· · ·+c1 (a+b)+c0 =
i=0
i=0
i
i a b
P
Pn−2 n−1 i n−1−i−1
n−1 n i n−i−1
n
n−1
cn a + cn−1 a
+ · · · + c1 a + c0 + b cn i=0 i a b
+ cn−1 i=0 i a b
+ · · · which is
cn−1 (a+b)n−1 +· · ·+c1 (a+b)+c0 = cn
Pn
q(a)+b·h = b+b·h for an integer h, thus b|q(a+b). However, since q(a+b) is prime and b is prime, we
must conclude that q(a + b) = b. Repeating this argument with a + b, a + 2b, then a + 2b, a + 3b etc (or
by using similar argument on q(a + jb)) yields that for all nonnegative integers j we have q(a + jb) = b.
However, q taking on the same value an infinite number of times implies that q is constant, which is
a contradiction, and establishes our result.
3