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.

Slides:



Advertisements
Similar presentations
THE WELL ORDERING PROPERTY Definition: Let B be a set of integers. An integer m is called a least element of B if m is an element of B, and for every x.
Advertisements

Chapter 3 Elementary Number Theory and Methods of Proof.
Copyright © Cengage Learning. All rights reserved.
CS 202 Epp section ?? Aaron Bloomfield
Chapter 5 Number Theory © 2008 Pearson Addison-Wesley. All rights reserved.
Chapter 8 – Introduction to Number Theory. Prime Numbers prime numbers only have divisors of 1 and self –they cannot be written as a product of other.
Euclidean Number theory From the Algorithm to the Basic Theory of Numbers.
3.3 Divisibility Definition If n and d are integers, then n is divisible by d if, and only if, n = dk for some integer k. d | n  There exists an integer.
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.
Sets, Combinatorics, Probability, and Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides.
Thinking Mathematically
Whiteboardmaths.com © 2004 All rights reserved
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.
The Fundamental Theorem of Arithmetic (2/12) Definition (which we all already know). A number greater than 1 is called prime if its only divisors are 1.
Basic properties of the integers
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.
Fundamental Theorem of Arithmetic. Euclid's Lemma If p is a prime that divides ab, then p divides a or p divides b.
Methods of Proof Lecture 4: Sep 16 (chapter 3 of the book)
Properties of the Integers: Mathematical Induction
WHOLE NUMBERS; INTEGERS Whole numbers: Z 0,+ = the natural numbers  {0}. Integers:
CSE 321 Discrete Structures Winter 2008 Lecture 10 Number Theory: Primality.
Fall 2002CMSC Discrete Structures1 Let us get into… Number Theory.
Chapter Number Theory 4 4 Copyright © 2013, 2010, and 2007, Pearson Education, Inc.
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.
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.
BIRKDALE HIGH SCHOOL MATHEMATICS DEPARTMENT
Numbers, Operations, and Quantitative Reasoning.
Mathematical Induction. F(1) = 1; F(n+1) = F(n) + (2n+1) for n≥ F(n) n F(n) =n 2 for all n ≥ 1 Prove it!
Methods of Proof. This Lecture Now we have learnt the basics in logic. We are going to apply the logical rules in proving mathematical theorems. Direct.
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.
1 Introduction to Abstract Mathematics Chapter 3: Elementary Number Theory and Methods of Proofs Instructor: Hayk Melikya Direct.
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.
Copyright © 2009 Pearson Education, Inc. Chapter 5 Section 1 - Slide 1 Chapter 1 Number Theory and the Real Number System.
Math 409/409G History of Mathematics Books VII – IX of the Elements Part 3: Prime Numbers.
Prime Numbers and Prime Factorization. Factors Factors are the numbers you multiply together to get a product. For example, the product 24 has several.
Chapter 2 (Part 1): The Fundamentals: Algorithms, the Integers & Matrices The Integers and Division (Section 2.4)
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.
160 as a product of its prime factors is 2 5 x 5 Use this information to show that 160 has 12 factors.
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,
By: Katrina Carlsen and Melissa Sparow.  For every integer n ≥ 2, n is a prime number or can be written uniquely (ignoring ordering) as a product of.
All About Division. Definition / A nonzero integer t is a divisor of an integer s if there is an integer u such that s = tu. / If t is a divisor of s,
Methods of Proof Lecture 4: Sep 20 (chapter 3 of the book, except 3.5 and 3.8)
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 Lecture 1 Text book: Discrete Mathematics and its Applications, 7 th Edition.
Slide Copyright © 2009 Pearson Education, Inc. Slide Copyright © 2009 Pearson Education, Inc. Chapter 1 Number Theory and the Real Number System.
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,
PowerPointmaths.com © 2004 all rights reserved
Divisibility and Primes
Chapter 5: Number Theory
Copyright © 2016, 2013, and 2010, Pearson Education, Inc.
Prime Factorization Prime factorization is the long string of factors that is made up of all prime numbers.
Applied Discrete Mathematics Week 4: Number Theory
Fundamental Theorem of Arithmetic
Prime Numbers and Prime Factorization
Prime Numbers and Prime Factorization
Copyright © Cengage Learning. All rights reserved.
The Integers & Division
Counting Elements of Disjoint Sets: The Addition Rule
Copyright © 2013, 2010, and 2007, Pearson Education, Inc.
Copyright © Zeph Grunschlag,
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.
Sets, Combinatorics, Probability, and Number Theory
Presentation transcript:

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 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 Euclids 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);

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