The Integers and Division

Slides:



Advertisements
Similar presentations
Section 7.5: Equivalence Relations Def: A relation R on a set A is called an equivalence relation if it is reflexive, symmetric, and transitive. Ex: Let.
Advertisements

Section 4.1: Primes, Factorization, and the Euclidean Algorithm Practice HW (not to hand in) From Barr Text p. 160 # 6, 7, 8, 11, 12, 13.
The Integers and Division. Outline Division: Factors, multiples Exercise 2.3 Primes: The Fundamental Theorem of Arithmetic. The Division Algorithm Greatest.
Thinking Mathematically
5.1 Number Theory. The study of numbers and their properties. The numbers we use to count are called the Natural Numbers or Counting Numbers.
1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.
Chapter Primes and Greatest Common Divisors ‒Primes ‒Greatest common divisors and least common multiples 1.
February 19, 2015Applied Discrete Mathematics Week 4: Number Theory 1 The Growth of Functions Question: If f(x) is O(x 2 ), is it also O(x 3 )? Yes. x.
Copyright © 2013, 2010, and 2007, Pearson Education, Inc.
CSE115/ENGR160 Discrete Mathematics 03/13/12 Ming-Hsuan Yang UC Merced 1.
Number Theory and Cryptography
Math 3121 Abstract Algebra I
CSE115/ENGR160 Discrete Mathematics 03/15/11
Chapter 4 Properties of the integers: mathematical induction Yen-Liang Chen Dept of IM NCU.
Chapter II. THE INTEGERS
1 Integers and Division CS/APMA 202 Rosen section 2.4 Aaron Bloomfield.
Fall 2002CMSC Discrete Structures1 Let us get into… Number Theory.
BY MISS FARAH ADIBAH ADNAN IMK
Homework Review notes Complete Worksheet #2. Homework State whether the conditional sentence is true or false 1.If 1 = 0, then 1 = – 1 True F F T.
Divisibility October 8, Divisibility If a and b are integers and a  0, then the statement that a divides b means that there is an integer c such.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 3 (Part 2): The Fundamentals: Algorithms, the.
Chapter 2 The Fundamentals: Algorithms, the Integers, and Matrices
1 Properties of Integers Objectives At the end of this unit, students should be able to: State the division algorithm Apply the division algorithm Find.
9/2/2015Discrete Structures1 Let us get into… Number Theory.
Mathematics of Cryptography Part I: Modular Arithmetic
February 24, 2015Applied Discrete Mathematics Week 4: Number Theory 1 Modular Arithmetic Let a be an integer and m be a positive integer. We denote by.
The Integers & Division. a divides b if a is not zero there is a m such that a.m = b “a is a factor of b” “b is a multiple of a” a|b Division.
Copyright © Curt Hill Divisibility and Modular Arithmetic A Topic in Number Theory.
The Integers. The Division Algorithms A high-school question: Compute 58/17. We can write 58 as 58 = 3 (17) + 7 This forms illustrates the answer: “3.
Cyclic Groups (9/25) Definition. A group G is called cyclic if there exists an element a in G such that G =  a . That is, every element of G can be written.
CompSci 102 Discrete Math for Computer Science
Computational Number Theory - traditional number theory Prime Numbers Factors Counting Factors D- functions.
Copyright © Zeph Grunschlag, Basic Number Theory Zeph Grunschlag.
Number Theory 이재원 School of Information Technology Sungshin W. University.
Chapter 2 (Part 1): The Fundamentals: Algorithms, the Integers & Matrices The Integers and Division (Section 2.4)
Foundations of Discrete Mathematics Chapter 4 By Dr. Dalia M. Gil, Ph.D.
Chapter 4 With Question/Answer Animations. Section 4.1.
Module #9 – Number Theory 1/5/ Algorithms, The Integers and Matrices.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
Discrete Mathematics
Divisibility and Modular Arithmetic
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: Algorithms,
Chapter 4 With Question/Answer Animations 1. Chapter Summary Divisibility and Modular Arithmetic - Sec 4.1 – Lecture 16 Integer Representations and Algorithms.
Ch04-Number Theory and Cryptography 1. Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic.
Number Theory: Prime and Composite Numbers
Chapter 4 With Question/Answer Animations 1. Chapter Motivation Number theory is the part of mathematics devoted to the study of the integers and their.
Number Theory Lecture 1 Text book: Discrete Mathematics and its Applications, 7 th Edition.
Discrete Mathematics Chapter 2 The Fundamentals : Algorithms, the Integers, and Matrices. 大葉大學 資訊工程系 黃鈴玲.
Chapter 3 The Fundamentals: Algorithms, the integers, and matrices Section 3.4: The integers and division Number theory: the part of mathematics involving.
Agenda Review:  Relation Properties Lecture Content:  Divisor and Prime Number  Binary, Octal, Hexadecimal Review & Exercise.
Dr Nazir A. Zafar Advanced Algorithms Analysis and Design Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar.
Number Theory. Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic principles of divisibility,
The Relation Induced by a Partition
Math 3121 Abstract Algebra I
CS 210 Discrete Mathematics The Integers and Division (Section 3.4)
CSE15 Discrete Mathematics 03/15/17
Integers and Division Section 3.4.
CMSC Discrete Structures
Thinking Critically 4.1 Divisibility Of Natural Numbers
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Applied Discrete Mathematics Week 3: Algorithms
Applied Discrete Mathematics Week 4: Number Theory
Foundations of Discrete Mathematics
CMSC 203, Section 0401 Discrete Structures Fall 2004 Matt Gaston
Copyright © Zeph Grunschlag,
Divisibility and Modular Arithmetic
Applied Discrete Mathematics Week 10: Introduction to Counting
Number Theory.
From the last time: gcd(a, b) can be characterized in two different ways: It is the least positive value of ax + by where x and y range over integers.
Presentation transcript:

The Integers and Division Chapter 2, Section 2.4 The Integers and Division

Recall that the integers are not closed under division Recall that the integers are not closed under division. That is, when we divide one integer by another we are not guaranteed to get another integer. Sometimes we do get another integer, ex. 39 divided by 3 is 13. Other times we end up with a rational number that is not an integer, ex. 25 divided by 8 is 3.125. Other times we don’t even get a real number, ex. 5 divided by 0. Def: Let a and b be integers with a  0. We say that a divides b if there is an integer c such that b = ac. When a divides b we say that a is a factor of b and that b is a multiple of a. To denote that a divides b we use a | b. We slash through the | symbol to denote that a does not divide b. [Don’t get confused, a|b and a/b] Ex: 4 divides 12 since 12 = 4*3. So 4 is a factor of 12 and 12 is a multiple of 4. 5 does not divide 12 since there is no integer c such that 12 = 5c.

Ex: Let n and d be positive integers Ex: Let n and d be positive integers. How many positive integers not exceeding n are divisible by d? That is, how many members of the set {1, 2, …, n} are divisible by d? The positive integers divisible by d are d itself, 2*d, 3*d, … So what we’re really asking is, what is the largest positive integer k, such that k*d  n. Or equivalently, such that k  n/d. Recall the floor function: there are n/d positive integers not exceeding n that are divisible by d. Ex: Based on the previous example, there are 100/7 = 14.285714… = 14 positive integers not exceeding 100 that are divisible by 7. They are 7, 14, 21, 28, 35, 42, 49, 56, 63, 70, 77, 84, 91, and 98. Ex: Does 11 divide 0? Yes. 0 = 11*c (where c = 0) so 11 does divide 0. Remark: k divides 0 for any k  Z since 0 = k*0 always.

Theorem: Let a, b, and c be integers. Then If a | b and a | c, then a | (b + c). [Division of Sum] If a | b, then a | bx for all integers x. [Division of Multiples] If a | b and b | c, then a | c. [Transitivity] Proof (of 1): Let a, b, c  Z such that a | b and a | c. Since a | b, then a  0 and b = a*r for some r  Z. Since a | c, then a  0 and c = a*s for some s  Z. Now b + c = a*r + a*s = a(r + s). So a | b + c since a  0 and b + c = a*(r + s), where r + s  Z. Corollary: If a, b, and c are integers such that a | b and a | c, then a | (mb + nc) for all m, n  Z. Justification: Let a, b, c  Z such that a | b and a | c. Then by (2) it follows that a | mb and a | nc for all m, n Z. Then apply (1).

Consider a positive integer k. Since k = 1. k and k = k Consider a positive integer k. Since k = 1*k and k = k*1 we can see that it is always the case that 1 | k and k | k. That is, every positive integer has at least 2 divisors, 1 and itself. [except 1] Some positive integers, such as 7, have only these two positive integer divisors. No other positive integer divides 7. Other positive integers, such as 8, have additional positive integer divisors. In addition to 1 and 8, both 2 and 4 also divide 8. Def: A positive integer p greater than 1 is called prime if the only positive factors of p are 1 and p. A positive integer greater than 1 that is not prime is called composite. Remark: A positive integer n > 1 is composite if and only if there exists an integer a such that a | n where 1 < a < n. Such an a is called a proper factor of n. 1 and n are called trivial factors of n. Remark: What we have done is to partition the set of positive integers greater than 2 into two disjoint sets, the primes ({2, 3, 5, 7, 11, 13, …}) and the composites ({4, 6, 8, 9, 10, 12, 14, 15, …}).

Ex: Is 57 prime? No. 57 = 3*19 so 3 | 57. So 57 is not prime. [Also 19 | 57] Ex: Is 59 prime? Yes. We have to determine that no positive integer n, 1 < n < 59, divides 59. [If you try this you will start to find shortcuts.] Ex: The number 1 is neither prime nor composite. Only positive integers greater than 1 are prime or composite. Ex: The set of primes less than 100 is {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97}. If you take any of these numbers you will find that the only two positive divisors of the number are 1 and itself. Observation: If a | b then |a|  |b|. When we are looking for possible divisors of a number, we only need to check integers of lesser magnitude.

Theorem (Fundamental Theorem of Arithmetic): Every positive integer greater than 1 can be written uniquely as a prime or as the product of two or more primes where the prime factors are written in order of nondecreasing size. Ex: 100 = 2 * 2 * 5 * 5 = 2252 999 = 3 * 3 * 3 * 37 = 3337 59 = 59 1024 = 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 = 210 The unique factorization into a product of primes for a number is called its prime factorization. The unique factorization of a prime number is simply the number itself. The unique factorization of a composite number is a product of two or more primes.

Theorem: If n is a composite integer, then n has a prime divisor less than or equal to n. Proof: Let n be a composite integer. Then n has a (proper) factor r with 1 < r < n. That is, n = r*q for some integer r where 1 < r < n. It must be the case that 1 < q < n as well since n = r*q. In fact, either r or q must be  n because if both were greater than n then their product would exceed n, which it doesn’t. So we have established that n has a proper factor less than or equal to n (call it z). Now apply the Fundamental Theorem of Arithmetic to z to get its prime factorization. Each prime factor in the prime factorization of z must be less than or equal to z. Any one of these primes is hence  n. So n has a prime factor  n.

Ex: 1000 = 10. 100. So 10 and 100 are factors of 1000 Ex: 1000 = 10 * 100. So 10 and 100 are factors of 1000. The square root of 1000 is about 31.6. And we see that 10  31.6. 10 is not prime, but its prime factorization is 2*5. So 5 is a prime factor of 1000 not exceeding 1000. Ex: 101 is prime. The square root of 101 is just a bit over 10. So we can check only the prime numbers not exceeding 10. We can see that none of 2, 3, 5, or 7 divides 101. So 101 is prime since it doesn’t have a prime factor  101. Ex: Find the prime factorization of 7007. 2 does not divide 7007. 3 does not divide 7007. 5 does not divide 7007. But 7007 = 7*1001. Now we continue to factor 1001. Start with 7. [Why?]. 1001 = 7*143. Now continue to factor 143. Start with 7. 7 does not divide 143. But 143 = 11*13. So the prime factorization of 7007 = 7*7*11*13.

Preliminaries Reminder: HW5 is due Wednesday Pass back HW4 average: 90%, median: 91% Emmanuel graded 1.5: 27, 30, and 64 (green) Pascal graded the rest -- S1.6, S1.7 (red) http://www.cs.virginia.edu/~cmt5n/cs202/hw4/

Theorem: For any positive integer n, there is a prime number greater than n. Proof: Let n be a positive integer. Consider the number n! + 1. Recall n! + 1 = 1*2*3*…*n + 1. By the FTOA, this number has a unique prime factorization. It turns out that none of the numbers 2, …, n can divide n! + 1. This is because we know any such number divides n!. So if that number also divided n! + 1 then it would have to also divide the sum (-1)*(n!) + 1*(n! + 1) = -(n!) + n! + 1 = 1. (Recall “if a | b and a | c, then a | (mb + nc) for all m, n  Z”). But none of these numbers divides 1. Hence no number 2, …, n can divide n! + 1. So all of the factors in the prime factorization of n! + 1 must be greater than n. Hence there must be a prime greater than n. Corollary: There are infinitely many primes.

Theorem (The Division Algorithm): Let a, d  Z with d > 0 Theorem (The Division Algorithm): Let a, d  Z with d > 0. Then there are unique integers q and r, with 0  r < d, such that a = dq + r. We call d the divisor, a the dividend, q the quotient, and r the remainder. [This is what we do in long division] Ex: Let a = 101 and d = 11. The unique q and r which satisfy the division algorithm are q = 9 and r = 2 since 101 = 11*9 + 2. Ex: Let a = -11 and d = 3. The unique q and r which satisfy the division algorithm are q = -4 and r = 1 since -11 = 3*(-4) + 1. It is tempting to say q = -3 and r = -2 since -11 = 3*(-3) + (-2) however this r does not satisfy 0  r < d. Remark: The integer a is divisible by the integer d if and only if the remainder r is zero when a is divided by d.

Def: Let a and b be integers, not both 0 Def: Let a and b be integers, not both 0. The largest integer d such that d | a and d | b is called the greatest common divisor of a and b. We denote this as gcd(a, b). Remark: The greatest common divisor of two integers which are not both zero exists because this set of common divisors is always finite and non-empty. This is due to the fact that the set of divisors of a non-zero integer is always finite and non-empty. Ex: Let a = 24 and b = 36. The set of positive divisors of 24 is {1, 2, 3, 4, 6, 8, 12, 24} and for 36 is {1, 2, 3, 4, 6, 9, 12, 18, 36}. So the set of common divisors of 24 and 36 is the intersection of these two sets {1, 2, 3, 4, 6, 12}. So gcd is 12. Ex: Let a = 17 and b = 22. Then the set of positive divisors of 17 is {1, 17} and for 22 is {1, 2, 11, 22}. So the set of common divisors of 17 and 22 is {1}. So gcd is 1. There is an efficient algorithm (called the Euclidean algorithm) for finding the gcd of two numbers. It is discussed in Section 2.5.

Def: The integers a and b are relatively prime if gcd(a, b) = 1. Ex: We saw that 17 and 22 are relatively prime. Ex: 35 and 49 are not relatively prime since gcd(35, 49) = 7. Def: The integers a1, a2, …, an are pairwise relatively prime if gcd(aj, ak) = 1 whenever 1  i < j  n. That is, the integers are pairwise relatively prime if every pair of them is relatively prime. Ex: The integers 10, 19, and 24 are not pairwise relatively prime since gcd(10, 24) = 2. Ex: The integers 10, 19, and 21 are pairwise relatively prime since gcd(10, 19) = 1, gcd(10, 21) = 1, and gcd(19, 21) = 1. Note that a group of integers is pairwise relatively prime if and only if there is no positive integer greater than 1 which divides more than one of the integers in the group.

We can take advantage of the prime factorizations of two integers to find their gcd. Of course this method will only apply if both integers are nonzero since 0 has no prime factorization. Ex: 120 = 23 * 3 * 5 and 500 = 22 * 53. What is gcd(120, 500)? gcd(120, 500) = 22 * 5 = 20. We simply take the minimum of the exponents that each prime is raised to in the prime factorization. If we had taken the maximum of the exponents that each prime is raised two then we would get the least common multiple. Def: The least common multiple of two positive integers a and b is the smallest positive integer that is divisible by both a and b. Ex: lcm(120, 500) = 23 * 3 * 53 = 3000. Theorem: Let a and b be positive integers. Then a*b = gcd(a, b) * lcm(a, b).

Def: Let a, b, m  Z with m > 0 Def: Let a, b, m  Z with m > 0. Then a is congruent to b modulo m if m divides a – b. We use the notation a  b (mod m) to indicate that a is congruent to b modulo m. Remark: Don’t confuse this notation with the notation a mod m which denotes the remainder when a is divided by m. The following theorem indicates the connection between the two. Theorem: Let a, b, m  Z with m > 0. Then a  b (mod m) if and only if a mod m = b mod m. That is, two integers are congruent modulo m if and only if they have the same remainder when divided by m. Ex: 17  5 (mod 6) by the definition since 6 | (17 – 5). We also see that 17 and 5 both leave the same remainder when divided by 6. So by the previous theorem we also see 17  5 (mod 6). Ex: 24 is not congruent to 14 modulo 6. We see that 6 does not divide (24 – 14) = 10. Further, 24 leaves a remainder of 0 when divided by 6 while 14 leave a remainder of 2 when divided by 6.

Theorem: Let a, b, m  Z with m > 0 Theorem: Let a, b, m  Z with m > 0. Then a is congruent to b modulo m if and only if there is an integer k such that a = b + km. Proof: Let a, b, m  Z with m > 0. () Assume that m | (a – b). Then a – b = mk for some k  Z. So a = b + mk for some integer k. () Assume that there exists an integer k such that a = b + km. Then a – b = km, so m | (a – b). [We could have shown 1  2  3  1 to show the 3 equivalent] Def: Let a, m  Z with m > 0. The set of all integers congruent to a modulo m is called the congruence class of a modulo m. Ex: The congruence class of 2 modulo 6 is {…, -10, -4, 2, 8, 14, …} = {6k + 2 | k  Z }. Ex: The congruence class of 0 modulo 8 is {…, -16, -8, 0, 8, 16, …} = {8k + 0 | k  Z }. [all multiples of 8]

Theorem: Let a, b, c, d, m  Z with m > 0 Theorem: Let a, b, c, d, m  Z with m > 0. If a  b (mod m) and c  d (mod m) then (1) a + c  b + d (mod m) (2) ac  bd (mod m) Ex: If it is 1700 hours now, what time will it be in 60 hours? (17 + 60) mod 24 = 77 mod 24 = 5. So it will be 0500 hours. We could have applied the above theorem instead to find that since 17  17 (mod 24) and 60  12 (mod 24) then (17 + 60)  (17 + 12) (mod 24). So instead of computing (17 + 60) mod 24, we can use (17 + 12) mod 24 = 29 mod 24 = 5.