Euclidean Algorithm and Diophantine Equations
Total Page:16
File Type:pdf, Size:1020Kb
Last time Euclid and Diophantus Modular Arithmetic Euclidean Algorithm and Diophantine Equations SUAMI 2016 David Offner June 3, 2016 Last time Euclid and Diophantus Modular Arithmetic Agenda 1 Last time 2 Euclid and Diophantus 3 Modular Arithmetic Last time Euclid and Diophantus Modular Arithmetic Last time Substitution ciphers and frequency analysis Main questions of cryptography Read by Friday: 1.1: Simple substitution ciphers 1.2: Divisibility and GCD 1.6: Crypto by hand (history) Read: 1.2b, 1.4b, 1.5, 1.38, 1.39, 1.40 Try for Friday: 1.6, 1.10a, 1.11a Hand in Monday: 1.2b, 1.4b, 1.38, 1.40 Last time Euclid and Diophantus Modular Arithmetic Problem 1.5 Last time we decided there were 26! possible substitution ciphers. How many have no letters representing themselves? The answer is asymptotically interesting if you consider alphabets with n letters. Last time Euclid and Diophantus Modular Arithmetic Divisibility Definition Let a and b be integers with b 6= 0. We say b divides a, or a is divisible by b, if there exists an integer c such that a = bc: E.g. 13 j 52 12 - 38 Proof. Part (c), second part (Distributive Property): Suppose a j b and a j c. Then there exist d1; d2 2 Z such that ad1 = b and ad2 = c. Thus b − c = ad1 − ad2 = a(d1 − d2). Since d1 − d2 2 Z, a j (b − c). Last time Euclid and Diophantus Modular Arithmetic Divisibility Proposition (Proposition 1.4) Let a; b; c 2 Z be integers. (a) If a j b and b j c then a j c. (b) If a j b and b j a then a ± b. (c) If a j b and a j c then a j (b + c) and a j (b − c). Then there exist d1; d2 2 Z such that ad1 = b and ad2 = c. Thus b − c = ad1 − ad2 = a(d1 − d2). Since d1 − d2 2 Z, a j (b − c). Last time Euclid and Diophantus Modular Arithmetic Divisibility Proposition (Proposition 1.4) Let a; b; c 2 Z be integers. (a) If a j b and b j c then a j c. (b) If a j b and b j a then a ± b. (c) If a j b and a j c then a j (b + c) and a j (b − c). Proof. Part (c), second part (Distributive Property): Suppose a j b and a j c. Thus b − c = ad1 − ad2 = a(d1 − d2). Since d1 − d2 2 Z, a j (b − c). Last time Euclid and Diophantus Modular Arithmetic Divisibility Proposition (Proposition 1.4) Let a; b; c 2 Z be integers. (a) If a j b and b j c then a j c. (b) If a j b and b j a then a ± b. (c) If a j b and a j c then a j (b + c) and a j (b − c). Proof. Part (c), second part (Distributive Property): Suppose a j b and a j c. Then there exist d1; d2 2 Z such that ad1 = b and ad2 = c. Since d1 − d2 2 Z, a j (b − c). Last time Euclid and Diophantus Modular Arithmetic Divisibility Proposition (Proposition 1.4) Let a; b; c 2 Z be integers. (a) If a j b and b j c then a j c. (b) If a j b and b j a then a ± b. (c) If a j b and a j c then a j (b + c) and a j (b − c). Proof. Part (c), second part (Distributive Property): Suppose a j b and a j c. Then there exist d1; d2 2 Z such that ad1 = b and ad2 = c. Thus b − c = ad1 − ad2 = a(d1 − d2). Last time Euclid and Diophantus Modular Arithmetic Divisibility Proposition (Proposition 1.4) Let a; b; c 2 Z be integers. (a) If a j b and b j c then a j c. (b) If a j b and b j a then a ± b. (c) If a j b and a j c then a j (b + c) and a j (b − c). Proof. Part (c), second part (Distributive Property): Suppose a j b and a j c. Then there exist d1; d2 2 Z such that ad1 = b and ad2 = c. Thus b − c = ad1 − ad2 = a(d1 − d2). Since d1 − d2 2 Z, a j (b − c). This quantity is denoted gcd(a; b) or (a; b). If a = b = 0 then gcd(a; b) is not defined. Last time Euclid and Diophantus Modular Arithmetic Common Divisors and GCD Definition A common divisor of two integers a and b is a positive integer d that divides both of them. The greatest common divisor of a and b is the largest positive integer d such that d j a and d j b Last time Euclid and Diophantus Modular Arithmetic Common Divisors and GCD Definition A common divisor of two integers a and b is a positive integer d that divides both of them. The greatest common divisor of a and b is the largest positive integer d such that d j a and d j b This quantity is denoted gcd(a; b) or (a; b). If a = b = 0 then gcd(a; b) is not defined. Well Ordering Property of N: Any nonempty subset of N has a smallest element. Let R = fr ≥ 0 : a = bq + rg (set of non-negative remainders, nonempty since a 2 R). WOP ) 9 smallest r0 2 R, a = bq0 + r0. If r0 < b, done. Else a = b(q0 + 1) + (r0 − b), and 0 ≤ r0 − b < r0, contradicting minimality of r0. Last time Euclid and Diophantus Modular Arithmetic Division with Remainder Definition (Division Algorithm/Division with Remainder) Let a and b be positive integers. Then a divided by b has quotient q and remainder r means that a = b · q + r with 0 ≤ r < b: the values of q and r are uniquely determined by a and b. Why? Let R = fr ≥ 0 : a = bq + rg (set of non-negative remainders, nonempty since a 2 R). WOP ) 9 smallest r0 2 R, a = bq0 + r0. If r0 < b, done. Else a = b(q0 + 1) + (r0 − b), and 0 ≤ r0 − b < r0, contradicting minimality of r0. Last time Euclid and Diophantus Modular Arithmetic Division with Remainder Definition (Division Algorithm/Division with Remainder) Let a and b be positive integers. Then a divided by b has quotient q and remainder r means that a = b · q + r with 0 ≤ r < b: the values of q and r are uniquely determined by a and b. Why? Well Ordering Property of N: Any nonempty subset of N has a smallest element. (set of non-negative remainders, nonempty since a 2 R). WOP ) 9 smallest r0 2 R, a = bq0 + r0. If r0 < b, done. Else a = b(q0 + 1) + (r0 − b), and 0 ≤ r0 − b < r0, contradicting minimality of r0. Last time Euclid and Diophantus Modular Arithmetic Division with Remainder Definition (Division Algorithm/Division with Remainder) Let a and b be positive integers. Then a divided by b has quotient q and remainder r means that a = b · q + r with 0 ≤ r < b: the values of q and r are uniquely determined by a and b. Why? Well Ordering Property of N: Any nonempty subset of N has a smallest element. Let R = fr ≥ 0 : a = bq + rg WOP ) 9 smallest r0 2 R, a = bq0 + r0. If r0 < b, done. Else a = b(q0 + 1) + (r0 − b), and 0 ≤ r0 − b < r0, contradicting minimality of r0. Last time Euclid and Diophantus Modular Arithmetic Division with Remainder Definition (Division Algorithm/Division with Remainder) Let a and b be positive integers. Then a divided by b has quotient q and remainder r means that a = b · q + r with 0 ≤ r < b: the values of q and r are uniquely determined by a and b. Why? Well Ordering Property of N: Any nonempty subset of N has a smallest element. Let R = fr ≥ 0 : a = bq + rg (set of non-negative remainders, nonempty since a 2 R). If r0 < b, done. Else a = b(q0 + 1) + (r0 − b), and 0 ≤ r0 − b < r0, contradicting minimality of r0. Last time Euclid and Diophantus Modular Arithmetic Division with Remainder Definition (Division Algorithm/Division with Remainder) Let a and b be positive integers. Then a divided by b has quotient q and remainder r means that a = b · q + r with 0 ≤ r < b: the values of q and r are uniquely determined by a and b. Why? Well Ordering Property of N: Any nonempty subset of N has a smallest element. Let R = fr ≥ 0 : a = bq + rg (set of non-negative remainders, nonempty since a 2 R). WOP ) 9 smallest r0 2 R, a = bq0 + r0. Else a = b(q0 + 1) + (r0 − b), and 0 ≤ r0 − b < r0, contradicting minimality of r0. Last time Euclid and Diophantus Modular Arithmetic Division with Remainder Definition (Division Algorithm/Division with Remainder) Let a and b be positive integers. Then a divided by b has quotient q and remainder r means that a = b · q + r with 0 ≤ r < b: the values of q and r are uniquely determined by a and b. Why? Well Ordering Property of N: Any nonempty subset of N has a smallest element. Let R = fr ≥ 0 : a = bq + rg (set of non-negative remainders, nonempty since a 2 R). WOP ) 9 smallest r0 2 R, a = bq0 + r0. If r0 < b, done.