1 Introduction to Abstract Mathematics Chapter 3: Elementary Number Theory and Methods of Proofs Instructor: Hayk Melikya 3.1-.3.4 Direct.

Slides:



Advertisements
Similar presentations
Lecture 3 – February 17, 2003.
Advertisements

Discrete Mathematics Lecture 3
With examples from Number Theory
Discrete Math Methods of proof 1.
Chapter 3 Elementary Number Theory and Methods of Proof.
1 In this lecture  Number Theory ● Rational numbers ● Divisibility  Proofs ● Direct proofs (cont.) ● Common mistakes in proofs ● Disproof by counterexample.
Chapter 3 Elementary Number Theory and Methods of Proof.
(CSC 102) Lecture 12 Discrete Structures. Previous Lecture Summary Floor and Ceiling Functions Definition of Proof Methods of Proof Direct Proof Disproving.
Sets, Combinatorics, Probability, and Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides.
Elementary Number Theory and Methods of Proof
Chapter Primes and Greatest Common Divisors ‒Primes ‒Greatest common divisors and least common multiples 1.
– Alfred North Whitehead,
Quotient-Remainder Theory, Div and Mod
Basic properties of the integers
Copyright © Cengage Learning. All rights reserved.
Induction and recursion
Logic and Proof. Argument An argument is a sequence of statements. All statements but the first one are called assumptions or hypothesis. The final statement.
Discrete Mathematics Lecture 4 Harper Langston New York University.
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.
Induction Sections 4.1 and 4.2 of Rosen Fall 2010
3 Gallon Jug5 Gallon Jug Greatest Common Divisor Lecture 8: Sep 30.
CSE115/ENGR160 Discrete Mathematics 01/31/12 Ming-Hsuan Yang UC Merced 1.
CSE115/ENGR160 Discrete Mathematics 02/01/11
CMSC 250 Discrete Structures Number Theory. 20 June 2007Number Theory2 Exactly one car in the plant has color H( a ) := “ a has color”  x  Cars –H(
Discrete Structures Chapter 2 Part B Mathematical Induction
Proof Must Have Statement of what is to be proven.
Methods of Proof Lecture 4: Sep 16 (chapter 3 of the book)
Lecture , 3.1 Methods of Proof. Last time in 1.5 To prove theorems we use rules of inference such as: p, p  q, therefore, q NOT q, p  q, therefore.
1 Number Theory and Methods of Proof Content: Properties of integer, rational and real numbers. Underlying theme: Methods of mathematical proofs.
Properties of the Integers: Mathematical Induction
The Integers and Division
Week 3 - Wednesday.  What did we talk about last time?  Basic number theory definitions  Even and odd  Prime and composite  Proving existential statements.
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.
Methods of Proof & Proof Strategies
1 Introduction to Abstract Mathematics Chapter 4: Sequences and Mathematical Induction Instructor: Hayk Melikya 4.1- Sequences. 4.2,
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.
Greatest Common Divisor
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
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.
Methods of Proof Lecture 3: Sep 9. This Lecture Now we have learnt the basics in logic. We are going to apply the logical rules in proving mathematical.
1 Methods of Proof Proof techniques in this handout –Direct proof –Division into cases –Proof by contradiction In this handout, the proof techniques will.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
1 Introduction to Abstract Mathematics Proofs in Predicate Logic , , ~, ,  Instructor: Hayk Melikya Purpose of Section: The theorems.
Method of proofs.  Consider the statements: “Humans have two eyes”  It implies the “universal quantification”  If a is a Human then a has two eyes.
CS104:Discrete Structures Chapter 2: Proof Techniques.
Week 3 - Monday.  What did we talk about last time?  Predicate logic  Multiple quantifiers  Negating multiple quantifiers  Arguments with quantified.
Week 4 - Friday.  What did we talk about last time?  Floor and ceiling  Proof by contradiction.
Introduction to Proofs
1 CMSC 250 Chapter 3, Number Theory. 2 CMSC 250 Introductory number theory l A good proof should have: –a statement of what is to be proven –"Proof:"
Section 1.7. Definitions A theorem is a statement that can be shown to be true using: definitions other theorems axioms (statements which are given as.
1 Introduction to Abstract Mathematics Chapter 3: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 3.1.
AF2. Turn off your phones Primes, gcd, some examples, reading.
Methods of Proof Lecture 4: Sep 20 (chapter 3 of the book, except 3.5 and 3.8)
Fuw-Yi Yang1 Textbook: Introduction to Cryptography 2nd ed. By J.A. Buchmann Chap 1 Integers Department of Computer Science and Information Engineering,
Dr Nazir A. Zafar Advanced Algorithms Analysis and Design Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar.
If more pigeons than pigeonholes, Pigeonhole Principle.
Hubert Chan (Chapters 1.6, 1.7, 4.1)
Advanced Algorithms Analysis and Design
Predicate Calculus Validity
Greatest Common Divisor
Hubert Chan (Chapters 1.6, 1.7, 4.1)
The Foundations: Logic and Proofs
Methods of Proof Rosen 1.7, 1.8 Lecture 4: Sept 24, 25.
PROGRAMME: F.Y.B.Sc.I.T. (SEM-I) COURSE: DISCRETE MATHEMATICS
Methods of Proof Rosen 1.7, 1.8 Lecture 4: Sept, 2019.
Presentation transcript:

1 Introduction to Abstract Mathematics Chapter 3: Elementary Number Theory and Methods of Proofs Instructor: Hayk Melikya Direct Methods and Counterexamples Introduction Rational Numbers Divisibility Division Algorithm

2 Introduction to Abstract Mathematics Basic Definitions Definition: An integer n is an even number if there exists an integer k such that n = 2k. Def: An integer n is an odd number if there exists an integer k such that n = 2k+1. Def: An integer n is a prime number if and only if n>1 and if n=rs for some positive integers r and s then r=1 or s=1. Symbolically: Let Even(n) := “an integer n is even”: E(n) = (  k  Z)( n = 2k). Symbolically: Let O(n) := “an integer is odd”: Odd(n) = (  k  Z)( n = 2k +1).

3 Introduction to Abstract Mathematics Primes and Composites Def: An integer n is a prime number if and only if n>1 and if n=rs for some positive integers r and s then r=1 or s=1. Symbolically: Prime(n):= n is prime   positive integers r and s, if n = rs then r =1 or s =1 Def: A positive integer n is a composite if and only if n=rs for some positive integers r and s then r ≠ 1 and s ≠ 1. Symbolically: Cpmposite(n):= n is compoeite   positive integers r and s, such that n = rs and r ≠ 1 and s ≠ 1 The RSA Challenge (up to US$200,000) Examples: Find the truth value of the following prpopositions E(6), P(12), C(17)

4 Introduction to Abstract Mathematics Existential Statements  x P(x) Proofs: –Constructive u Construct an example of such a such that P(a) is true –Non-constructive u By contradiction –Show that if such x does NOT exist than a contradiction can be derived

5 Introduction to Abstract Mathematics Example Let G(n):=  a  b ((a+b=n)  Prime(a)  Prime(b)) Prove that (  n  N)G(n) Proof: –n=210 –a=113 –b=97 Piece of cake… What about (  n  N) G(n) ( many Million $ baby)

6 Introduction to Abstract Mathematics Universal Statements v  x P(x) v  x [Q(x)  R(x)] v Proof techniques: –Exhaustion –By contradiction u Assume the statement is not true u Arrive at a contradiction –Direct u Generalizing from an arbitrary particular member

7 Introduction to Abstract Mathematics ├ (  x  U)P(x) To prove a theorem of the form (  x  U)P(x) (same as ├ (  x  U)P(x) ) which states “for all elements x in a given universe U, the proposition P(x) is true” we select an arbitrary a  U from the universe, and then prove the assertion P(a). Then by Universal generalization we conclude P(a) ├ (  x  U)P(x) For arguments of the form ├  x [Q(x)  R(x)]

8 Introduction to Abstract Mathematics Example 1 Exhaustion: –Any even number between 4 and 30 can be written as a sum of two primes: –4=2+2 –6=3+3 –8=3+5 –… –30=11+19 Works for finite domains only What if I want to prove that for any integer n the product of n and n+1 is even? Can I exhaust all integer values of n?

9 Introduction to Abstract Mathematics Example 2 Theorem: (  n  Z)( even(n*(n+1)) ) Proof: –Consider a particular but arbitrary chosen integer n –n is odd or even –Case 1: n is odd u Then n=2k+1, n+1=2k+2 u n(n+1) = (2k+1)(2k+2) = 2(2k+1)(k+1) = 2p for some integer p u So n(n+1) is even Case 2: n is even Then n=2k, n+1=2k+1 n(n+1) = 2k(2k+1) = 2p for some integer p So n(n+1) is even

10 Introduction to Abstract Mathematics Fallacy Generalizing from a particular but NOT arbitrarily chosen example I.e., using some additional properties of n Example: –“all odd numbers are prime” –“Proof”: u Consider odd number 3 u It is prime u Thus for any odd n prime(n) holds Such “proofs” can be given for correct statements as well!

11 Introduction to Abstract Mathematics Prevention v Try to stay away from specific instances (e.g., 3) v Make sure that you are not using any additional properties of n considered v Challenge your proof –Try to play the devil’s advocate and find holes in it… Using the same letter to mean different things Jumping to a conclusion Insufficient justification Begging the question assuming the claim first

12 Introduction to Abstract Mathematics Rational Numbers A real number is rational iff it can be represented as a ratio/quotient/fraction of integers a and b(b  0) –  r  R [r  Q   a,b  Z [r=a/b & b  0]] Notes: –a is numerator –b is denominator –Any rational number can be represented in infinitely many ways –The fractional part of any rational number written in any natural radix has a period in it

13 Introduction to Abstract Mathematics Rational or not? v -12 –-12/1 v –3+1459/10000 v … –5689/9999 v 1+1/2+1/4+1/8+… –2 v 0 –0/1

14 Introduction to Abstract Mathematics Theorem 1 Any number with a periodic fractional part in a natural radix representation is rational Proof: –Constructive: –x=0.n 1 …n m n 1 …n m … –x=0.(n 1 …n m ) –x*10 m -x=n 1 …n m –x=n 1 …n m /(10 m -1)

15 Introduction to Abstract Mathematics Theorem 2 Any geometric series: –S=q 0 +q 1 +q 2 +q 3 +… –where -1<q<1 –evaluates to S=1/(1-q) Proof –Proof idea –More formal proof –Definitions of limits and partial sums

16 Introduction to Abstract Mathematics Z  Q Every integer is a rational number Proof : set the denominator to 1 u Book : page 127 The set of rational numbers is closed with respect to arithmetic operations +, -, *, / Partial proofs : textbook pages Formal proof Q

17 Introduction to Abstract Mathematics Irrational Numbers v So far all the examples were of rational numbers v How about some irrationals? – –e –sqrt(2)

18 Introduction to Abstract Mathematics Simple Exercises The sum of two even numbers is even. The product of two odd numbers is odd. direct proof.

19 Introduction to Abstract Mathematics a “divides” b or is b divisible by a (a|b ): b = ak for some integer k Also we say that b is multiple of a a is a factor of b b is divisor for a Divisibility 5|15 because 15 = 3  5 n|0 because 0 = n  0 1|n because n = 1  n n|n because n = n  1 A number p > 1 with no positive integer divisors other than 1 and itself is called a prime. Every other number greater than 1 is called composite. 2, 3, 5, 7, 11, and 13 are prime, 4, 6, 8, and 9 are composite.

20 Introduction to Abstract Mathematics 1. If a | b, then a | bc for all c. 2. If a | b and b | c, then a | c. 3. If a | b and a | c, then a | sb + tc for all s and t. 4. For all c ≠ 0, a | b if and only if ca | cb. Simple Divisibility Facts Proof of (??) direct proof.

21 Introduction to Abstract Mathematics Divisibility by a Prime Theorem. Any integer n > 1 is divisible by a prime number.

22 Introduction to Abstract Mathematics Every integer, n>1, has a unique factorization into primes: p 0 ≤ p 1 ≤ ··· ≤ p k p 0 p 1 ··· p k = n Fundamental Theorem of Arithmetic Example: = 3·3·3·7·11·11·37·37·37·53

23 Introduction to Abstract Mathematics Claim: Every integer > 1 is a product of primes. Prime Products Proof: (by contradiction) Suppose not. Then set of non-products is nonempty. There is a smallest integer n > 1 that is not a product of primes. In particular, n is not prime. So n = k·m for integers k, m where n > k,m >1. Since k,m smaller than the least nonproduct, both are prime products, eg., k = p 1  p 2    p 94 m = q 1  q 2    q 214

24 Introduction to Abstract Mathematics Prime Products …So n = k  m = p 1  p 2    p 94  q 1  q 2    q 214 is a prime product, a contradiction.  The set of nonproducts > 1 must be empty. QED Claim: Every integer > 1 is a product of primes. (The proof of the fundamental theorem will be given later.)

25 Introduction to Abstract Mathematics For b > 0 and any a, there are unique numbers q : quotient(a,b), r : remainder(a,b), such that a = qb + r and 0  r < b. The Quotient-Reminder Theorem When b=2, this says that for any a, there is a unique q such that a=2q or a=2q+1. When b=3, this says that for any a, there is a unique q such that a=3q or a=3q+1 or a=3q+2. We also say q = a div b r = a mod b.

26 Introduction to Abstract Mathematics For b > 0 and any a, there are unique numbers q : quotient(a,b), r : remainder(a,b), such that a = qb + r and 0  r < b. The Division Theorem 0 b 2b kb (k+1)b Given any b, we can divide the integers into many blocks of b numbers. For any a, there is a unique “position” for a in this line. q = the block where a is in a r = the offset in this block Clearly, given a and b, q and r are uniquely defined. -b

27 Introduction to Abstract Mathematics The Square of an Odd Integer 3 2 = 9 = 8+1, 5 2 = 25 = 3x8+1 …… = = 2145x8 + 1, ……… Idea 1: prove that n 2 – 1 is divisible by 8. Idea 2: consider (2k+1) 2 Idea 0: find counterexample. Idea 3: Use quotient-remainder theorem.

28 Introduction to Abstract Mathematics Since m is an odd number, m = 2l+1 for some natural number l. So m 2 is an odd number. Contrapositive Proof Statement: If m 2 is even, then m is even Contrapositive: If m is odd, then m 2 is odd. So m 2 = (2l+1) 2 = (2l) 2 + 2(2l) + 1 Proof (the contrapositive): Proof by contrapositive.

29 Introduction to Abstract Mathematics Suppose was rational. Choose m, n integers without common prime factors (always possible) such that Show that m and n are both even, thus having a common factor 2, a contradiction! Theorem: is irrational. Proof (by contradiction): Irrational Number

30 Introduction to Abstract Mathematics so can assume so n is even. so m is even. Theorem: is irrational. Proof (by contradiction):Want to prove both m and n are even. Proof by contradiction. Irrational Number

31 Introduction to Abstract Mathematics Infinitude of the Primes Theorem. There are infinitely many prime numbers. Claim: if p divides a, then p does not divide a+1. Let p 1, p 2, …, p N be all the primes. Proof by contradiction. Consider p 1 p 2 …p N + 1.

32 Introduction to Abstract Mathematics Floor and Ceiling If k is an integer, what are  x  and  x + 1/2  ? Is  x + y  =  x  +  y  ? ( what if x = 0.6 and y = 0.7) For all real numbers x and all integers m,  x + m  =  x  + m For any integer n,  n/2  is n/2 for even n and (n–1)/2 for odd n Def: For any real number x, the floor of x, written  x , is the unique integer n such that n  x < n + 1. It is the largest integer not exceeding x (  x). Def: For any real number x, the ceiling of x, written  x , is the unique integer n such that n – 1 < x  n. What is n?

33 Introduction to Abstract Mathematics Exercises Is it true that for all real numbers x and y:  x – y  =  x  -  y   x – 1  =  x  - 1  x + y  =  x  +  y   x + 1  =  x  + 1 For positive integers n and d, n = d * q + r, where d =  n / d  and r = n – d *  n / d  with 0  r < d

34 Introduction to Abstract Mathematics Greatest Common Divisors Given a and b, how to compute gcd(a,b)? Can try every number, but can we do it more efficiently? Let’s say a>b. 1.If a=kb, then gcd(a,b)=b, and we are done. 2.Otherwise, by the Division Theorem, a = qb + r for r>0.

35 Introduction to Abstract Mathematics Greatest Common Divisors Let’s say a>b. 1.If a=kb, then gcd(a,b)=b, and we are done. 2.Otherwise, by the Division Theorem, a = qb + r for r>0. Euclid: gcd(a,b) = gcd(b,r)! a=12, b=8 => 12 = gcd(12,8) = 4 a=21, b=9 => 21 = 2x9 + 3gcd(21,9) = 3 a=99, b=27 => 99 = 3x gcd(99,27) = 9 gcd(8,4) = 4 gcd(9,3) = 3 gcd(27,18) = 9

36 Introduction to Abstract Mathematics Euclid’s GCD Algorithm Euclid: gcd(a,b) = gcd(b,r) gcd(a,b) if b = 0, then answer = a. else write a = qb + r answer = gcd(b,r) a = qb + r

37 Introduction to Abstract Mathematics gcd(a,b) if b = 0, then answer = a. else write a = qb + r answer = gcd(b,r) Example 1 GCD(102, 70) 102 = = GCD(70, 32) 70 = 2x = GCD(32, 6) 32 = 5x6 + 2 = GCD(6, 2) 6 = 3x2 + 0 = GCD(2, 0) Return value: 2. Example 2 GCD(252, 189) 252 = 1x = GCD(189, 63) 189 = 3x = GCD(63, 0) Return value: 63. GCD(662, 414) 662 = 1x = GCD(414, 248) 414 = 1x = GCD(248, 166) 248 = 1x = GCD(166, 82) 166 = 2x = GCD(82, 2) 82 = 41x2 + 0 = GCD(2, 0) Return value: 2. Example 3

38 Introduction to Abstract Mathematics Euclid: gcd(a,b) = gcd(b,r)a = qb + r Correctness of Euclid’s GCD Algorithm Let d be a common divisor of b, r  b = k 1 d and r = k 2 d for some k 1, k 2.  a = qb + r = qk 1 d + k 2 d = (qk 1 + k 2 )d => d is a divisor of a Let d be a common divisor of a, b  r = a – qb = k 3 d – qk 1 d = (k 3 – qk 1 )d => d is a divisor of r So d is a common factor of a, b iff d is a common factor of b, r  d = gcd(a, b) iff d = gcd(b, r) When r > 0:

39 Introduction to Abstract Mathematics Practice problems 1. Study the Sections from your textbook. 2. Be sure that you understand all the examples discussed in class and in textbook. 3. Do the following problems from the textbook: Exercise 3.1 # 13, 16, 32, 36, 45 Exercise 3.2 # 15, 19, 21, 32, Exercise 3.3 # 13, 16, 25, 26, Exercise 3.4 # 4, 6, 8, 10, 18, 33