Intermediate Math Circles November 18, 2009 Solving Linear Diophantine Equations

Similar documents
Intermediate Math Circles February 29, 2012 Linear Diophantine Equations I

Intermediate Math Circles February 26, 2014 Diophantine Equations I

HOW TO FACTOR. Next you reason that if it factors, then the factorization will look something like,

Cool Results on Primes

Math Circles - Lesson 2 Linear Diophantine Equations cont.

Number Theory. Introduction

MATH 216T Homework 1 Solutions

Exercise 3: Quadratic sequences

Congruences and Modular Arithmetic

Chapter 15 Equilibrium. Reversible Reactions & Equilibrium. Reversible Reactions & Equilibrium. Reversible Reactions & Equilibrium 5/27/2014

General Equilibrium. What happens to cause a reaction to come to equilibrium?

Chapter 15 Equilibrium. Reversible Reactions & Equilibrium. Reversible Reactions & Equilibrium. Reversible Reactions & Equilibrium 2/3/2014

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?

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?

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?

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

The Hanging Chain. John McCuan. January 19, 2006

MAC Calculus II Summer All you need to know on partial fractions and more

6.4 Dividing Polynomials: Long Division and Synthetic Division

Rings and modular arithmetic

radical symbol 1 Use a Calculator to Find Square Roots 2 Find Side Lengths

To factor an expression means to write it as a product of factors instead of a sum of terms. The expression 3x

Commutative Rings and Fields

Lesson 3: Using Linear Combinations to Solve a System of Equations

Lesson 23: The Defining Equation of a Line

Math Lecture 18 Notes

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

Math101, Sections 2 and 3, Spring 2008 Review Sheet for Exam #2:

Math 151 Introduction to Eigenvectors

Section 7.1 The Pythagorean Theorem. Right Triangles

Some facts you should know that would be convenient when evaluating a limit:

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

Quadratic Equations Part I

Relativistic Addition of Velocities *

Solutions Manual. Selected odd-numbered problems in. Chapter 2. for. Proof: Introduction to Higher Mathematics. Seventh Edition

Maximum Entropy and Exponential Families

Lecture 2. The Euclidean Algorithm and Numbers in Other Bases

2 The Bayesian Perspective of Distributions Viewed as Information

Solution Guide for Chapter 10

Algebra 1B notes and problems March 12, 2009 Factoring page 1

Mathematics Revision Guide. Algebra. Grade C B

23.1 Tuning controllers, in the large view Quoting from Section 16.7:

arxiv:math/ v1 [math.ca] 27 Nov 2003

Chapter 2. Divisibility. 2.1 Common Divisors

Chapter 1 A Survey of Divisibility 14

Name Solutions to Test 1 September 23, 2016

MATH240: Linear Algebra Review for exam #1 6/10/2015 Page 1

Senior Math Circles Cryptography and Number Theory Week 2

Concerning the Numbers 22p + 1, p Prime

C if U can. Algebra. Name

( )( b + c) = ab + ac, but it can also be ( )( a) = ba + ca. Let s use the distributive property on a couple of

Common Mistakes & How to avoid them Class X - Math. Unit: Algebra. Types of Question Common Mistakes Points to be emphasised. points.

Quantum Mechanics: Wheeler: Physics 6210

2.6 Absolute Value Equations

Study of EM waves in Periodic Structures (mathematical details)

Grade 11/12 Math Circles Rational Points on an Elliptic Curves Dr. Carmen Bruni November 11, Lest We Forget

Page 1. These are all fairly simple functions in that wherever the variable appears it is by itself. What about functions like the following, ( ) ( )

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

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

No Solution Equations Let s look at the following equation: 2 +3=2 +7

Number theory (Chapter 4)

Math 425 Fall All About Zero

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Physics Physics IC-W08D2-11 Jumping Off as Flatcar Solution

LESSON 7.2 FACTORING POLYNOMIALS II

Math 101 Review of SOME Topics

Getting Started with Communications Engineering

Eigenvalues by row operations

Proof by Contradiction

29. GREATEST COMMON FACTOR

Q2. [40 points] Bishop-Hill Model: Calculation of Taylor Factors for Multiple Slip

Math Lecture 23 Notes

Mathematics II. Tutorial 5 Basic mathematical modelling. Groups: B03 & B08. Ngo Quoc Anh Department of Mathematics National University of Singapore

A population of 50 flies is expected to double every week, leading to a function of the x

LINEAR CONGRUENCES AND LINEAR DIOPHANTINE EQUATIONS

Elementary Properties of the Integers

Algebra 8.6 Simple Equations

Math 096--Quadratic Formula page 1

MATH 115, SUMMER 2012 LECTURE 12

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

N H 2 2 NH 3 and 2 NH 3 N H 2

O.K. But what if the chicken didn t have access to a teleporter.

Solving Quadratic & Higher Degree Equations

MATHEMATICAL INDUCTION

Number Theory Notes Spring 2011

Section 0.6: Factoring from Precalculus Prerequisites a.k.a. Chapter 0 by Carl Stitz, PhD, and Jeff Zeager, PhD, is available under a Creative

Relativity fundamentals explained well (I hope) Walter F. Smith, Haverford College

Chapter 3 Basic Number Theory

Multiplication of Polynomials

#26: Number Theory, Part I: Divisibility

Grade 11/12 Math Circles Congruent Number Problem Dr. Carmen Bruni October 28, 2015

Diagonalization and Hückel Molecular Orbital Theory

Grades 7 & 8, Math Circles 17/18/19 October, Angles & Circles

Journal of Inequalities in Pure and Applied Mathematics

Packing Plane Spanning Trees into a Point Set

Clock Arithmetic. 1. If it is 9 o clock and you get out of school in 4 hours, when do you get out of school?

Grade 7/8 Math Circles February 22nd, 2012 Algebraic Approaches

The numbers inside a matrix are called the elements or entries of the matrix.

Grades 7 & 8, Math Circles 10/11/12 October, Series & Polygonal Numbers

Where as discussed previously we interpret solutions to this partial differential equation in the weak sense: b

SOA/CAS MAY 2003 COURSE 1 EXAM SOLUTIONS

Transcription:

1 University of Waterloo Faulty of Mathematis Centre for Eduation in Mathematis and Computing Intermediate Math Cirles November 18, 2009 Solving Linear Diophantine Equations Diophantine equations are equations intended to be solved in the integers. For example, Fermat s Last Theorem is the statement that if n 3, the equation x n + y n = z n has no solution in the integers, exept the solutions with one of x, y, or z being 0. It s too hard to try to understand all diophantine equations in one go, so we ll look at linear ones, like 7x + 3y = 4 or 10x + 4y = 12. How an we find solutions to these with x and y being integers? Example: 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 (whih shouldn t, in this ase, be negative!). By trial-and-error we an find x = 1 y = 13 or x = 3 y = 8 or x = 5 y = 3 Example: A robot an move bakwards or forwards with big steps (130 m) or small steps (50 m). Is there a series of moves it an make to end up 10 m ahead of where it started? i.e., an we solve 130x + 50y = 10?

2 Trial-and-error solution: x = 2 y = 5 2 big steps forward 5 small steps bak OR x = 7 y = 18 There are many solutions. Main question: If a, b, and are integers, the how an you find a solution to ax + by = in integers? Trik question! There might not be one! For example, look at the equation 3x + 6y = 5 If we ould find integers x and y for whih that holds, then x + 2y = 5 3. But 5 3 is not an integer. To figure out exatly when this sort of equation an be solved, we need some number theory. If any integer divides both a and b, then ax + by = an only have a solution if that integer also divides. Remember: an integer d divides another integer e if and only if e d is an integer. The greatest ommon divisor of a and b is the largest integer that divides a and divides b. We write it as gd(a, b). For example: gd(3, 6) = 3 gd(10, 15) = 5 gd(3, 7) = 1 1 divides everything, so gd(a, b) is always at least 1.

3 If ax + by = is going to have a solution, then gd(a, b) needs to divide. What s the best way to alulate gd(a, b)? For small numbers a and b it s not too hard, but try alulating gd(104723, 103093). You an try to find all divisors, and see whih ones divide both, but that ould take all day! Here s and interesting idea: If a number d divides a and b, and q is any integer, then d divides a qb. Also, if e divides a qb and b, then e divides a = (a qb) + qb. So for any integer q, Why is this useful? Suppose we want to alulate gd(a, b) = gd(b, a qb). gd(73, 7) This is the same as gd(7, 73 q 7) for any integer q. Like, for example, q = 10. So Example: gd(117, 55) =? Solution: 117 2 55 = 7, so Now, 55 7 7 = 6, so Again, 7 1 6 = 1, so gd(73, 7) = gd(7, 3) = 1 gd(117, 55) = gd(55, 7). gd(55, 7) = gd(7, 6). gd(7, 6) = gd(6, 1) = 1. So gd(117, 55) = 1. This is the Eulidean algorithm for alulating gd(a, b). Step 1: Arrange things so that a b. Step 2: Write a = qb + r, with 0 r < b. Step 3: If r = 0, then b divides a, so gd(a, b) = b. STOP! If not then gd(a, b) = gd(b, r). Step 4: Repeat to alulate gd(b, r). Sine the numbers get smaller at every stage, you eventually get an answer.

4 Example: Calulate gd(129, 48). Solution: 129 = 2 48 + 33, so gd(129, 48) = gd(48, 33) 48 = 1 33 + 15, so gd(48, 33) = gd(33, 15) 33 = 2 15 + 3, so gd(33, 15) = gd(15, 3) 15 = 5 3 + 0, so gd(15, 3) = 3 We have gd(129, 48) = 3. Example: Is there a solution to 129x + 48y = 4? Solution: NO! Beause gd(129, 48) = 3, whih doesn t divide 4. So, we know how to show (sometimes) that ax+by = has no solution, but if it does have a solution, is there a lever way to find one? For example, an we find a solution to (Remember that gd(117, 55) = 1). We found that Let s rearrange this: 117x + 55y = 1? 117 2 55 = 7 1 = 7 1 6 55 7 7 = 6 7 1 6 = 1 6 1 6 = 0 6 = 55 7 7, so 1 = 7 1 (55 7 7) = 8 7 1 55 But 7 = 117 2 55, so 1 = 8 (117 2 55) 1 55 = 8 117 17 55 So one solution to 117x + 55y = 1 is x = 8, y = 17. This always works, and gives us a way to find a solution to ax + by = if = gd(a, b).

5 Example: Find a solution to 4389x + 2919y = 21. Solution: We an only do this if we happen to have gd(4389, 2919) = 21. 4389 = 1 2919 + 1470 2919 = 1 1470 + 1449 1470 = 1 1449 + 21 1449 = 69 21 + 0 So gd(4389, 2919) = 21 21 = 1470 1 1449 = 1470 1 (2919 1 1470) = 2 1470 1 2919 = 2 (4389 1 2919) 1 2919 = 2 4389 3 2919 So one solution is x = 2, y = 3. What about solving ax + by = when is not gd(a, b)? We know that we need gd(a, b) to divide, so If ax + by = gd(a, b), then So just = = ( a x gd(a, b) ) ( + b y gd(a, b) (ax + by) gd(a, b) 1. Solve ax + by = gd(a, b). 2. Multiply the x and y in the solution by Example: Find a solution to 4389x + 2919y = 231. is an integer. ) gd(a, b) gd(a, b). Solution: We know that gd(4389, 2919) = 21, so this is only going to work if 21 divides 231. It does! 231 = 11, so 21 1. Find a solution to 4389x + 2919y = 21. We ve done this: x = 2, y = 3. 2. Multiply by 11. So the new solution is x = 22, y = 33. Chek: 4389(22) + 2919( 33) = 231.

6 So we now know that ax + by = has a solution (in the integers) if and only if gd(a, b) divides, and we know how to find a solution if there is one. How an we find more solutions? Suppose x, y is a solution to ax + by =. For example, x = 2, y = 5 is a solution to 18x + 7y = 1 Notie that x = 2 + 7 and y = 5 18 is also a solution. In fat, if k is any integer, is a solution, sine x = 2 + 7k, y = 5 18k 18(2 + 7k) + 7( 5 18k) = 36 + 18 7 k 35 18 7 k = 1 You an use this formula to desribe all solutions to 18x + 7y = 1. In general, this works for any equation ax + by =. If x = x 0, y = y 0 is one solution, then the full set of solutions is given by hoosing integers k, and letting x = x 0 + k e, y = y 0 k f, where e = a gd(a, b) f = b gd(a, b) Example: Write down a formula giving the solutions to 4389x + 2919y = 231 Solution: We already have one: x = 22, y = 33 So the solutions are exatly for all integers k. a Now, e = gd(a, b) = 4389 21 = 209 b f = gd(a, b) = 2919 21 = 139 x = 22 + k 209 y = 33 k 139

7 Problems 1. Here s a little puzzle: start with the number 0, and at every step, you may add or subtrat either the number 5 or the number 17 (that s four possible moves in total). Is it possible to eventually get to the number 1? 2. Find the greatest ommon divisors: a) gd(55, 20) b) gd(318, 225) ) gd(2009, 4182) d) gd(43477, 35021) e) gd(127146, 123456) f) gd(422058756, 464963310) 0 +17 17 5 12... 3. Find a solution to eah of the following diophantine equations, or explain where there is none: a) 55x + 20y = 5 b) 318x + 225y = 4 ) 2009x + 4182y = 820 d) 43477x + 35021y = 7 e) 127146x + 123456y = 12 f) 422058756x + 464963310y = 42 4. For eah of the above equations (exept those that didn t have solutions!) write down a formula desribing ALL solutions to the equations in terms of an integer k.