# CLASS 3, GIVEN ON 9/27/2010, FOR MATH 25, FALL 2010

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 CLASS 3, GIVEN ON 9/27/2010, FOR MATH 25, FALL Greatest common divisor Suppose a, b are two integers. If another integer d satisfies d a, d b, we call d a common divisor of a, b. Notice that as long as at least one of a, b is nonzero, then there will be a largest positive common divisor. We call this number the greatest common divisor of a, b. We will write this number as gcd(a, b), or if we are really lazy, just (a, b). (Yes, this last notation is very ambiguous, since (a, b) is more familiar as the ordered pair (a, b), but the context should usually make what we mean clear. To make things worse, (a, b) sometimes might even mean the open interval a < x < b. These three totally unrelated uses of the same notation is not the best, but it usually should be clear what we mean!) Examples. Suppose a = 8, b = 12. The (positive) divisors of a are 1, 2, 4, 8, while the divisors of b are 1, 2, 3, 4, 6, 12. Looking at this list, the greatest common divisor of 8, 12 is evidently 4. Suppose a = 72, b = 74. The most naive way of computing the gcd is to enumerate all the divisors of 72 and 74, and then compare the list. But suppose we don t want to do that after all, it looks like it ll take a lot of work to find all the divisors of 72 and 74! How might we save the amount of calculations we have to make? Suppose d a, b, so that d is any common divisor of a, b. Then d (b a). But in this case, b a = 2, so d 2. Therefore, the only possible common divisors are 1, 2. We easily can see that 2 72, 74, so this means that gcd(72, 74) = 2. The moral of this example is that there are more efficient ways of calculating gcds than simply jumping right in and enumerating divisors, which in general will take a very long time. Suppose b a, and b 0. What is gcd(a, b)? We can also extend the definition of gcd to more than two integers. The greatest common divisor of a set of integers a 1,..., a k is the largest positive integer d such that d a 1,..., a k. For example, if a = 4, b = 6, c = 8, then gcd(4, 6, 8) = 2. We can show this by either enumerating all the divisors of a, b, c, or by applying the following fact (exercise 1.9 of the text): If a 1,..., a k are integers, then gcd(a 1,..., a k ) = gcd(gcd(a 1, a 2 ), a 3,..., a k ). In practice, what this means is that we can calculate the gcd of k integers by taking the gcd of k 1 pairs of integers. For example, gcd(4, 6, 8) = gcd(gcd(4, 6), 8) = gcd(2, 8) = 2. Notice that 1 a for all integers a. So a greatest common divisor is always at least 1. In the case that gcd(a, b) = 1, we say that a, b are relatively prime or coprime. A list of integers a 1,..., a k is called coprime if gcd(a 1,..., a k ) = 1, and is called mutually coprime if gcd(a i, a j ) = 1 for all distinct pairs a i, a j. For instance, since gcd(8, 9) = 1, 8, 9 are coprime. To see that a list of integers being coprime is distinct from being mutually coprime, consider the list 8, 12, 7. This list is coprime, since gcd(8, 12, 7) = 1, but is not mutually coprime, because gcd(8, 12) = 4. A list like 6, 11, 17 is both coprime and mutually coprime. 1

2 2 CLASS 3, GIVEN ON 9/27/2010, FOR MATH 25, FALL The Euclidean algorithm for calculating gcds What s the relationship between Euclidean division and gcds? It turns out that Euclidean division is the key tool for a very efficient way of calculating the gcd of two integers. We call this method the Euclidean algorithm, and it is based on the following simple lemma: Lemma 1. Let a, b be integers with b > 0. Let a = bq+r be the result of Euclidean division, so that 0 r < b. Then gcd(a, b) = gcd(b, r). Proof. Suppose d a, b, so gcd(a, b) is the largest possible d that satisfies these properties. Since r = a qb, we must also have d r. Therefore, d a, b = d b, r. This means that gcd(a, b) gcd(b, r). Conversely, if d b, r, then a = bq + r implies that d a. So d b, r implies that d a, b, so gcd(b, r) gcd(a, b). The only way both of these inequalities is true is if gcd(a, b) = gcd(b, r). Example. For instance, suppose a = 124, b = 24. Instead of listing all the divisors of 124 and 24, we use Euclidean division to find 124 = , so q = 5, r = 4. Therefore gcd(124, 24) = gcd(24, 4) = 4. This lemma is really useful, because it allows us to replace the computation of gcd(a, b) by the computation of gcd(b, r) for the cost of one Euclidean division. The advantage to this replacement is that we can always select a > b (we ll just assume a > 0; if a < 0, replace a with a ), so that b, r are smaller numbers than a, b. If we are lucky, r will be really small and we will be able to compute b, r via inspection or brute force. But even if we aren t lucky, so that b, r are still somewhat large, we can just repeat this process! That is, we can divide b by r with remainder, to get something like b = q 2 r + r 2, where 0 r 2 < r, and then gcd(b, r) = gcd(r, r 2 ). So we can continually replace the calculation of a gcd of a pair of integers with the calculation of the gcd of a pair of smaller integers at the cost of one Euclidean division. This process, where we repeatedly calculate Euclidean divisions to help us calculate a gcd, is called the Euclidean algorithm. Let s look at an example. Example. Compute the gcd of a = 994 and b = 399 using the Euclidean algorithm. We begin by doing a Euclidean division on 994 by 399: 994 = So q = 2, r = 196. Since we ll be repeating Euclidean division, let s write q = q 1 = 2, r 1 = 196. So we have 994 = a = q 1 b + r 1 = Remember, right now we know that gcd(994, 399) = gcd(399, 196). However, it s not immediately obvious what gcd(399, 196) is, so let s do a Euclidean division with that pair of numbers: We can rewrite this as 399 = = b = q 2 r 1 + r 2, where q 2 = 2, r 2 = 7. So this tells us that gcd(399, 196) = gcd(196, 7). It might not be immediately obvious what gcd(196, 7) is, but a Euclidean division tells us that 196 = , so We can write q 3 = 28, r 3 = 0. Therefore, gcd(196, 7) = 7, so gcd(994, 399) = 7.

3 CLASS 3, GIVEN ON 9/27/2010, FOR MATH 25, FALL Altogether, it took us 3 Euclidean divisions to reach our final answer. A Euclidean division requires a fair amount of work, but not much more work than simply testing whether a number divides another number. In particular, notice that this method of calculating gcds is probably faster than trying to list all the factors of the initial two numbers 994 and 399. And if a, b are really large (like tens or hundreds of digits long), then a computer can still calculate gcds really quickly, but will take a long time (unless you are lucky) to calculate all the factors of a, b. 3. Bezout s Identity It turns out that the Euclidean algorithm can help us solve other problems related to gcds. First, we ll see that the Euclidean algorithm provides a method for us to solve the equation ax + by = gcd(a, b), in integers x, y. For instance, the Euclidean algorithm will give us a way to find an integer solution to the equation 994x + 399y = 7. (Notice that without the Euclidean algorithm, it s not even obvious whether this has an integer solution.) How do we do this? Suppose we calculate gcd(a, b) by applying the Euclidean algorithm to a, b. Then this gives a sequence of Euclidean divisions of the form a = q 1 b + r 1, b = q 2 r 1 + r 2, r 1 = q 3 r 2 + r 3,..., r n 2 = q n r n 1 + r n, for some positive integer n, where r n = 0. Why does this algorithm eventually terminate? Notice that a > b > r 1 > r 2 >... is a strictly decreasing sequence of non-negative integers, so we eventually have to reach a point where one of the r n = 0, and at that point the Euclidean algorithm terminates. Let s look at the last two equations. We have r n 2 = q n r n 1 + 0, r n 3 = q n 1 r n 2 + r n 1. Since gcd(a, b) = gcd(b, r 1 ) = gcd(r 1, r 2 ) =... = gcd(r n 2, r n 1 ) = r n 1, we want to rewrite r n 1 in terms of a, b, and some other integers. If we just take the second to last equation in our list and rewrite try to get an expression r n 1 =..., we obtain r n 1 = r n 3 q n 1 r n 2. Well, this isn t exactly what we want, since we have a r n 3, r n 2, and q n 1. But the third to last equation in our list is r n 4 = q n 2 r n 3 + r n 2. How does this help? We can rearrange this equation to r n 2 = r n 4 q n 2 r n 3. And then we can plug this expression for r n 2 back into the second to last equation to get r n 1 = gcd(a, b) = r n 3 q n 1 (r n 4 q n 2 r n 3 ). This looks more messy (in a way, it is), but it expresses r n 1 as a multiple of r n 3 plus a multiple of r n 4. This looks like progress! As a matter of fact, we can continually replace r n k by using the equation r n k = r n k 2 q n k r n k 1 to convert an expression involving r n 3, r n 4 to one involving r n 4, r n 5. If we continue doing this, we eventually will be able to write gcd(a, b) as a multiple of a plus a multiple of b. If this sounds kind of confusing, an example should make things more clear. Examples.

4 4 CLASS 3, GIVEN ON 9/27/2010, FOR MATH 25, FALL 2010 Going back to our example where a = 994, b = 399, several applications of Euclidean division gave the equations 994 = , 399 = , 196 = We found that gcd(994, 399) = 7. We want to find integers x, y such that 7 = 994x + 399y. The first step is to look at the second to last equation, and rearrange it so that 7 = gcd(a, b) is on one side by itself: 7 = (2). The next step is to take the previous equation, and rewrite it so that its remainder is on one side by itself: 196 = (2). We then substitute this expression for 196 into the previous equation: 7 = 399 ( (2)) (2). This looks a bit messy, but we expand and gather terms so that the right hand side looks like a multiple of 399 plus a multiple of 994: 7 = 994 ( 2) (5). So the integer pair x = 2, y = 5 solves the equation 7 = 994x + 399y in integers. Let s do a slightly more complicated example. Let a = 273, b = 94. The Euclidean algorithm yields the following: 273 = 94 (2) + 85, 94 = 85 (1) + 9, 85 = 9 (9) + 4, 9 = 4 (2) + 1, 4 = 1 (4). The last nonzero remainder was 1, so this tells us gcd(273, 94) = 1. Let s find a pair of integers x, y which solves 273x + 94y = 1: 1 = 9 4 (2). Replacing 4 with 4 = 85 9 (9) gives 1 = 9 (85 9 (9)) (2) = 85 ( 2) + 9 (19). Replacing 9 with 9 = gives 1 = 85 ( 2) + (94 85) (19) = 94 (19) + 85 ( 21). Finally, replacing 85 with 85 = (2) gives 1 = 94 (19) + ( (2)) ( 21) = 273 ( 21) + 94 (61). So we find that x = 21, y = 61 solves 273x + 94y = 1. Notice that this is probably a much more efficient way of solving 273x + 94y = 1 in integers than, say, guess and check.

5 CLASS 3, GIVEN ON 9/27/2010, FOR MATH 25, FALL The fact that we can solve ax+by = gcd(a, b) in integers x, y is sometimes called Bezout s identity. But this is useful not only for actually solving equations, but for theoretical knowledge as well: Theorem 1 (Theorem 1.8 of Chapter 1). Let a, b be non-zero integers, and c some integer. Then the equation ax + by = c has a pair of integer solutions x, y if and only if gcd(a, b) c. Proof. If we want to prove an if and only if statement, there are really two things to prove: the if direction and the only if direction. Let s start by proving that if ax + by = c has a pair of integer solutions x, y, then gcd(a, b) c. We ll let d = gcd(a, b). Then d a, b, by definition of gcd, so d (ax + by). But then d c, as desired. Now let s prove the only if direction: that if gcd(a, b) c, then ax + by = c has a pair of integer solutions. We ve already seen that ax + by = d has a pair of integer solutions x 0, y 0, say. So we have ax 0 + by 0 = d. Since d c, we have c = qd for some integer q. But then we can multiply our equation by q to get q(ax 0 + by 0 ) = d, or a(qx 0 ) + b(qy 0 ) = dq = c. Then the pair x = qx 0, y = qy 0 give integer solutions to ax + by = c, as desired.

### Section 4.2: The Division Algorithm and Greatest Common Divisors

Section 4.2: The Division Algorithm and Greatest Common Divisors The Division Algorithm The Division Algorithm is merely long division restated as an equation. For example, the division 29 r. 20 32 948

### Theorem (The division theorem) Suppose that a and b are integers with b > 0. There exist unique integers q and r so that. a = bq + r and 0 r < b.

Theorem (The division theorem) Suppose that a and b are integers with b > 0. There exist unique integers q and r so that a = bq + r and 0 r < b. We re dividing a by b: q is the quotient and r is the remainder,

### Definition 1 Let a and b be positive integers. A linear combination of a and b is any number n = ax + by, (1) where x and y are whole numbers.

Greatest Common Divisors and Linear Combinations Let a and b be positive integers The greatest common divisor of a and b ( gcd(a, b) ) has a close and very useful connection to things called linear combinations

### Course notes on Number Theory

Course notes on Number Theory In Number Theory, we make the decision to work entirely with whole numbers. There are many reasons for this besides just mathematical interest, not the least of which is that

### 2. Integers and Algorithms Euclidean Algorithm. Euclidean Algorithm. Suppose a and b are integers

2. INTEGERS AND ALGORITHMS 155 2. Integers and Algorithms 2.1. Euclidean Algorithm. Euclidean Algorithm. Suppose a and b are integers with a b > 0. (1) Apply the division algorithm: a = bq + r, 0 r < b.

### 8 Primes and Modular Arithmetic

8 Primes and Modular Arithmetic 8.1 Primes and Factors Over two millennia ago already, people all over the world were considering the properties of numbers. One of the simplest concepts is prime numbers.

### Intermediate Math Circles March 7, 2012 Linear Diophantine Equations II

Intermediate Math Circles March 7, 2012 Linear Diophantine Equations II Last week: How to find one solution to a linear Diophantine equation This week: How to find all solutions to a linear Diophantine

### Algebra for Digital Communication

EPFL - Section de Mathématiques Algebra for Digital Communication Fall semester 2008 Solutions for exercise sheet 1 Exercise 1. i) We will do a proof by contradiction. Suppose 2 a 2 but 2 a. We will obtain

### Homework 5 Solutions

Homework 5 Solutions 4.2: 2: a. 321 = 256 + 64 + 1 = (01000001) 2 b. 1023 = 512 + 256 + 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = (1111111111) 2. Note that this is 1 less than the next power of 2, 1024, which

### Solutions to Homework Set 3 (Solutions to Homework Problems from Chapter 2)

Solutions to Homework Set 3 (Solutions to Homework Problems from Chapter 2) Problems from 21 211 Prove that a b (mod n) if and only if a and b leave the same remainder when divided by n Proof Suppose a

### Kevin James. MTHSC 412 Section 2.4 Prime Factors and Greatest Comm

MTHSC 412 Section 2.4 Prime Factors and Greatest Common Divisor Greatest Common Divisor Definition Suppose that a, b Z. Then we say that d Z is a greatest common divisor (gcd) of a and b if the following

### ON THE FIBONACCI NUMBERS

ON THE FIBONACCI NUMBERS Prepared by Kei Nakamura The Fibonacci numbers are terms of the sequence defined in a quite simple recursive fashion. However, despite its simplicity, they have some curious properties

### Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.

Elementary Number Theory and Methods of Proof CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.edu/~cse215 1 Number theory Properties: 2 Properties of integers (whole

### 8 Divisibility and prime numbers

8 Divisibility and prime numbers 8.1 Divisibility In this short section we extend the concept of a multiple from the natural numbers to the integers. We also summarize several other terms that express

### The Euclidean Algorithm

The Euclidean Algorithm A METHOD FOR FINDING THE GREATEST COMMON DIVISOR FOR TWO LARGE NUMBERS To be successful using this method you have got to know how to divide. If this is something that you have

### Further linear algebra. Chapter I. Integers.

Further linear algebra. Chapter I. Integers. Andrei Yafaev Number theory is the theory of Z = {0, ±1, ±2,...}. 1 Euclid s algorithm, Bézout s identity and the greatest common divisor. We say that a Z divides

### 4. Number Theory (Part 2)

4. Number Theory (Part 2) Terence Sim Mathematics is the queen of the sciences and number theory is the queen of mathematics. Reading Sections 4.8, 5.2 5.4 of Epp. Carl Friedrich Gauss, 1777 1855 4.3.

### GCDs and Relatively Prime Numbers! CSCI 2824, Fall 2014!

GCDs and Relatively Prime Numbers! CSCI 2824, Fall 2014!!! Challenge Problem 2 (Mastermind) due Fri. 9/26 Find a fourth guess whose scoring will allow you to determine the secret code (repetitions are

### DIVISIBILITY AND GREATEST COMMON DIVISORS

DIVISIBILITY AND GREATEST COMMON DIVISORS KEITH CONRAD 1 Introduction We will begin with a review of divisibility among integers, mostly to set some notation and to indicate its properties Then we will

### GREATEST COMMON DIVISOR

DEFINITION: GREATEST COMMON DIVISOR The greatest common divisor (gcd) of a and b, denoted by (a, b), is the largest common divisor of integers a and b. THEOREM: If a and b are nonzero integers, then their

### Chapter 6. Number Theory. 6.1 The Division Algorithm

Chapter 6 Number Theory The material in this chapter offers a small glimpse of why a lot of facts that you ve probably nown and used for a long time are true. It also offers some exposure to generalization,

### 3 Structure of Modular Multiplication

3 Structure of Modular Multiplication Unlike addition, multiplication in Z M is fairly strange. There may not always be an inverse, you can multiply two non-zero numbers together and get zero, and in general

### It is time to prove some theorems. There are various strategies for doing

CHAPTER 4 Direct Proof It is time to prove some theorems. There are various strategies for doing this; we now examine the most straightforward approach, a technique called direct proof. As we begin, it

### Discrete Mathematics Lecture 3 Elementary Number Theory and Methods of Proof. Harper Langston New York University

Discrete Mathematics Lecture 3 Elementary Number Theory and Methods of Proof Harper Langston New York University Proof and Counterexample Discovery and proof Even and odd numbers number n from Z is called

### a = bq + r where 0 r < b.

Lecture 5: Euclid s algorithm Introduction The fundamental arithmetic operations are addition, subtraction, multiplication and division. But there is a fifth operation which I would argue is just as fundamental

### 2.2 Inverses and GCDs

2.2. INVERSES AND GCDS 49 2.2 Inverses and GCDs Solutions to Equations and Inverses mod n In the last section we explored multiplication in Z n.wesaw in the special case with n =12and a =4that if we used

### MATH 13150: Freshman Seminar Unit 10

MATH 13150: Freshman Seminar Unit 10 1. Relatively prime numbers and Euler s function In this chapter, we are going to discuss when two numbers are relatively prime, and learn how to count the numbers

### Introduction to Diophantine Equations

Introduction to Diophantine Equations Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles September, 2006 Abstract In this article we will only touch on a few tiny parts of the field

### 12 Greatest Common Divisors. The Euclidean Algorithm

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan 12 Greatest Common Divisors. The Euclidean Algorithm As mentioned at the end of the previous section, we would like to

### Topics in Number Theory

Chapter 8 Topics in Number Theory 8.1 The Greatest Common Divisor Preview Activity 1 (The Greatest Common Divisor) 1. Explain what it means to say that a nonzero integer m divides an integer n. Recall

### CS103X: Discrete Structures Homework Assignment 2: Solutions

CS103X: Discrete Structures Homework Assignment 2: Solutions Due February 1, 2008 Exercise 1 (10 Points). Prove or give a counterexample for the following: Use the Fundamental Theorem of Arithmetic to

### CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

CHAPTER 5 Number Theory 1. Integers and Division 1.1. Divisibility. Definition 1.1.1. Given two integers a and b we say a divides b if there is an integer c such that b = ac. If a divides b, we write a

### CS 103X: Discrete Structures Homework Assignment 3 Solutions

CS 103X: Discrete Structures Homework Assignment 3 s Exercise 1 (20 points). On well-ordering and induction: (a) Prove the induction principle from the well-ordering principle. (b) Prove the well-ordering

### Today s Topics. Primes & Greatest Common Divisors

Today s Topics Primes & Greatest Common Divisors Prime representations Important theorems about primality Greatest Common Divisors Least Common Multiples Euclid s algorithm Once and for all, what are prime

### Elementary Number Theory We begin with a bit of elementary number theory, which is concerned

CONSTRUCTION OF THE FINITE FIELDS Z p S. R. DOTY Elementary Number Theory We begin with a bit of elementary number theory, which is concerned solely with questions about the set of integers Z = {0, ±1,

### The last three chapters introduced three major proof techniques: direct,

CHAPTER 7 Proving Non-Conditional Statements The last three chapters introduced three major proof techniques: direct, contrapositive and contradiction. These three techniques are used to prove statements

### 1 Die hard, once and for all

ENGG 2440A: Discrete Mathematics for Engineers Lecture 4 The Chinese University of Hong Kong, Fall 2014 6 and 7 October 2014 Number theory is the branch of mathematics that studies properties of the integers.

### Elementary Number Theory

Elementary Number Theory Ahto Buldas December 3, 2016 Ahto Buldas Elementary Number Theory December 3, 2016 1 / 1 Division For any m > 0, we define Z m = {0, 1,... m 1} For any n, m Z (m > 0), there are

### 9. The Pails of Water Problem

9. The Pails of Water Problem You have a 5 and a 7 quart pail. How can you measure exactly 1 quart of water, by pouring water back and forth between the two pails? You are allowed to fill and empty each

### Reading 7 : Program Correctness

CS/Math 240: Introduction to Discrete Mathematics Fall 2015 Instructors: Beck Hasti, Gautam Prakriya Reading 7 : Program Correctness 7.1 Program Correctness Showing that a program is correct means that

### max cx s.t. Ax c where the matrix A, cost vector c and right hand side b are given and x is a vector of variables. For this example we have x

Linear Programming Linear programming refers to problems stated as maximization or minimization of a linear function subject to constraints that are linear equalities and inequalities. Although the study

### may be sent to:

B A S I C M A T H A Self-Tutorial by Luis Anthony Ast Professional Mathematics Tutor LESSON 5: FACTORS, MULTIPLES & DIVISIBILITY Copyright 2005 All rights reserved. No part of this publication may be reproduced

### 2 The Euclidean algorithm

2 The Euclidean algorithm Do you understand the number 5? 6? 7? At some point our level of comfort with individual numbers goes down as the numbers get large For some it may be at 43, for others, 4 In

### Continued fractions and good approximations.

Continued fractions and good approximations We will study how to find good approximations for important real life constants A good approximation must be both accurate and easy to use For instance, our

### MATH10040 Chapter 2: Prime and relatively prime numbers

MATH10040 Chapter 2: Prime and relatively prime numbers Recall the basic definition: 1. Prime numbers Definition 1.1. Recall that a positive integer is said to be prime if it has precisely two positive

### Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 5

CS 70 Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 5 Modular Arithmetic One way to think of modular arithmetic is that it limits numbers to a predefined range {0,1,...,N

### APPLICATIONS OF THE ORDER FUNCTION

APPLICATIONS OF THE ORDER FUNCTION LECTURE NOTES: MATH 432, CSUSM, SPRING 2009. PROF. WAYNE AITKEN In this lecture we will explore several applications of order functions including formulas for GCDs and

### Fractions and Decimals

Fractions and Decimals Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles December 1, 2005 1 Introduction If you divide 1 by 81, you will find that 1/81 =.012345679012345679... The first

### Polynomials can be added or subtracted simply by adding or subtracting the corresponding terms, e.g., if

1. Polynomials 1.1. Definitions A polynomial in x is an expression obtained by taking powers of x, multiplying them by constants, and adding them. It can be written in the form c 0 x n + c 1 x n 1 + c

### Winter Camp 2011 Polynomials Alexander Remorov. Polynomials. Alexander Remorov alexanderrem@gmail.com

Polynomials Alexander Remorov alexanderrem@gmail.com Warm-up Problem 1: Let f(x) be a quadratic polynomial. Prove that there exist quadratic polynomials g(x) and h(x) such that f(x)f(x + 1) = g(h(x)).

### Chapter Two. Number Theory

Chapter Two Number Theory 2.1 INTRODUCTION Number theory is that area of mathematics dealing with the properties of the integers under the ordinary operations of addition, subtraction, multiplication and

### MATH 289 PROBLEM SET 4: NUMBER THEORY

MATH 289 PROBLEM SET 4: NUMBER THEORY 1. The greatest common divisor If d and n are integers, then we say that d divides n if and only if there exists an integer q such that n = qd. Notice that if d divides

### The Laws of Cryptography Cryptographers Favorite Algorithms

2 The Laws of Cryptography Cryptographers Favorite Algorithms 2.1 The Extended Euclidean Algorithm. The previous section introduced the field known as the integers mod p, denoted or. Most of the field

### Steps to Proving a Theorem

Steps to Proving a Theorem Step 1: Understand Goal What am I looking for? What should the last sentence in my proof say? What are some equivalent ways to state what I want? Are there any complicated definitions

### Math 139 Problem Set #6 Solution 15 April 2003

Math 139 Problem Set #6 Solution 15 April 2003 A1 (Based on Barr, 41, exercise 3) (a) Let n be an integer greater than 2 Consider the list of numbers n! + 2, n! + 3, n! + 4,, n! + n Explain why all the

### Practice Problems for First Test

Mathematicians have tried in vain to this day to discover some order in the sequence of prime numbers, and we have reason to believe that it is a mystery into which the human mind will never penetrate.-

### MATH 22. THE FUNDAMENTAL THEOREM of ARITHMETIC. Lecture R: 10/30/2003

MATH 22 Lecture R: 10/30/2003 THE FUNDAMENTAL THEOREM of ARITHMETIC You must remember this, A kiss is still a kiss, A sigh is just a sigh; The fundamental things apply, As time goes by. Herman Hupfeld

### Vieta s Formulas and the Identity Theorem

Vieta s Formulas and the Identity Theorem This worksheet will work through the material from our class on 3/21/2013 with some examples that should help you with the homework The topic of our discussion

### INTRODUCTION TO PROOFS: HOMEWORK SOLUTIONS

INTRODUCTION TO PROOFS: HOMEWORK SOLUTIONS STEVEN HEILMAN Contents 1. Homework 1 1 2. Homework 2 6 3. Homework 3 10 4. Homework 4 16 5. Homework 5 19 6. Homework 6 21 7. Homework 7 25 8. Homework 8 28

MA 134 Lecture Notes August 20, 2012 Introduction The purpose of this lecture is to... Introduction The purpose of this lecture is to... Learn about different types of equations Introduction The purpose

### 11 Ideals. 11.1 Revisiting Z

11 Ideals The presentation here is somewhat different than the text. In particular, the sections do not match up. We have seen issues with the failure of unique factorization already, e.g., Z[ 5] = O Q(

### Integers and Rational Numbers

Chapter 6 Integers and Rational Numbers In this chapter, we will see constructions of the integers and the rational numbers; and we will see that our number system still has gaps (equations we can t solve)

### RSA Encryption. Grade Levels. Objectives and Topics. Introduction and Outline (54)(2)(2) (27)(2)(2)(2) (9)(3)(2)(2)(2) (3)(3)(3)(2)(2)(2)

RSA Encryption Grade Levels This activity is intended for high schools students, grades 10 12. Objectives and Topics One of the classical examples of applied mathematics is encryption. Through this activity,

### z 0 and y even had the form

Gaussian Integers The concepts of divisibility, primality and factoring are actually more general than the discussion so far. For the moment, we have been working in the integers, which we denote by Z

### Continued Fractions and the Euclidean Algorithm

Continued Fractions and the Euclidean Algorithm Lecture notes prepared for MATH 326, Spring 997 Department of Mathematics and Statistics University at Albany William F Hammond Table of Contents Introduction

### (x + a) n = x n + a Z n [x]. Proof. If n is prime then the map

22. A quick primality test Prime numbers are one of the most basic objects in mathematics and one of the most basic questions is to decide which numbers are prime (a clearly related problem is to find

### Solutions to Practice Problems

Solutions to Practice Problems March 205. Given n = pq and φ(n = (p (q, we find p and q as the roots of the quadratic equation (x p(x q = x 2 (n φ(n + x + n = 0. The roots are p, q = 2[ n φ(n+ ± (n φ(n+2

### Greatest Common Divisor

Greatest Common Divisor Blake Thornton Much of this is due directly to Josh Zucker, Paul Zeitz and Harold Reiter. Divisibility 1. How can 48 be built from primes? In what sense is there only one way? How

### Prime Numbers. Chapter Primes and Composites

Chapter 2 Prime Numbers The term factoring or factorization refers to the process of expressing an integer as the product of two or more integers in a nontrivial way, e.g., 42 = 6 7. Prime numbers are

### Math E-301: Homework 4 Notes Due 10/5/09

Math E-301: Homework 4 Notes Due 10/5/09 The notes for homeworks will vary. For some problems, I may give one solution, but there may be other ways to approach the problem. I will try to mention these

### New Zealand Mathematical Olympiad Committee. Induction

New Zealand Mathematical Olympiad Committee Induction Chris Tuffley 1 Proof by dominoes Mathematical induction is a useful tool for proving statements like P is true for all natural numbers n, for example

### Mathematical induction & Recursion

CS 441 Discrete Mathematics for CS Lecture 15 Mathematical induction & Recursion Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square Proofs Basic proof methods: Direct, Indirect, Contradiction, By Cases,

### A farmer raises rabbits. Each rabbit gives birth when 2 months old and then each month there after.

Fibonacci Problem: A farmer raises rabbits. Each rabbit gives birth when 2 months old and then each month there after. Question: How many rabbits will the farmer have after n months? Try it on small numbers.

### Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

CS 70 Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2 Proofs Intuitively, the concept of proof should already be familiar We all like to assert things, and few of us

### Algebraic Systems, Fall 2013, September 1, 2013 Edition. Todd Cochrane

Algebraic Systems, Fall 2013, September 1, 2013 Edition Todd Cochrane Contents Notation 5 Chapter 0. Axioms for the set of Integers Z. 7 Chapter 1. Algebraic Properties of the Integers 9 1.1. Background

### Is this number prime? Berkeley Math Circle Kiran Kedlaya

Is this number prime? Berkeley Math Circle 2002 2003 Kiran Kedlaya Given a positive integer, how do you check whether it is prime (has itself and 1 as its only two positive divisors) or composite (not

### Quotient Rings and Field Extensions

Chapter 5 Quotient Rings and Field Extensions In this chapter we describe a method for producing field extension of a given field. If F is a field, then a field extension is a field K that contains F.

### CHAPTER 6: RATIONAL NUMBERS AND ORDERED FIELDS

CHAPTER 6: RATIONAL NUMBERS AND ORDERED FIELDS LECTURE NOTES FOR MATH 378 (CSUSM, SPRING 2009). WAYNE AITKEN 1. Introduction In this chapter we construct the set of rational numbers Q using equivalence

### Math 31 - Homework 1 Solutions

Math 31 - Homework 1 Solutions 1. Find gcd(a, b) and express gcd(a, b) as ma + nb for: (a) (116, 84) Solution. Use the Euclidean algorithm: 116 = ( 1)( 84) + 32 84 = ( 3)(32) + 12 32 = (2)(12) + 8 12 =

### Discrete Mathematics, Chapter 4: Number Theory and Cryptography

Discrete Mathematics, Chapter 4: Number Theory and Cryptography Richard Mayr University of Edinburgh, UK Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 4 1 / 35 Outline 1 Divisibility

### Lecture 1: Elementary Number Theory

Lecture 1: Elementary Number Theory The integers are the simplest and most fundamental objects in discrete mathematics. All calculations by computers are based on the arithmetical operations with integers

### 2.1.1 Examples of Sets and their Elements

Chapter 2 Set Theory 2.1 Sets The most basic object in Mathematics is called a set. As rudimentary as it is, the exact, formal definition of a set is highly complex. For our purposes, we will simply define

### Theorem 2. If x Q and y R \ Q, then. (a) x + y R \ Q, and. (b) xy Q.

Math 305 Fall 011 The Density of Q in R The following two theorems tell us what happens when we add and multiply by rational numbers. For the first one, we see that if we add or multiply two rational numbers

### DECIMALS are special fractions whose denominators are powers of 10.

DECIMALS DECIMALS are special fractions whose denominators are powers of 10. Since decimals are special fractions, then all the rules we have already learned for fractions should work for decimals. The

### Factoring Algorithms

Factoring Algorithms The p 1 Method and Quadratic Sieve November 17, 2008 () Factoring Algorithms November 17, 2008 1 / 12 Fermat s factoring method Fermat made the observation that if n has two factors

### 9. POLYNOMIALS. Example 1: The expression a(x) = x 3 4x 2 + 7x 11 is a polynomial in x. The coefficients of a(x) are the numbers 1, 4, 7, 11.

9. POLYNOMIALS 9.1. Definition of a Polynomial A polynomial is an expression of the form: a(x) = a n x n + a n-1 x n-1 +... + a 1 x + a 0. The symbol x is called an indeterminate and simply plays the role

### Chapter 3: Elementary Number Theory and Methods of Proof. January 31, 2010

Chapter 3: Elementary Number Theory and Methods of Proof January 31, 2010 3.4 - Direct Proof and Counterexample IV: Division into Cases and the Quotient-Remainder Theorem Quotient-Remainder Theorem Given

### Notes on Chapter 1, Section 2 Arithmetic and Divisibility

Notes on Chapter 1, Section 2 Arithmetic and Divisibility August 16, 2006 1 Arithmetic Properties of the Integers Recall that the set of integers is the set Z = f0; 1; 1; 2; 2; 3; 3; : : :g. The integers

### There are 8000 registered voters in Brownsville, and 3 8. of these voters live in

Politics and the political process affect everyone in some way. In local, state or national elections, registered voters make decisions about who will represent them and make choices about various ballot

### This section demonstrates some different techniques of proving some general statements.

Section 4. Number Theory 4.. Introduction This section demonstrates some different techniques of proving some general statements. Examples: Prove that the sum of any two odd numbers is even. Firstly you

### Lecture 3. Mathematical Induction

Lecture 3 Mathematical Induction Induction is a fundamental reasoning process in which general conclusion is based on particular cases It contrasts with deduction, the reasoning process in which conclusion

### MTH 382 Number Theory Spring 2003 Practice Problems for the Final

MTH 382 Number Theory Spring 2003 Practice Problems for the Final (1) Find the quotient and remainder in the Division Algorithm, (a) with divisor 16 and dividend 95, (b) with divisor 16 and dividend -95,

### COMP 250 Fall Mathematical induction Sept. 26, (n 1) + n = n + (n 1)

COMP 50 Fall 016 9 - Mathematical induction Sept 6, 016 You will see many examples in this course and upcoming courses of algorithms for solving various problems It many cases, it will be obvious that

### PYTHAGOREAN TRIPLES PETE L. CLARK

PYTHAGOREAN TRIPLES PETE L. CLARK 1. Parameterization of Pythagorean Triples 1.1. Introduction to Pythagorean triples. By a Pythagorean triple we mean an ordered triple (x, y, z) Z 3 such that x + y =

### CHAPTER 3 Numbers and Numeral Systems

CHAPTER 3 Numbers and Numeral Systems Numbers play an important role in almost all areas of mathematics, not least in calculus. Virtually all calculus books contain a thorough description of the natural,

### Instructor: Bobby Kleinberg Lecture Notes, 5 May The Miller-Rabin Randomized Primality Test

Introduction to Algorithms (CS 482) Cornell University Instructor: Bobby Kleinberg Lecture Notes, 5 May 2010 The Miller-Rabin Randomized Primality Test 1 Introduction Primality testing is an important

### CONTINUED FRACTIONS AND PELL S EQUATION. Contents 1. Continued Fractions 1 2. Solution to Pell s Equation 9 References 12

CONTINUED FRACTIONS AND PELL S EQUATION SEUNG HYUN YANG Abstract. In this REU paper, I will use some important characteristics of continued fractions to give the complete set of solutions to Pell s equation.

### Applications of Fermat s Little Theorem and Congruences

Applications of Fermat s Little Theorem and Congruences Definition: Let m be a positive integer. Then integers a and b are congruent modulo m, denoted by a b mod m, if m (a b). Example: 3 1 mod 2, 6 4