Intermediate Math Circles February 29, 2012 Linear Diophantine Equations I

Similar documents
Intermediate Math Circles February 26, 2014 Diophantine Equations I

Intermediate Math Circles November 18, 2009 Solving Linear Diophantine Equations

Math Circles - Lesson 2 Linear Diophantine Equations cont.

Ch 4.2 Divisibility Properties

The Euclidean Algorithm and Multiplicative Inverses

Senior Math Circles Cryptography and Number Theory Week 2

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

Chapter 2. Divisibility. 2.1 Common Divisors

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

Intermediate Math Circles March 7, 2012 Problem Set: Linear Diophantine Equations II Solutions

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

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

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

4 Powers of an Element; Cyclic Groups

Number Theory. Introduction

Applied Cryptography and Computer Security CSE 664 Spring 2017

#26: Number Theory, Part I: Divisibility

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

Rings and modular arithmetic

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

Chapter 1 A Survey of Divisibility 14

Cool Results on Primes

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

Basic elements of number theory

Basic elements of number theory

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?

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

Grade 7/8 Math Circles. Continued Fractions

Elementary Properties of the Integers

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.

Homework #2 solutions Due: June 15, 2012

CPSC 467b: Cryptography and Computer Security

CS250: Discrete Math for Computer Science

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?

CMPUT 403: Number Theory

Deepening Mathematics Instruction for Secondary Teachers: Algebraic Structures

Number Theory Notes Spring 2011

Lecture 2. The Euclidean Algorithm and Numbers in Other Bases

Math 109 HW 9 Solutions

Elementary Number Theory MARUCO. Summer, 2018

Exercises Exercises. 2. Determine whether each of these integers is prime. a) 21. b) 29. c) 71. d) 97. e) 111. f) 143. a) 19. b) 27. c) 93.

Remainders. We learned how to multiply and divide in elementary

Modular Arithmetic Instructor: Marizza Bailey Name:

5: The Integers (An introduction to Number Theory)

MATH 145 Algebra, Solutions to Assignment 4

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

Number Theory Math 420 Silverman Exam #1 February 27, 2018

The Euclidean Algorithm

Arithmetic and Algebra

8 Primes and Modular Arithmetic

11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic

Greatest Common Divisor MATH Greatest Common Divisor. Benjamin V.C. Collins, James A. Swenson MATH 2730

Q 2.0.2: If it s 5:30pm now, what time will it be in 4753 hours? Q 2.0.3: Today is Wednesday. What day of the week will it be in one year from today?

LINEAR CONGRUENCES AND LINEAR DIOPHANTINE EQUATIONS

1 Overview and revision

Number Theory Proof Portfolio

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

CPSC 467: Cryptography and Computer Security

3 The fundamentals: Algorithms, the integers, and matrices

MATH 145 Algebra, Solutions to Assignment 4

Number theory (Chapter 4)

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

Mathematics for Computer Science Exercises for Week 10

Introduction to Number Theory. The study of the integers

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

Problem Set 7 Solutions

12x + 18y = 50. 2x + v = 12. (x, v) = (6 + k, 2k), k Z.

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time.

Math Lecture 18 Notes

Notes 6: Polynomials in One Variable

Factoring. Number Theory # 2

2. THE EUCLIDEAN ALGORITHM More ring essentials

Module 1. Integers, Induction, and Recurrences

Math From Scratch Lesson 20: The Chinese Remainder Theorem

Discrete Mathematics GCD, LCM, RSA Algorithm

4 Number Theory and Cryptography

Ma/CS 6a Class 1. Course Details

Integers and Division

Lecture 4: Number theory

EDULABZ INTERNATIONAL NUMBER SYSTEM

Some Facts from Number Theory

INTEGERS. In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes.

Euclidean Domains. Kevin James

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 3

3.2 Solving linear congruences. v3

MATH10040 Chapter 1: Integers and divisibility

Lecture Notes. Advanced Discrete Structures COT S

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 = ,

NOTES ON SIMPLE NUMBER THEORY

Arithmetic Algorithms, Part 1

ZEROS OF POLYNOMIAL FUNCTIONS ALL I HAVE TO KNOW ABOUT POLYNOMIAL FUNCTIONS

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

4. Number Theory (Part 2)

CSE 311 Lecture 13: Primes and GCD. Emina Torlak and Kevin Zatloukal

NUMBER THEORY AND CODES. Álvaro Pelayo WUSTL

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.

Wednesday, February 21. Today we will begin Course Notes Chapter 5 (Number Theory).

Notes on arithmetic. 1. Representation in base B

The Euclidean Algorithm and Diophantine Equations

Commutative Rings and Fields

Transcription:

Intermediate Math Circles February 29, 2012 Linear Diophantine Equations I Diophantine equations are equations intended to be solved in the integers. We re going to focus on Linear Diophantine Equations. That is, equations of the form ax+by = c, where a, b, c are given integers and we are solving for integers x and y. For example: 7x + 3y = 4 or 10x + 4y = 12 How can we find solutions to these with x and y being integers? Example 1: Suppose that Bob has $1.55 in quarters and dimes. How many quarters and how many dimes does he have? (There might be more than one solution!) Solution: We re trying to solve 25x + 10y = 155 with x and y integers (which shouldn t, in this case, be negative!). By trial-and-error we can find Are there any other solutions? x = 1 y = 13 or x = 3 y = 8 or x = 5 y = 3 1

Example 2: A robot can move backwards or forwards with big steps (130 cm) or small steps (50 cm). Is there a series of moves it can make to end up 10 cm ahead of where it started? i.e., can we solve 130x + 50y = 10? Trial-and-error solution: x = 2 y = 5 2 big steps forward 5 small steps back OR x = 7 y = 18 There are many solutions. Its not always easy to find a solution to a linear Diophantine equation by trial and error. For example, suppose we were asked to find an integer solution to the linear Diophantine equation: 1053x + 481y = 13? Main question: If a, b, and c are integers, then how can you find a solution to where x and y are integers? ax + by = c Trick question! There might not be a solution! For example, look at the equation 3x + 6y = 5 If we could find integers x and y for which that holds, then x + 2y = 5. 3 And since x and y are integers, so is x + 2y. But 5 is not an integer. 3 It appears as though, if any integer divides both a and b, then ax + by = c can only have a solution if that integer also divides c. (An integer d divides another integer e if and only if there is some integer q such that e = qb). Before we look at how to solve a linear Diophantine equation, let s first investigate when there is a solution. It appears as though the divisors of a and b are going to be important. 2

The greatest common divisor of a and b is the largest integer that divides a and divides b. We write it as gcd(a, b). For example: gcd(3, 6) = 3 gcd(10, 15) = 5 gcd(117, 55) = 1 gcd(84, 119) = 7 gcd(481, 1053) = 13 gcd(3551, 4399) =? gcd(104723, 103093) =? 1 divides everything, so gcd(a, b) is always at least 1. What s the best way to calculate gcd(a, b)? For small numbers a and b it s not too hard to find gcd by factoring a and b, but not as easy when trying to calculate gcd(104723, 103093) or gcd(3551, 4399) You can try to find all divisors, and see which ones divide both, but that could take all day! Instead, we ll use the Euclidean Algorithm. First, the Division Algorithm: Suppose a, b are integers and b > 0. There exists unique integers q, r such that a = qb + r, where 0 r < b (q - quotient, r - remainder) For example, a = 15, b = 6 15 = 2 6 + 3 a = 30, b = 6 30 = 5 6 + 0 a = 10, b = 6 10 = ( 2) 6 + 2 a = 2, b = 6 2 = ( 1) 6 + 4 Important Fact 1: If a = qb + r, then gcd(a, b) = gcd(b, r). For example, 15 = 2 6 + 3 and gcd(15, 6) = 3 = gcd(6, 3) 30 = 5 6 + 0 and gcd(30, 6) = 6 = gcd(6, 0) 10 = ( 2) 6 + 2 and gcd( 10, 6) = 2 = gcd(6, 2) 2 = ( 1) 6 + 4 and gcd( 2, 6) = 2 = gcd(6, 4) 3

Why is this fact useful? Example 3: Calculate gcd(117, 55) Solution: 117 = 2 55 + 7, so gcd(117, 55) = gcd(55, 7). Now, 55 = 7 7 + 6, so gcd(55, 7) = gcd(7, 6). Again, 7 = 1 6 + 1, so gcd(7, 6) = gcd(6, 1) = 1. So gcd(117, 55) = 1. In Example 3 we used the Euclidean Algorithm for calculating gcd(a, b). Step 1: Arrange a and b so that a b. Step 2: Write a = qb + r, with 0 r < b. Step 3: If r = 0, then b divides a, so gcd(a, b) = b. STOP! If not then gcd(a, b) = gcd(b, r). Step 4: Go to Step 2 to calculate gcd(b, r). Since the numbers get smaller after each iteration, you will eventually get an answer. Example 4: Calculate gcd(481, 1053) Solution: gcd(481, 1053) = gcd(1053, 481) 1053 = 2 481 + 91, so gcd(1053, 481) = gcd(481, 91) 481 = 5 91 + 26, so gcd(481, 91) = gcd(91, 26) 91 = 3 26 + 13, so gcd(91, 26) = gcd(26, 13) 26 = 2 13 + 0, so gcd(26, 13) = 13 We have gcd(481, 1053) = 13. 4

Exercise Set 1 1. Calculate gcd(129, 48) by a) Factoring 129 and 48. b) The Euclidean Algorithm. 2. Use the Euclidean Algorithm to calculate gcd(427,616) 3. Use the Euclidean Algorithm to calculate gcd(3551, 4399) 4. Use the Euclidean Algorithm to calculate gcd(7826, 6279) 5. Use the Euclidean Algorithm to calculate gcd(104723,103093) Answers to Exercise Set 1: 1. 3 2. 7 3. 53 4. 91 5. 1 5

An application of the Euclidean Algorithm: Solving linear Diophantine equations. Example 5: Find integers x and y such that 1053x + 481y = 13. From the Euclidean Algorithm: 1053 = 2 481 + 91 (1) 481 = 5 91 + 26 (2) 91 = 3 26 + 13 (3) 26 = 2 13 + 0 (4) Working backwards: 13 = 91 3 26 from (3) = 91 3(481 5 91) from (2) = 16 91 3 481 = 16(1053 2(481)) 3 481 from (1) = 16(1053) 35(481) Therefore, a solution is x = 16, y = 35. (Check!) Example 6: Find integers x and y such that 1053x + 481y = 14. 1053x + 481y = 14 Factoring gcd(1053,481) = 13 on the left: 13(37x + 81y) = 14, which is not possible if x and y are integers! Therefore, there is no solution. Important Fact 2: ax + by = c has a solution if and only if gcd(a, b) divides c. 6

Exercise Set 2 1. Find an integer solution to 129x + 48y = 4, or explain why one doesn t exist. 2. Find an integer solution to 117x + 55y = 1, or explain why one doesn t exist. 3. Find an integer solution to 427x + 616y = 7. 4. Find an integer solution to 3551x + 4399y = 53. 5. Find an integer solution to 6279x + 7826y = 91. Answers to Exercise Set 2: 1. There is no solution since gcd(129, 48) = 3, and 3 does not divide 4. 2. (x, y) = (8, 17) is one (of many) solutions. 3. (x, y) = (13, 9) is one (of many) solutions. 4. (x, y) = ( 26, 21) is one (of many) solutions. 5. (x, y) = (5, 4) is one (of many) solutions. 7

What about solving ax + by = c when c is not gcd(a, b)? We know from Important Fact 2, that if gcd(a, b) divides c, there is a solution. Example 7: Find an integer solution to 1053x + 481y = 39. Since gcd(1053, 481) = 13 and 13 divides 39, we know that there is a solution to this linear Diophantine equation. We already know that Multiplying both sides by 3: And so Therefore, 1053(16) + 481( 35) = 13 3 1053(16) + 3 481( 35) = 3 13 1053(3 16) + 481(3 ( 35)) = 39 1053(48) + 481( 105) = 39 Therefore, x = 48, y = 105 is a solution. In general, how do we solve ax + by = c when c is not gcd(a, b)? If gcd(a, b) does not divide c, then there is no solution. If gcd(a, b) does divide c, then 1. Solve ax + by = gcd(a, b). 2. Multiply the x and y in the solution by c gcd(a, b). 8