CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett

Slides:



Advertisements
Similar presentations
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Advertisements

Recursive Definitions and Structural Induction
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
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.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
Week 5 - Friday.  What did we talk about last time?  Sequences  Summation and production notation  Proof by induction.
Induction and Recursion. Odd Powers Are Odd Fact: If m is odd and n is odd, then nm is odd. Proposition: for an odd number m, m k is odd for all non-negative.
Induction and recursion
1.  The set N = {1,2,3,4,……..} is known as natural numbers or the set of positive integers  The natural numbers are used mainly for :  counting  ordering.
Recursive Definitions Rosen, 3.4. Recursive (or inductive) Definitions Sometimes easier to define an object in terms of itself. This process is called.
CSE115/ENGR160 Discrete Mathematics 03/22/12 Ming-Hsuan Yang UC Merced 1.
CSE115/ENGR160 Discrete Mathematics 03/31/11
Discrete Structures Chapter 5: Sequences, Mathematical Induction, and Recursion 5.2 Mathematical Induction I [Mathematical induction is] the standard proof.
1 Section 3.3 Mathematical Induction. 2 Technique used extensively to prove results about large variety of discrete objects Can only be used to prove.
1 Strong Mathematical Induction. Principle of Strong Mathematical Induction Let P(n) be a predicate defined for integers n; a and b be fixed integers.
Mathematical Induction
1 Mathematical Induction. 2 Mathematical Induction: Example  Show that any postage of ≥ 8¢ can be obtained using 3¢ and 5¢ stamps.  First check for.
Induction and Recursion by: Mohsin tahir (GL) Numan-ul-haq Waqas akram Rao arslan Ali asghar.
Induction and recursion
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Mathematical Maxims and Minims, 1988
Induction and recursion
Discrete Mathematics, 1st Edition Kevin Ferland
Mathematics Review Exponents Logarithms Series Modular arithmetic Proofs.
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!
1 Introduction to Abstract Mathematics Chapter 4: Sequences and Mathematical Induction Instructor: Hayk Melikya 4.1- Sequences. 4.2,
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
INDUCTION AND RECURSION. PRINCIPLE OF MATHEMATICAL INDUCTION To prove that P(n) is true for all positive integers n, where P(n) is a propositional function,
1 CMSC 250 Chapter 4, con't., Inductive Proofs. 2 CMSC 250 Description l Inductive proofs must have: –Base case: where you prove that what it is you are.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Induction Proof. Well-ordering A set S is well ordered if every subset has a least element. [0, 1] is not well ordered since (0,1] has no least element.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Section 3.3: Mathematical Induction Mathematical induction is a proof technique that can be used to prove theorems of the form:  n  Z +,P(n) We have.
ICS 253: Discrete Structures I Induction and Recursion King Fahd University of Petroleum & Minerals Information & Computer Science Department.
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
Mathematical Induction Section 5.1. Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Chapter 5. Section 5.1 Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If we can reach.
1 Discrete Mathematical Mathematical Induction ( الاستقراء الرياضي )
6/12/2016 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(2) Mathematical Induction & Recursion Dr.Saad Alabbad Department of.
Chapter 5 With Question/Answer Animations 1. Chapter Summary Mathematical Induction - Sec 5.1 Strong Induction and Well-Ordering - Sec 5.2 Lecture 18.
Induction and Recursion CSC-2259 Discrete Structures Konstantin Busch - LSU1.
CSE 311 Foundations of Computing I Lecture 15 Strong Induction and Recursive Definitions Spring
Mathematical Induction And Recursion Discrete Math Team KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) 1.
3.3 Mathematical Induction 1 Follow me for a walk through...
Chapter 5 1. Chapter Summary  Mathematical Induction  Strong Induction  Recursive Definitions  Structural Induction  Recursive Algorithms.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Chapter 4: Induction and Recursion
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Advanced Algorithms Analysis and Design
CS2210:0001Discrete Structures Induction and Recursion
Induction and recursion
Induction and Recursion
Mathematical Induction Recursion
Chapter 5 Induction and Recursion
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CS201: Data Structures and Discrete Mathematics I
BaSIC Math Reviews.
Induction and recursion
Exercise Use mathematical induction to prove the following formula.
CSE 321 Discrete Structures
Applied Discrete Mathematics Week 9: Integer Properties
Follow me for a walk through...
Induction Chapter
Advanced Analysis of Algorithms
Follow me for a walk through...
Presentation transcript:

CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett

Today’s Topics: Strong vs regular indiction Strong induction examples: Divisibility by a prime Recursion sequence: product of fractions

1. Strong induction examples DIVISIBILITY BY A PRIME

Strong vs regular induction Prove: n1 P(n) Base case: P(1) Regular induction: P(n)P(n+1) Strong induction: (P(1)…P(n))P(n+1) Can use more assumptions to prove P(n+1) P(1) P(2) P(3) … P(n) P(n+1) … P(1) P(2) P(3) … P(n) P(n+1) …

Example for the power of strong induction Theorem: For all prices p >= 8 cents, the price p can be paid using only 5-cent and 3-cent coins Proof: Base case: 8=3+5, 9=3+3+3, 10=5+5 Assume it holds for all prices 8..p-1, prove for price p when p11 Proof: since p-38 we can use the inductive hypothesis for p-3. To get price p simply add another 3-cent coin. Much easier than standard induction!

2. Strong induction examples DIVISIBILITY BY A PRIME

Definitions and properties for this proof n is prime if n is composite if n=ab for some 1<a,b<n Prime or Composite exclusivity: All integers greater than 1 are either prime or composite (exclusive or—can’t be both). Definition of divisible: n is divisible by d iff n = dk for some integer k. 2 is prime (you may assume this; it also follows from the definition).

Definitions and properties for this proof (cont.) Goes without saying at this point: The set of Integers is closed under addition and multiplication Use algebra as needed

Thm: For all integers n greater than 1, n is divisible by a prime number. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n = ________. Inductive step: Assume [or “Suppose”] that WTS that So the inductive step holds, completing the proof.

Thm: For all integers n greater than 1, n is divisible by a prime number. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n = ________. Inductive step: Assume [or “Suppose”] that WTS that So the inductive step holds, completing the proof. 1 2 3 Other/none/more than one

Thm: For all integers n greater than 1, n is divisible by a prime number. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n = _2______. Inductive step: Assume [or “Suppose”] that WTS that So the inductive step holds, completing the proof. For some integer n>1, n is divisible by a prime number. For some integer n>1, k is divisible by a prime number, for all integers k where 2kn. Other/none/more than one

Thm: For all integers n greater than 1, n is divisible by a prime number. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n = _2______. Inductive step: Assume [or “Suppose”] that WTS that So the inductive step holds, completing the proof. n+1 is divisible by a prime number. k+1 is divisible by a prime number. Other/none/more than one

Thm: For all integers n greater than 1, n is divisible by a prime number. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n=2. Inductive step: Assume that for some n2, all integers 2kn are divisible by a prime. WTS that n+1 is divisible by a prime. Proof by cases: Case 1: n+1 is prime. n+1 divides itself so we are done. Case 2: n+1 is composite. Then n+1=ab with 1<a,b<n+1. By the induction hypothesis, since an there exists a prime p which divides a. So p|a and a|n+1. We’ve already seen that this Implies that p|n+1 (in exam – give full details!) So the inductive step holds, completing the proof.

2. Strong induction examples RECURSION SEQUENCE: PRODUCT OF FRACTIONS

Definitions and properties for this proof Product less than one: Algebra, etc., as usual

Definition of the sequence: d1 = 9/10 d2 = 10/11 dk = (dk-1)(dk-2) for all integers k3 Thm: For all integers n>0, 0<dn<1. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n = ________. Inductive step: Assume [or “Suppose”] that WTS that So the inductive step holds, completing the proof.

Other/none/more than one Definition of the sequence: d1 = 9/10 d2 = 10/11 dk = (dk-1)(dk-2) for all integers k3 Thm: For all integers n>0, 0<dn<1. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n = ________. Inductive step: Assume [or “Suppose”] that WTS that So the inductive step holds, completing the proof. 1 2 3 Other/none/more than one

For some int n>0, 0<dn<1. Definition of the sequence: d1 = 9/10 d2 = 10/11 dk = (dk-1)(dk-2) for all integers k3 Thm: For all integers n>0, 0<dn<1. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n = _1,2_____. Inductive step: Assume [or “Suppose”] that WTS that So the inductive step holds, completing the proof. For some int n>0, 0<dn<1. For some int n>1, 0<dk<1, for all integers k where 1kn. Other/none/more than one

For some int n>0, 0<dn<1. Definition of the sequence: d1 = 9/10 d2 = 10/11 dk = (dk-1)(dk-2) for all integers k3 Thm: For all integers n>0, 0<dn<1. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n = _1,2_____. Inductive step: Assume [or “Suppose”] that WTS that So the inductive step holds, completing the proof. For some int n>0, 0<dn<1. For some int n>1, 0<dk<1, for all integers k where 1kn. 0<dn+1<1 Other/none/more than one

Definition of the sequence: d1 = 9/10 d2 = 10/11 dk = (dk-1)(dk-2) for all integers k3 Thm: For all integers n>0, 0<dn<1. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n=1,2. Inductive step: Assume [or “Suppose”] that the theorem holds for n2. WTS that 0<dn+1<1. By definition, dn+1=dn dn-1. By the inductive hypothesis, 0<dn-1<1 and 0<dn<1. Hence, 0<dn+1<1. So the inductive step holds, completing the proof.

3. Fibonacci numbers Verifying a solution

Fibonacci numbers 1,1,2,3,5,8,…

Fibonacci numbers 1,1,2,3,5,8,13,21,34,55,…

Fibonacci in nature Many more examples: http://jwilson.coe.uga.edu/emat6680/parveen/fib_nature.htm

Fibonacci numbers 1,1,2,3,5,8,13,21,… Rule: F1=1, F2=1, Fn=Fn-2+Fn-1. Question: can we derive an expression for the n-th term? YES!

Fibonacci numbers Rule: F1=1, F2=1, Fn=Fn-2+Fn-1. We will prove an upper bound: Proof by strong induction. Base case: n=1 n=2 n=1 and n=2 n=1 and n=2 and n=3 Other

Fibonacci numbers Rule: F1=1, F2=1, Fn=Fn-2+Fn-1. We will prove an upper bound: Proof by strong induction. Base case: n=1 n=2 n=1 and n=2 n=1 and n=2 and n=3 Other

Fibonacci numbers Rule: F1=1, F2=1, Fn=Fn-2+Fn-1. We will prove an upper bound: Proof by strong induction. Base case: n=1, n=2. Verify by direct calculation

Fibonacci numbers Rule: F1=1, F2=1, Fn=Fn-2+Fn-1. Theorem: Base cases: n=1,n=2 Inductive step: show… Fn=Fn-1+Fn-2 FnFn-1+Fn-2 Fn=rn Fn rn Other

Fibonacci numbers Rule: F1=1, F2=1, Fn=Fn-2+Fn-1. Theorem: Base cases: n=1,n=2 Inductive step: show… Fn=Fn-1+Fn-2 FnFn-1+Fn-2 Fn=rn Fn rn Other

Fibonacci numbers Inductive step: need to show , What can we use? Definition of Fn: Inductive hypothesis: That is, we need to show that

Fibonacci numbers Finishing the inductive step. Need to show: Simplifying, need to show: Choice of actually satisfied (this is why we chose it!) QED

Fibonacci numbers - recap Recursive definition of a sequence Base case: verify for n=1, n=2 Inductive step: Formulated what needed to be shown as an algebraic inequality, using the definition of Fn and the inductive hypothesis Simplified algebraic inequality Proved the simplified version