Proofs, Recursion and Analysis of Algorithms

Slides:



Advertisements
Similar presentations
Mathematical Induction
Advertisements

Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
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
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.
1 Mathematical Induction. 2 Mathematical Induction: Example  Show that any postage of ≥ 8¢ can be obtained using 3¢ and 5¢ stamps.  First check for.
CSE115/ENGR160 Discrete Mathematics 03/22/12 Ming-Hsuan Yang UC Merced 1.
Discrete Structures Chapter 5: Sequences, Mathematical Induction, and Recursion 5.2 Mathematical Induction I [Mathematical induction is] the standard proof.
Proofs, Recursion, and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
Chapter 10 Sequences, Induction, and Probability Copyright © 2014, 2010, 2007 Pearson Education, Inc Mathematical Induction.
Copyright © Cengage Learning. All rights reserved.
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.
Copyright © 2007 Pearson Education, Inc. Slide 8-1.
ICS 253 Presents Mathematical Induction Sultan Almuhammadi muhamadi
Mathematical Maxims and Minims, 1988
Induction and recursion
Chapter 6 Mathematical Induction
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!
CSNB143 – Discrete Structure Topic 5 – Induction Part I.
1 Introduction to Abstract Mathematics Chapter 4: Sequences and Mathematical Induction Instructor: Hayk Melikya 4.1- Sequences. 4.2,
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,
9.4 Mathematical Induction
CompSci 102 Discrete Math for Computer Science March 1, 2012 Prof. Rodger Slides modified from Rosen.
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.
Slide Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
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.
Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
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 a particular.
1 Discrete Mathematical Mathematical Induction ( الاستقراء الرياضي )
Mathematical Induction I Lecture 19 Section 4.2 Mon, Feb 14, 2005.
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.
Mathematical Induction. The Principle of Mathematical Induction Let S n be a statement involving the positive integer n. If 1.S 1 is true, and 2.the truth.
CS151: Mathematical Foundations of Computing Mathematical Induction.
MATH 224 – Discrete Mathematics
Proofs, Recursion and Analysis of Algorithms
EECS 203: Discrete Mathematics
Chapter 3 The Real Numbers.
Induction and recursion
CSNB 143 Discrete Mathematical Structures
Chapter 5 Induction and Recursion
CS201: Data Structures and Discrete Mathematics I
Notes 9.5 – Mathematical Induction
Induction and recursion
Exercise Use mathematical induction to prove the following formula.
Follow me for a walk through...
CSE 373 Data Structures and Algorithms
Section 2.1 Proof Techniques Introduce proof techniques:   o        Exhaustive Proof: to prove all possible cases, Only if it is about a.
Lesson 11 – Proof by induction
Mathematical Induction I
Mathematical Induction
Mathematical Induction
Follow me for a walk through...
Induction Chapter
Advanced Analysis of Algorithms
Chapter 11: Further Topics in Algebra
Copyright © Cengage Learning. All rights reserved.
Mathematical Induction
(c) Project Maths Development Team 2011
Mathematical Induction
Follow me for a walk through...
Copyright © Cengage Learning. All rights reserved.
11.4 Mathematical Induction
Sets, Combinatorics, Probability, and Number Theory
Chapter 1 Automata CE year IV.
Presentation transcript:

Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2 Copyright © 2006 W.H. Freeman & Co. MSCS Slides Proofs, Recursion and Analysis of Algorithms

Principles of mathematical induction First Principle: P(1) is true (k)P(k) true  P(k+1) true Second Principle: P(r) true for all r, 1rk  P(k+1) true Major difference is in the second statement. Use the second principle when assuming P(k) is not enough to prove P(k+1). Assuming P(r) for any r where 1 r  k gives more ammunition to prove the relation. Use second principle when the case k+1 depends on results further back than k. P(n) is true for all positive integers n P(n) is true for all positive integers n Section 2.2 Induction

Example: First Principle of Induction Prove that 1+2+22…+2n = 2n+1-1 for any n  1. P(1) is the equation 1+2 = 21+1+1 or 3 = 22+1, which is true. We take P(k) = 1+2+22…+2k = 2k+1-1 as the inductive hypothesis and try to establish P(k+1): 1+2+22…+2k+1 = 2k+1+1-1 Again, rewriting the sum on the left side of P(k+1) reveals how the inductive assumption can be used: 1+2+22…+2k+1 = 1+2+22…+ 2k + 2k+1 = 2k+1-1 + 2k+1 = 2(2k+1)-1 = 2k+1+1-1 Therefore, 1+2+22…+2k+1 = 2k+1+1-1 and verifies P(k+1) and completes the proof. ? Section 2.2 Induction

Example: First Principle of Induction Prove that for any positive integer n, the number 22n-1 is divisible by 3. The basis step is to show P(1), that 22(1)-1 = 4-1 = 3 is divisible by 3. Clearly this is true. We assume that 22k+1 is divisible by 3,which means that 22k+1 = 3m for some integer m, or 22k = 3m+1. We want to show that 22(k+1) -1 is divisible by 3. 22(k+1) -1 = 22k+2 -1 = 22•22k-1 = 22(3m+1) -1 (by the inductive hypothesis) = 12m+4 -1 = 12m+3 = 3(4m+1) where 4m+1 is an integer Thus 22(k+1) -1 is divisible by 3. Section 2.2 Induction

Example: Second Principle of Induction Prove that the amount of postage greater than or equal to 8 cents can be built using only 3-cent and 5-cent stamps. Proof using the second principle of Induction Hence, we have to prove that P(n) is true for n  8 where P(n) is the sum of 3 and 5 cent stamps used to make the n cents worth of postage. Base case: P(8) = 3 + 5 = 8 which is true. In this case we will have to establish additional cases to prove this. Hence, establish two cases P(9) and P(10) P(9) = 3 + 3 + 3 = 9 and P(10) = 5 + 5 Assume P(r) is true for any r, 8  r  k and consider P(k+1) We have proved P(r) is true for r = 8,9,10 So, lets assume k+1 is 11 If k+1  11 then (k+1)-3= k-2  8, hence, by inductive hypothesis, P(k-2) is true. Hence, k-2 can be written as a sum of 3s and 5s. Adding an additional 3 results in k+1 as a sum of 3s and 5s. This verifies P(k+1) is true and hence verifies the proof. Section 2.2 Induction