Divisibility October 8, 2014 1 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.

Slides:



Advertisements
Similar presentations
Chapter 3 Elementary Number Theory and Methods of Proof.
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.
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.
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.
CSE115/ENGR160 Discrete Mathematics 03/13/12 Ming-Hsuan Yang UC Merced 1.
Basic properties of the integers
CSE115/ENGR160 Discrete Mathematics 03/15/11
Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer.
3 Gallon Jug5 Gallon Jug Greatest Common Divisor Lecture 8: Sep 30.
Chapter II. THE INTEGERS
6/20/2015 5:05 AMNumerical Algorithms1 x x1x
Discrete Structures Chapter 2 Part B Mathematical Induction
Great Theoretical Ideas in Computer Science.
Fall 2002CMSC Discrete Structures1 Let us get into… Number Theory.
CS555Spring 2012/Topic 61 Cryptography CS 555 Topic 6: Number Theory Basics.
BY MISS FARAH ADIBAH ADNAN IMK
The Integers and Division
Integers Number Theory = Properties of Integers
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 3 (Part 2): The Fundamentals: Algorithms, the.
Great Theoretical Ideas in Computer Science.
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.
Module :MA3036NI Cryptography and Number Theory Lecture Week 7
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.
Prep Math Competition, Lec. 1Peter Burkhardt1 Number Theory Lecture 1 Divisibility and Modular Arithmetic (Congruences)
Greatest Common Divisor
WIKIPEDIA HAS MANY MORE DIVISIBILITY RULES. EXAMPLE Since 52=13(4) is divisible by 4, is divisible by 4 Since 452=56(8)+4 is not divisible.
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.
CompSci 102 Discrete Math for Computer Science
Chapter 2 (Part 1): The Fundamentals: Algorithms, the Integers & Matrices The Integers and Division (Section 2.4)
CSE 311: Foundations of Computing Fall 2014 Lecture 12: Primes, GCD.
Foundations of Discrete Mathematics Chapter 4 By Dr. Dalia M. Gil, Ph.D.
Math 409/409G History of Mathematics Books VII – IX of the Elements Part 1: Divisibility.
MA/CSSE 473 Day 08 Extended Euclid's Algorithm Modular Division Fermat's little theorem.
Tuesday’s lecture: Today’s lecture: One-way permutations (OWPs)
Module #9 – Number Theory 1/5/ Algorithms, The Integers and Matrices.
Factor A factor of an integer is any integer that divides the given integer with no remainder.
Ref: Pfleeger96, Ch.31 Properties of Arithmetic Reference: Pfleeger, Charles P., Security in Computing, 2nd Edition, Prentice Hall, 1996.
Discrete Mathematics 4. NUMBER THEORY Lecture 7 Dr.-Ing. Erwin Sitompul
CSE 311: Foundations of Computing Fall 2013 Lecture 11: Modular arithmetic and applications.
Divisibility and Modular Arithmetic
AF2. Turn off your phones Primes, gcd, some examples, reading.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: 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.
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.
Fuw-Yi Yang1 Textbook: Introduction to Cryptography 2nd ed. By J.A. Buchmann Chap 1 Integers Department of Computer Science and Information Engineering,
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,
Number-Theoretic Algorithms
CSE15 Discrete Mathematics 03/15/17
Integers and Division Section 3.4.
CMSC Discrete Structures
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Number Theory and Modular Arithmetic
Applied Discrete Mathematics Week 3: Algorithms
Applied Discrete Mathematics Week 4: Number Theory
Topic 6: Number Theory Basics
Enough Mathematical Appetizers!
The Integers & Division
CMSC 203, Section 0401 Discrete Structures Fall 2004 Matt Gaston
Divisibility and Modular Arithmetic
Applied Discrete Mathematics Week 10: Introduction to Counting
Number Theory.
Discrete Mathematics Chapter 4 Number Theory. Discrete Mathematics Chapter 4 Number Theory.
Presentation transcript:

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 that b = ac. The notation is a | b. If a does not divide b, we write a | b. Note that every integer divides 0, 1 divides every integer and every integer divides itself. 2

Divisibility For all integers a, b and c, if c | a and c | b, then c | (a + b). Why? For all integers a, b and c, if a | b, then a | bc. Why? For all integers a, b and c, if a | b and b | c, then a | c. Why? 3 a = cx; b = cy Then, a + b = c(x + y) So, c divides (a + b)

Division Theorem Let a be an integer and d be a positive integer. Then, there exists unique integers q and r with 0  r < d such that a = dq + r. r is called the remainder of a divided by d and q is called the quotient. 4

Greatest Common Divisor Suppose that a and b are integers and not both zero. The largest integer d such that d | a and d | b is called the greatest common divisor of a and b. We write d = gcd (a, b) If gcd(a, b) = 1, then a and b are relative prime of each other. 5

Properties of gcd Some properties of gcd: gcd(a, b) = gcd (b, a) gcd(a, b) = gcd (-a, b) gcd(a, b) = gcd (|a|, |b|) gcd(a, 0) = |a| gcd(a, ka) = |a| where k is an integer Why each of the above? 6

Properties of gcd If a = bq + r for integers a, b, q and r, then gcd(a, b) = gcd(b, r) Why? (Hint: Try to show that every common divisor of a and b is also a common divisor of b and r and vice versa.) 7 Let x = cd(a, b) a = xh; b = xk Then, r = a – bq = x(h – kq) So, x | r and x = cd(a, r) Let y = cd(b, r) b = ys; r = yt Then, a = bq + r = y(qs + t) So, y | a and y = cd(a, b)

Euclid’s Algorithm gcd(a, b) ‏if a = 0 return |b| ‏if b = 0 return |a| ‏repeat ‏r := a mod b ‏a := b ‏b := r ‏until r = 0 ‏return a Why is this algorithm correct (i.e., will terminate and give a correct answer)? (Try to show that when a or b is 0, it is correct. Otherwise, the steps taken in the repeat- until loop reduce the value of b and keep the gcd between a and b invariant.) 8

GCD Identity If gcd(a, b) = d, then there exists integers m and n such that d = am + bn. That is, the gcd of two numbers can be written as a linear combination of the two numbers. This is found by a French mathematician called É tienne Bézout. Thus, this is also called the Bézout’s Identity. 9

A Game on Water Jugs Suppose you are given two jugs, one of 5 gallons and one 3 gallons. Now you are standing beside a fountain and is asked to fill one of the jugs with exactly 4 gallons of water. Can you do it? If so, how? How about making 9 gallons of water from 2 jugs of 10 gallons and 14 gallons? Can you do it? How or why? 10 Any volume one can measure using the 2 jugs is a linear combination of the sizes of the 2 jugs. E.g., here, any volume measurable x can be written as 10m + 14n. Since the gcd(10, 14) = 2, x must also be divisible by 2. But now, we want to measure 9. So, this is impossible.

Prime Numbers An integer n > 1 is a prime number means that if n = rs for positive integers r and s, then r = 1 or s = 1. That is, the only divisors of n are 1 and itself. 2, 3, 5, 7, …, 19, …, 2 57,885,161 -1, … Discovered in This number has 17,425,170 digits. Till January 2014, it’s still the largest one found. 11

Fundamental Theorem of Arithmetic Every positive integer greater than 1 can be written uniquely as the product of primes. That is, any positive integer n can be written as p 1 e 1 p 2 e 2 … p k e k For example, 540 =2 2  3 3  5 12

Composite Numbers An integer n > 1 is composite means that n is not a prime. Theorem: If p is a prime and p|ab, then p|a or p|b. Theorem: If p is a prime and p|a 1 a 2 …a n, then p|a i for some i. 13

Modulus Operations If a and m are integers with m > 0, then the remainder of a divided by m is denoted by a mod m. That is, when a = qm + r for 0  r < m, then r = a mod m. Easy to see that the only possible values for a mod m for any integer a is 0, 1, …, m-1. a a mod

Modulus Operations For any integers a and b and positive integer m, if a mod m = b mod m, we say that a is congruent to b modulo m, or a and b are in the same congruence class. We can also write a  b mod m. This is equivalent to the fact that m divides a-b. Why? 15

Modulus Operations a  a (mod m) If a  b (mod m), then b  a (mod m) If a  b (mod m) and b  c (mod m), then a  c (mod m) a  b (mod m) iff a + k  b + k (mod m) If a  b (mod m), then ak  bk (mod m) If a  b (mod m) and c  d (mod m), then a + c  b + d (mod m) 16