Chapter 3: The Euclidean Algorithm and Diophantine. Math 138 Burger California State University, Fresno

Similar documents
Ch 4.2 Divisibility Properties

Intermediate Math Circles February 29, 2012 Linear Diophantine Equations I

Intermediate Math Circles February 26, 2014 Diophantine Equations I

The Euclidean Algorithm and Multiplicative Inverses

Math Circles - Lesson 2 Linear Diophantine Equations cont.

4 Powers of an Element; Cyclic Groups

a the relation arb is defined if and only if = 2 k, k

Euclidean Domains. Kevin James

Math 109 HW 9 Solutions

MTH 346: The Chinese Remainder Theorem

Chapter 2. Divisibility. 2.1 Common Divisors

Deepening Mathematics Instruction for Secondary Teachers: Algebraic Structures

Chapter 1 A Survey of Divisibility 14

Chapter 1. Greatest common divisor. 1.1 The division theorem. In the beginning, there are the natural numbers 0, 1, 2, 3, 4,...,

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635

Divisibility. Def: a divides b (denoted a b) if there exists an integer x such that b = ax. If a divides b we say that a is a divisor of b.

Chapter 3 Basic Number Theory

NOTES ON SIMPLE NUMBER THEORY

Senior Math Circles Cryptography and Number Theory Week 2

Proofs. Methods of Proof Divisibility Floor and Ceiling Contradiction & Contrapositive Euclidean Algorithm. Reading (Epp s textbook)

MATH 501 Discrete Mathematics. Lecture 6: Number theory. German University Cairo, Department of Media Engineering and Technology.

Applied Cryptography and Computer Security CSE 664 Spring 2017

Chapter 5: The Integers

Number Theory and Divisibility

NUMBER THEORY AND CODES. Álvaro Pelayo WUSTL

EDULABZ INTERNATIONAL NUMBER SYSTEM

Divisors. Common divisors. Let m, n P Z with m 0. Wesaythatm divides n if n is a multiple of m, i.e.

An Introduction to Mathematical Thinking: Algebra and Number Systems. William J. Gilbert and Scott A. Vanstone, Prentice Hall, 2005

Number Theory Notes Spring 2011

2 Elementary number theory

Basic elements of number theory

Basic elements of number theory

The set of integers will be denoted by Z = {, -3, -2, -1, 0, 1, 2, 3, 4, }

Number Theory Proof Portfolio

CISC-102 Winter 2016 Lecture 11 Greatest Common Divisor

Mat Week 8. Week 8. gcd() Mat Bases. Integers & Computers. Linear Combos. Week 8. Induction Proofs. Fall 2013

5: The Integers (An introduction to Number Theory)

(e) Commutativity: a b = b a. (f) Distributivity of times over plus: a (b + c) = a b + a c and (b + c) a = b a + c a.

Student Responsibilities Week 8. Mat Section 3.6 Integers and Algorithms. Algorithm to Find gcd()

Homework #2 solutions Due: June 15, 2012

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors

Math 131 notes. Jason Riedy. 6 October, Linear Diophantine equations : Likely delayed 6

M381 Number Theory 2004 Page 1

MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences.

The Euclidean Algorithm

Chapter 14: Divisibility and factorization

WORKSHEET MATH 215, FALL 15, WHYTE. We begin our course with the natural numbers:

Lecture 7.4: Divisibility and factorization

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

MATH 145 Algebra, Solutions to Assignment 4

Prof. Ila Varma HW 8 Solutions MATH 109. A B, h(i) := g(i n) if i > n. h : Z + f((i + 1)/2) if i is odd, g(i/2) if i is even.

3 The fundamentals: Algorithms, the integers, and matrices

The following is an informal description of Euclid s algorithm for finding the greatest common divisor of a pair of numbers:

NOTES ON INTEGERS. 1. Integers

Data Dependences and Parallelization. Stanford University CS243 Winter 2006 Wei Li 1

EUCLID S ALGORITHM AND THE FUNDAMENTAL THEOREM OF ARITHMETIC after N. Vasiliev and V. Gutenmacher (Kvant, 1972)

WORKSHEET ON NUMBERS, MATH 215 FALL. We start our study of numbers with the integers: N = {1, 2, 3,...}

CISC-102 Fall 2017 Week 6

Lecture 2. The Euclidean Algorithm and Numbers in Other Bases

MATH 145 Algebra, Solutions to Assignment 4

Remainders. We learned how to multiply and divide in elementary

Numbers. Çetin Kaya Koç Winter / 18

Olympiad Number Theory Through Challenging Problems

Discrete Structures Lecture Primes and Greatest Common Divisor

Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices. Integers & Algorithms (2.5)

CS250: Discrete Math for Computer Science

Cool Results on Primes

Number theory lectures

MATH10040 Chapter 1: Integers and divisibility

CMPUT 403: Number Theory

Solutions to Section 1.3 Homework Problems S. F. Ellermeyer

4 Number Theory and Cryptography

All variables a, b, n, etc are integers unless otherwise stated. Each part of a problem is worth 5 points.

MATH 420 FINAL EXAM J. Beachy, 5/7/97

Ma/CS 6a Class 1. Course Details

cse 311: foundations of computing Fall 2015 Lecture 12: Primes, GCD, applications

cse 311: foundations of computing Spring 2015 Lecture 12: Primes, GCD, applications

Introduction to Number Theory

Solution Sheet (i) q = 5, r = 15 (ii) q = 58, r = 15 (iii) q = 3, r = 7 (iv) q = 6, r = (i) gcd (97, 157) = 1 = ,

Elementary Properties of the Integers

Fall 2017 Test II review problems

Four Basic Sets. Divisors

18 Divisibility. and 0 r < d. Lemma Let n,d Z with d 0. If n = qd+r = q d+r with 0 r,r < d, then q = q and r = r.

CSE 311: Foundations of Computing. Lecture 12: Two s Complement, Primes, GCD

8 Primes and Modular Arithmetic

Module 1. Integers, Induction, and Recurrences

Number Theory Basics Z = {..., 2, 1, 0, 1, 2,...} For, b Z, we say that divides b if z = b for some. Notation: b Fact: for all, b, c Z:

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Solutions

Mathematical Foundations of Cryptography

Basic Algorithms in Number Theory

Direct Proof MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Direct Proof Fall / 24

Example: This theorem is the easiest way to test an ideal (or an element) is prime. Z[x] (x)

Number Theory. Introduction

a = qb + r where 0 r < b. Proof. We first prove this result under the additional assumption that b > 0 is a natural number. Let

Math 412, Introduction to abstract algebra. Overview of algebra.

Discrete Mathematics GCD, LCM, RSA Algorithm

Notes on Systems of Linear Congruences

MATH 215 Final. M4. For all a, b in Z, a b = b a.

Math 110 FOUNDATIONS OF THE REAL NUMBER SYSTEM FOR ELEMENTARY AND MIDDLE SCHOOL TEACHERS

Transcription:

Chapter 3: The Euclidean Algorithm and Diophantine Equations Math 138 Burger California State University, Fresno

Greatest Common Divisor d is the greatest common divisor of integers a and b if d is the largest integer which is a common divisor of both a and b. Notation: d = gcd(a, b) Example: ±2, ±7, and ±14 are the only integers that are common divisors of both 42 and 56. Since 14 is the largest, gcd(42, 56) = 14.

Use of the gcd Reducing fractions Ex. 42 14 3 3 = = 56 14 4 4 However: not all fractions are easily reduced! Ex. 8051 8633

The Division Algorithm (proof on p. 99) For integers a and b, with a > 0, there exist integers q and r such that b = qa + r and 0 r < a.

Euclidean Algorithm (p. 102) To find gcd(a, b) where b < a: Divide b into a and let r 1 be the remainder. Divide r 1 into b and let r 2 be the remainder. Divide r 2 into r 1 and let r 3 be the remainder. Continue to divide the remainder into the divisor until you get a remainder of zero. gcd(a, b) = the last nonzero remainder.

Ex) Find gcd(8633, 8051) 8051 8 97 3 83 = = 8633 97 89 89

Theorem (3.2.2, p.105) For any nonzero integers a and b, there exist integers x and y such that gcd(a, b) = ax + by. Here s how you use the Euclidean Algorithm to write gcd(8633, 8051) as a linear combination of 8633 and 8051.

Use the Euclidean Algorithm to find gcd(8633, 8051). 1 R.582 8051 8633 13 R.485 582 8051 1 485 582 R.97 5 R.0 97 485

Solve each division problem, except the last one, for the remainder (r = a bq). Take note of the quotient in each solution. 1 R.582 8051 8633 582 = 8633 1 8051 13 R.485 582 8051 485= 8051 13 582 1 R.97 485 582 97 = 582 1 485 5 R.0 97 485

Use these equations 582 863 1 in reverse order to find 485 8051 the linear combination. 3: = 1 1: = 3 8051 2: = 13 582 97 582 485 97 = 582 1 485 = 582 1 ( 8051 13 582) = 14 582 1 8051 = 14 ( 8633 1 8051 ) 1 8051 = 14 8633 + ( 15) 8051 Eq. 3 Eq. 2 Simp. Eq. 1 Simp.

Ex) Now use the Euclidean Algorithm to write ) g gcd(486, 434) as a linear combination of 486 and 434.

A Diophantine equation is any equation for which you are interested only in the integer solutions to the equation. A linear Diophantine equation is a linear equation ax + by = c with integer coefficients for which you are interested only in finding integer solutions. Math 138/Burger

Theorem 1 For any nonzero integers a and b, there exist integers x* and y* such that gcd(a,b) = ax* * + by*. * (Proof for Math 133!) When you have a linear Diophantine equation to solve, the first question you should ask about that Diophantine equation is whether or not the equation admits solutions in integers. The following theorem tells you how to find the answer to this question.

Theorem 2 If gcd(a,b) b c, then the linear Diophantine equation ax + by = c has no solution. Proof: Let d = gcd(a,b). Then there are integers r and s such that dr = a and ds = b. By way of contradiction, assume that ax + by = c does have a solution x o, y o. Then c = ax o + by o = drx o + dsy o. But this says that d c since c = d(rx o + sy o ). Since this is a contradiction, the Diophantine equation has no solution.

Theorem 3 If gcd(a,b) c, then the linear Diophantine equation ax + by = c has a solution. Proof: Let d = gcd(a,b). Since d c, dp = c for some integer p. By Theorem 1, there are integers x* and y* such that d = ax* + by*. So c = dp = a(x*p) +b(y*p) p). Hence ax + by = c has a solution, namely x o = x*p* and y o = y*p. *

Q. If a linear Diophantine equation ax + by = c does admit a solution (since gcd(a,b) c), then how do you find it?

Using Division and Euclidean Algorithms to Solve Diophantine Equations To solve ax + by = c: 1. Use the Division Algorithm to find gcd(a,b). 2. Use the Euclidean Algorithm to find x* and y* such that d = ax* + by*. 3. Find p such that c = dp. (p exists since d c.) 4. Then x o = x*p and y o = y*p are solutions since c = dp = a(x*p) +b(y*p) p).

Find a solution to the Diophantine equation 172x + 20y = 1000. Use the Division Algorithm to find d = gcd(172, 20).

Use the Euclidean Algorithm to find x* and y* such that d = ax* + by*. Solve for the remainder. 8 R. 12 20 172 12 = 172 1 20 Eq.1 1 R.8 12 20 8= 20 1 12 Eq.2 1 R. 4 812 4= 12 1 8 Eq.3

Using these 1 equations we get: = 1 12 = 172 20 Eq.1 8 20 12 Eq.2 4= 12 1 8 Eq.3 4= 12 1 8 Eq.3 4 = 12 1 (20 1 12) Eq.2 4= 2 12 1 20 Simp. 4 = 2 (172 8 20) 1 20 Eq.1 4= 2 172+ ( 17) 20 Simp. So x* = 2 and y* = -17

Solve 172x + 20y = 1000 4 = 2 172 + ( 1 7) 20 Find p such that c = dp. d = gcd(172,20) = 4 c = 1000 so 1000 = 4 250.

Solve 172x +20y = 1000 4 = 2 172 + ( 1 7) 20 Then x o = x*p and y o = y*p are particular solutions since c = dp = a(x*p) +b( b(y*p). 1000 = 4 250 = [ 2 172 + ( 17) 20 ] 250 1000 = 172 (500) + 20 (- 4250) So a particular solution is x o = 500 and y = - 4250.

Theorem 4 If the linear Diophantine equation ax + by = c does have a solution, then all such solutions are given by x = x o + (b/d)t and y = y o (a/d)t where d = gcd(a,b), x o, y o is a particular solution to the equation and t ranges over the integers.

Solve 172x + 20y = 1000 Then all solutions are x = x o + (b/d)t y = y o (a/d)t where t is an integer. and From the equation 172x + 20y = 1000, we see thatt a = 172 and b = 20. From our previous work, x o = 500, y o = - 4250, and d = 4. So the solutions, in integers, are x = 500 + 5t and y = - 4250 43t where t ranges over the integers.

Example Find all positive solutions to the Diophantine equation 172x + 20y = 1000. We just saw that all solutions to this equation are of the form x = 500 + 5t and y = - 4250 43t where t ranges over the integers. So we need to find those values of t for which x = 500 + 5t > 0 and y = - 4250 43t > 0.

Find all positive integer solutions to the equation 172x + 20y = 1000. All solutions are x = 500 + 5t and y = - 4250 43t. x = 500 + 5t > 0 t > - 100. y = - 4250 43t > 0 t < - 98.83 Since t must be an integer, t - 99. So - 100 < t - 99.

Find all positive integer solutions to the equation 172x + 20y = 1000. All solutions are x = 500 + 5t and y = - 4250 43t. We just found that - 100 < t - 99. Since t must be an integer, - 100 < t - 99 t = -99. So there is only one positive solution to the Diophantine equation, namely x = 500 + 5t = = 5 and y = - 4250 43t = = 7.