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.

Slides:



Advertisements
Similar presentations
The Fundamental Theorem of Arithmetic. Primes p > 1 is prime if the only positive factors are 1 and p if p is not prime it is composite The Fundamental.
Advertisements

Division & Divisibility. 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.
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.
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.
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
Chapter II. THE INTEGERS
1 Integers and Division CS/APMA 202 Rosen section 2.4 Aaron Bloomfield.
Properties of the Integers: Mathematical Induction
WHOLE NUMBERS; INTEGERS Whole numbers: Z 0,+ = the natural numbers  {0}. Integers:
Fall 2002CMSC Discrete Structures1 Let us get into… Number Theory.
BY MISS FARAH ADIBAH ADNAN IMK
The Integers and Division
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.
Integers Number Theory = Properties of Integers
CSCI 1900 Discrete Structures
© 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.
CSE 504 Discrete Mathematics & Foundations of Computer Science
3.4/3.5 The Integers and Division/ Primes and Greatest Common Divisors Let each of a and b be integers. We say that a divides b, in symbols a | b, provided.
Module :MA3036NI Cryptography and Number Theory Lecture Week 7
1 Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown Chapter 4 – Finite Fields.
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
Computational Number Theory - traditional number theory Prime Numbers Factors Counting Factors D- functions.
Copyright © Zeph Grunschlag, Basic Number Theory Zeph Grunschlag.
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.
Module #9 – Number Theory 1/5/ Algorithms, The Integers and Matrices.
Slide Copyright © 2009 Pearson Education, Inc. Unit 1 Number Theory MM-150 SURVEY OF MATHEMATICS – Jody Harris.
AF2. Turn off your phones Primes, gcd, some examples, reading.
Basic Number Theory.
Discrete Mathematics
Slide Copyright © 2009 Pearson Education, Inc. 5.1 Number Theory.
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,
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
Module #9 – Number Theory 6/11/20161 Chapter 3 Algorithms, Integers and Matrices.
Number Theory Lecture 1 Text book: Discrete Mathematics and its Applications, 7 th Edition.
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.
REAL NUMBERS. INTRODUCTION  We all know four fundamental operations of addition, subtraction, multiplication and division, which we have applied on.
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
CS 210 Discrete Mathematics The Integers and Division (Section 3.4)
CSE15 Discrete Mathematics 03/15/17
COT 3100, Spring 2001 Applications of Discrete Structures
Integers and Division Section 3.4.
CMSC Discrete Structures
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
Number Theory (Chapter 7)
Discrete Math for CS CMPSC 360 LECTURE 12 Last time: Stable matching
The Integers & Division
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 & 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

If a|b and a|c then a|(b+c) “ If a divides b and a divides c then a divides b plus c ” a|b  a.x = b a|c  a.y = c b+c = a.x + a.y = a(x + y) and that is divisible by a Division

a|b  a.m = b b.c = a.m.c which is divisible by a Division

a|b  a.x = b b|c  b.y = c c = a.x.y and that is divisible by a Division

Theorem 1 (page 202, 6 th ed, page 154, 5 th ed)

Primes p > 1 is prime if the only positive factors are 1 and p if p is not prime it is composite The Fundamental Theorem of Arithmetic Every positive integer can be expressed as a unique product of primes My name is Euclid

Primes There is no other factoring!

Euclid of Alexandria 325BC to 265BC

Primes Euclid’s words “if a number be the least that is measured by prime numbers, it will not be measured by any other prime except those originally measuring it “ Where “measuring” is “dividing” The Elements

Proof of Fundamental Theorem of Arithmetic Well Ordering Principle (WOP) every non-empty set of positive integers has a least element RTP: Every integer n > 1 can be written as a product of primes If n is prime we are done n is composite and has a positive divisor 1 < p < n let p 1 be the smallest of these divisors p 1 must be prime otherwise there is an integer k, 1 < k < p 1, and k divides p 1 consequently n = n 1 times p 1 (i.e. n 1 = n  p 1 ) where p 1 is prime and n 1 < n repeat the argument with n 1 If n 1 is prime we are done otherwise n 1 = n 2 times p 2 where p 2 is prime and n 2 < n 1 and p 2  p 1 … this process terminates due to the WOP

PRIMES The dumb way to test if n is prime if n is divisible by 2 return(“composite”) if n is divisible by 3 return(“composite”) if n is divisible by 4 return(“composite”) … if n is divisible by n-1 return(“composite”) return(“prime”) Question: is n (n > 2) ever divisible by n-1?

PRIMES Therefore, the divisor a or b is either prime or due to the fundamental theorem of arithmetic, can be expressed as a product of primes Put another way (p th ed, p th ed)

PRIMES We now have a test for primality If a number is not composite it is prime If a number is prime then it does NOT have a prime divisor less than or equal to  n Therefore we can test if n is divisible by primes in the range 2 to  n If none are found n must be prime

Primes Prove that 41 is prime To be prime, 41 must not be composite If composite 41 has a divisor less than or equal to square root of 41 The only primes not exceeding 6 are 2, 3, and 5 None of these divides 41 Therefore 41 is not composite, it is prime Remember: floor(x)  x  the largest integer smaller than x

Primes for the class! Prove that 67 is prime To be prime, 67 must not be composite If composite 67 has a divisor less than or equal to square root of 67 The only primes not exceeding 8 are 2, 3, 5, and 7 None of these divides 67 Therefore 67 is not composite, it is prime

Is 51 prime? Consider prime divisors 2, 3, 5, 7 only 

PrimesCompute the prime factorisation of n The Fundamental Theorem of Arithmetic Every positive integer can be expressed as a unique product of primes Revisited

PrimesCompute the prime factorisation of n assume nextPrime(i) delivers next prime number greater than i nextPrime(7) = 11 and nextPrime(nextPrime(7)) = 13 floor(sqrt(n)) delivers largest integer  square root of n floor(sqrt(97)) = 9 p := 2; // the 1st prime rootN := floor(sqrt(N)) // where we stop while p <= rootN do begin if p|n then begin print(p); // p is a prime divisor n := n/p; rootN := floor(sqrt(n)); end else p := nextPrime(p); end print(p);

Primes N p rootN print print print print = p := 2; // the 1st prime rootN := floor(sqrt(N)) // where we stop while p <= rootN do begin if p|n then begin print(p); // p is a prime divisor n := n/p; rootN := floor(sqrt(n)); end else p := nextPrime(p); end print(p);

The Division Algorithm (aint no algorithm) a is an integer and d is a positive integer there exists unique integers q and r, 0  r  d a = d.q. + r a divided by d = q remainder r dividend divisor quotient remainder NOTE: remainder r is positive and divisor d is positive

Division a = d.q + r and 0 <= r < d a = -11 and d = 3 and 0 <= r < = 3q + r q = -4 and r = 1 a = d.q + r and 0 <= r < d a = -63 and d = 20 and 0 <= r <= = 20q + r q = -4 and r = 17 a = d.q + r and 0 <= r < d a = -25 and d = 15 and 0 <= r < = 15.q + r q = -2 and r = 10

Division a = d.q + r and 0 <= r < d a = -11 and d = 3 and 0 <= r < = 3q + r q = -4 and r = 1 Troubled by this? Did you expect q = -3 and r = -2? What if 3 of you went to a café and got a bill for £11? Would you each put £3 down and then leg it? Or £4 each and leave £1 tip?

Greatest common divisor gcd(a,b) and Least common multiple gcd(a,b) is largest d such that d|a and d|b if gcd(a,b) = 1 then a and b are relative prime lcm(a,b) is the smallest/least x such that a|x and b|x 3 Naïve algorithms for gcd(a,b) start with x at 1 up to min(a,b) testing if x | a and x |b remember the last (largest) successful value start with x at min(a,b) and count down to 1 testing if x|a and x|b stop when the first value of x is found compute the prime factorisation of a and of b and then see below

Greatest common divisor gcd(a,b) gcd(120,500) prime factorisation of 120 is prime factorisation of 500 is … but there is a better algorithm (wots an algorithm?)

Lowest/least common multiple lcm(a,b) = smallest x divisible by a and by b lcm(95256,432) prime factorisation of is prime factorisation of 432 is

mod arithmetic a mod m is the remainder of a divided by m a mod m is the integer r such that a = qm + r and 0 <= r < m again, r is positive Examples 17 mod 3 = 2 17 mod 12 = 5 (5 o’clock) -17 mod 3 = 1

mod arithmetic a is congruent to b modulo m if m divides a - b congruences

mod arithmetica is congruent to b modulo m if m divides a - b

mod arithmetica is congruent to b modulo m if m divides a - b

mod arithmetica is congruent to b modulo m if m divides a - b

mod arithmetica is congruent to b modulo m if m divides a - b

Mod arithmetic -133 mod 9 = 2 (but in Claire?) list 5 numbers that are congruent to 4 modulo 12 hash function h(k) = k mod 101 h( ) h( ) h( ) h( ) examples

What have we done? (summary) divisibility a | b FTA proof of FTA test for primality computation of prime factorisation gcd and lcm Division algorithm aint no algorithm Mod arithmetic congruences

Division and multiplication That’s all for now folks