Fall 2007CS 2251 Proof by Induction. Fall 2007CS 2252 Proof by Induction There are two forms of induction Standard Induction –Prove the theorem is true.

Slides:



Advertisements
Similar presentations
Mathematical Induction
Advertisements

Introduction to Proofs
Know what is meant by proof by Induction Learning Outcomes: PROOF BY INDUCTION Be able to use proof by induction to prove statements.
Lecture 11 Mathematical Induction CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
To prove by induction that 2 n ≥ n 2 for n ≥ 4, n  N Next (c) Project Maths Development Team 2011.
We want to prove the above statement by mathematical Induction for all natural numbers (n=1,2,3,…) Next SlideSlide 1.
Self-Reference - Induction Cmput Lecture 7 Department of Computing Science University of Alberta ©Duane Szafron 1999 Some code in this lecture is.
Discussion #131/18 Discussion #13 Induction (the process of deriving generalities from particulars) Mathematical Induction (deductive reasoning over the.
1 CSCD 300 Data Structures Recursion. 2 Proof by Induction Introduction only - topic will be covered in detail in CS 320 Prove: N   i = N ( N + 1.
Logic: Connectives AND OR NOT P Q (P ^ Q) T F P Q (P v Q) T F P ~P T F
1 More Applications of the Pumping Lemma. 2 The Pumping Lemma: Given a infinite regular language there exists an integer for any string with length we.
1 Recursion, Recurrences and Induction Supplementary Notes Prepared by Raymond Wong Presented by Raymond Wong.
The Tower of Hanoi
Copyright © Cengage Learning. All rights reserved.
DAST 2005 Tirgul 6 Heaps Induction. DAST 2005 Heaps A binary heap is a nearly complete binary tree stored in an array object In a max heap, the value.
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.
Fall 2004COMP 3351 Regular Expressions. Fall 2004COMP 3352 Regular Expressions Regular expressions describe regular languages Example: describes the language.
Induction and Recursion by: Mohsin tahir (GL) Numan-ul-haq Waqas akram Rao arslan Ali asghar.
Copyright © 2007 Pearson Education, Inc. Slide 8-1.
To prove by induction that (1 + x) n ≥ 1 + nx for x > -1, n  N Next (c) Project Maths Development Team 2011 Note: x>-1. Hence (1+x)>0.
Inductive Proof (the process of deriving generalities from particulars) Mathematical Induction (reasoning over the natural numbers)
CSE 20 Lecture 12 Induction CK Cheng 1. Induction Outlines Introduction Theorem Examples: The complexity calculation – Tower of Hanoi – Merge Sort – Fibonacci.
CSNB143 – Discrete Structure Topic 5 – Induction Part I.
March 3, 2015Applied Discrete Mathematics Week 5: Mathematical Reasoning 1Arguments Just like a rule of inference, an argument consists of one or more.
CSC201 Analysis and Design of Algorithms Asst.Proof.Dr.Surasak Mungsing Oct-151 Lecture 2: Definition of algorithm and Mathematical.
1 Put your name if you want your attendance credit. Please put your as well. CSC 320 is done at 11:30 so I did NOT fill in the box for 11:30 for.
Logical Reasoning:Proof Prove the theorem using the basic axioms of algebra.
To prove by induction that 3 is a factor of 4 n - 1, n  N Next (c) Project Maths Development Team 2011.
(Finite) Mathematical Induction In our first lesson on sequences and series, you were told that How can we be certain that this will be true for all counting.
October 3, 2001CSE 373, Autumn Mathematical Background Exponents X A X B = X A+B X A / X B = X A-B (X A ) B = X AB X N +X N = 2X N 2 N +2 N = 2 N+1.
2-6 Proving Angles Congruent. Theorem: a conjecture or statement that you prove true.
1+2+3+…+n = n(n+1)/2 We want to prove the above statement by mathematical Induction for all natural numbers (n=1,2,3,…) Next SlideSlide 1.
Inductive Proofs and Inductive Definitions Jim Skon.
Slide Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
INDUCTION Slides of Ken Birman, Cornell University.
Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
Quiz 7 The way I expected it.. How to do it! 1. Let P(n) be the statement that n 2 = n(n + 1)(2n + 1)/6 for the positive integer n. Be.
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.
Mathematical Induction 1. 2 Suppose we have a sequence of propositions which we would like to prove: P (0), P (1), P (2), P (3), P (4), … P (n), … We.
INDUCTION Lecture 22 CS2110 – Fall 2009 A well-known scientist (some say it was Bertrand Russell) once gave a public lecture on astronomy. He described.
EXAMPLE 3 Write an indirect proof Write an indirect proof that an odd number is not divisible by 4. GIVEN : x is an odd number. PROVE : x is not divisible.
1 Discrete Mathematical Mathematical Induction ( الاستقراء الرياضي )
1 Section 4.4 Inductive Proof What do we believe about nonempty subsets of N? Since  N, <  is well-founded, and in fact it is linear, it follows that.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 2.
Proof Techniques CS160/CS122 Rosen: 1.5, 1.6, 1.7.
11.7 – Proof by Mathematical Induction
Methods of Proof.
Chapter 3 The Real Numbers.
Proofs, Recursion and Analysis of Algorithms
Notes 9.5 – Mathematical Induction
Other Forms of Induction
Follow me for a walk through...
CSE 373 Data Structures and Algorithms
Mathematical Induction
Direct Proof and Counterexample I
Follow me for a walk through...
Induction Chapter
Chapter 11: Further Topics in Algebra
To prove by induction that n! > 2n for n > 3, n  N
Copyright © Cengage Learning. All rights reserved.
Mathematical Induction
(c) Project Maths Development Team 2011
2.4 Mathematical Induction
Mathematical Induction
Follow me for a walk through...
Copyright © Cengage Learning. All rights reserved.
Agenda Proofs (Konsep Pembuktian) Direct Proofs & Counterexamples
Recursive Thinking.
11.4 Mathematical Induction
Chapter 1 Automata CE year IV.
Presentation transcript:

Fall 2007CS 2251 Proof by Induction

Fall 2007CS 2252 Proof by Induction There are two forms of induction Standard Induction –Prove the theorem is true for some base case (n=0 or n=1) –Show that if the theorem is assumed true for n, then it must be true for n+1 Complete Induction –Show that if the theorem is assumed true for all k<n, then it must be true for n+1

Fall 2007CS 2253 Example 1 Prove that for all n>=1, S(n) is true S(n): 1/(1x2) + 1/(2x3) /(n(n+1)) = n/(n+1)

Fall 2007CS 2254 Proof of Basis Show S(1) is true. – The left-hand side is just 1/1x2) which is 1/2. – The right-hand side is 1/(1+1) which is 1/2 so the statement is true when n=1.

Fall 2007CS 2255 Induction Step Assume S(k) is true for some k >= 1: 1/(1x2) /(k(k+1)) = k/(k+1) Show S(k+1) is true: 1/(1x2) /((k+1)(k+2)) = (k+1)/(k+2) –The left-hand side of S(k+1) is 1/(1x2) /(k(k+1)) + 1/((k+1)(k+2)) = [1/(1x2) /(k(k+1))] + 1/((k+1)(k+2)) –By our induction assumption, the above equals [k/(k+1)] + 1/((k+1)(k+2)) = (1/(k+1)) [k + 1/(k+2)] = (1/(k+1)) [ (k(k+2) + 1))/(k+2) ] = (1/(k+1)) [ (k^2 + 2k + 1)/(k+2) ] = (1/(k+1)) [ (k + 1)^2 / (k+2) ] = (k+1)/(k+2)

Fall 2007CS 2256 Conclusion Under our induction hypothesis, we have shown that the left- and right-hand sides of S(k+1) are true. Therefore, the equation is valid for all n >= 1.

Fall 2007CS 2257 Towers of Hanoi A method for the Towers of Hanoi problem is: public static void Towers(int n, int from, int to, int other) { /*1 */ if (n > 1) /* 2 */ Towers(n-1, from, other, to); /* 3 */ System.out.println("Move disk " + n + " to pole " + to); /* 4 */ if (n > 1) /* 5*/ Towers(n-1, other, to, from); } Show that if n has the value k, k>= 1, then the total number of calls to Towers is 2 k - 1.

Fall 2007CS 2258 Basis The value of n = 1. If Towers is called and the value of n is 1, then the tests at (1) and (4) fail so there is no recursion and hence the number of calls is 1. But 1 = so the assertion is true for the basis case.

Fall 2007CS 2259 Induction Step Assume the assertion is true if n has the value k for some k>=1: the number of calls is 2 k - 1. Assume Towers is called and the value of the formal paramter n is k+1. Show the total number of calls is 2 k Since k>=1, (k+1)>1 so the calls at (2) and (5) occurwith actual parameter values of k in each case. By our induction assumption, these calls each require 2 k - 1 calls for a total of 2 k k = 2x2 k - 1 = 2 k The number of calls is thus 2 k - 1, if the value of n is k for any k>=1.