INDUCTION Slides of Ken Birman, Cornell University.

Slides:



Advertisements
Similar presentations
Mathematical Induction
Advertisements

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
CPSC 121: Models of Computation
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.
Rethinking Recursion Prof. Chung-Ta King Department of Computer Science National Tsing Hua University CS1103 電機資訊工程實習 (Contents from Dr. Jürgen Eckerle,
Snick  snack CPSC 121: Models of Computation 2011 Winter Term 1 Revisiting Induction Steve Wolfman, based on work by Patrice Belleville and others 1.
TR1413: INTRO TO DISCRETE MATHEMATICS LECTURE 2: 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.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 12 Number theory Mathematical induction Proof by induction Examples.
CSS342: Induction1 Professor: Munehiro Fukuda. CSS342: Induction2 Today’s Topics Review of sequence and summations Mathematical induction Strong form.
Problems to Solve Involving Induction Proof by Induction Basis Step: Does it work for n=0?
Copyright © Cengage Learning. All rights reserved.
Mathematical Induction Readings on induction. (a) Weiss, Sec. 7.2, page 233 (b) Course slides for lecture and notes recitation. Every criticism from a.
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.
Algorithm Design and Analysis (ADA)
Copyright © Peter Cappello Mathematical Induction Goals Explain & illustrate construction of proofs of a variety of theorems using mathematical induction.
Section 1.8. Section Summary Proof by Cases Existence Proofs Constructive Nonconstructive Disproof by Counterexample Nonexistence Proofs Uniqueness Proofs.
Math Review Data Structures & File Management Computer Science Dept Va Tech July 2000 ©2000 McQuain WD 1 Summation Formulas Let N > 0, let A, B, and C.
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.
Discrete Maths: Induction/1 1 Discrete Maths Objective – –to introduce mathematical induction through examples , Semester
Chapter Mathematical Induction 4.2 Strong Induction and Well-Ordering 4.3 Recursive Definitions and Structural Induction 4.4 Recursive Algorithms.
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.
INDUCTION Lecture 23 CS2110 – Spring 2015 A scientist gave a lecture on astronomy. He described how the earth orbits the sun, which, in turn, orbits the.
Copyright © Zeph Grunschlag, Induction Zeph Grunschlag.
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.
Discrete Structures & Algorithms More on Methods of Proof / Mathematical Induction EECE 320 — UBC.
CompSci 102 Discrete Math for Computer Science March 1, 2012 Prof. Rodger Slides modified from Rosen.
Induction & Recursion Weiss: ch 7.1. Recursion –a programming strategy for solving large problems –Think “divide and conquer” –Solve large problem by.
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
1 INFO 2950 Prof. Carla Gomes Module Induction Rosen, Chapter 4.
1/32 This Lecture Substitution model An example using the substitution model Designing recursive procedures Designing iterative procedures Proving that.
Inductive Proofs and Inductive Definitions Jim Skon.
CSE373: Data Structures and Algorithms Lecture 2: Proof by Induction Linda Shapiro Winter 2015.
Mathematical Induction
Copyright © Zeph Grunschlag, Induction Zeph Grunschlag.
INDUCTION Lecture 21 CS2110 – Spring 2014 A well-known scientist (Bertrand Russell?) once gave a public lecture on astronomy. He described how the earth.
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.
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.
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.
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.
1 Discrete Mathematical Mathematical Induction ( الاستقراء الرياضي )
Mathematical Induction
Mathematical Induction EECS 203: Discrete Mathematics Lecture 11 Spring
Chapter 5 1. Chapter Summary  Mathematical Induction  Strong Induction  Recursive Definitions  Structural Induction  Recursive Algorithms.
Hubert Chan (Chapters 1.6, 1.7, 4.1)
11.7 – Proof by Mathematical Induction
CSE 311 Foundations of Computing I
Chapter 3 The Real Numbers.
Induction and recursion
CSE 311: Foundations of Computing
Hubert Chan (Chapters 1.6, 1.7, 4.1)
Mathematical Induction
Chapter 5 Induction and Recursion
CSE373: Data Structures and Algorithms Lecture 2: Proof by Induction
Induction and recursion
Follow me for a walk through...
Applied Discrete Mathematics Week 9: Integer Properties
Follow me for a walk through...
This Lecture Substitution model
Induction Chapter
Copyright © Cengage Learning. All rights reserved.
Induction Lecture 20 CS2110 – Spring 2013
Mathematical Induction
Follow me for a walk through...
Agenda Proofs (Konsep Pembuktian) Direct Proofs & Counterexamples
Presentation transcript:

INDUCTION Slides of Ken Birman, Cornell University

Overview: Reasoning about Programs 2  Our broad problem: code is unlikely to be correct if we don’t have good reasons for believing it works  We need clear problem statements  And then a rigorous way to convince ourselves that what we wrote solves the problem  But reasoning about programs can be hard  Especially with recursion, concurrency  Today focus on recursion

Overview: Reasoning about Programs 3  Recursion  A programming strategy that solves a problem by reducing it to simpler or smaller instance(s) of the same problem  Induction  A mathematical strategy for proving statements about natural numbers 0,1,2,... (or more generally, about inductively defined objects)  They are very closely related  Induction can be used to establish the correctness and complexity of programs

Induction over Integers 4  To prove that some property P(n) holds for all integers n ≥ 0, 1. Basis: Show that P(0) is true 2. Induction Step: Assuming that P(k) is true for an unspecified integer k, show that P(k+1) is true  Conclusion: Because we could have picked any k, we conclude that P(n) holds for all integers n ≥ 0

Dominos 5  Assume equally spaced dominos, and assume that spacing between dominos is less than domino length  How would you argue that all dominos would fall?  Dumb argument:  Domino 0 falls because we push it over  Domino 0 hits domino 1, therefore domino 1 falls  Domino 1 hits domino 2, therefore domino 2 falls  Domino 2 hits domino 3, therefore domino 3 falls ...  Is there a more compact argument we can make?

Better Argument 6  Argument:  Domino 0 falls because we push it over (Base Case or Basis)  Assume that domino k falls over (Induction Hypothesis)  Because domino k’s length is larger than inter-domino spacing, it will knock over domino k+1 (Inductive Step)  Because we could have picked any domino to be the k th one, we conclude that all dominos will fall over (Conclusion)  This is an inductive argument  Not only is this argument more compact, it works for an arbitrary number of dominoes!

Inductive Proofs  Proving that a statement S(n) is true for all integers at or above some lower limit  Let S(n) be some arbitrary statement about an integer n, we prove two facts:  The basis case, S(k) (k is usually zero)  The inductive step, where we prove that for all n ≥ k, S(n) implies S(n + 1), assuming S(n) is true. S(n) is called the inductive hypothesis.

Example Prove:  n i = n(n +1)/2 i=1 In logical notation we wish to show  n [  n i = n(n +1)/2 ] i=1 Hence, S(n) is [  n i] = n(n +1)/2 i=1 Basis: Prove: S(1): 1 = 1(1 +1)/2 Induction Hypotheses: Assume S(n) is true for n arbitrary.

Example Inductive step: Write down the assertion S(n+1) S(n + 1) is the assertion  n+1 i = (n+1)((n +1)+1)/2 i=0  n+1 i =  n i +n+1 i=0 = n(n +1)/2 + n+1 (from induction hypothesis ) = (n(n +1) + 2(n+1) )/ 2 = (n+1)(n+2)/ 2 = (n+1)((n +1)+1)/2 Q.E.D.

Revisiting Previous Example 10  Prove that n = n(n+1)/2  Basis: Obviously holds for n = 0  Induction Hypothesis: Assume 0+1+…+k = k(k+1)/2  Inductive Step: 0+1+…+(k+1) = [0+1+…+k] + (k+1)by def = k(k+1)/2 + (k+1)by I.H. = (k+1)(k+2)/2algebra  Conclusion: 0+1+…+n = n(n+1)/2 for all n ≥ 0

A Note on Base Cases 11  Sometimes we are interested in showing some proposition is true for integers ≥ b  Intuition: we knock over domino b, and dominoes in front get knocked over; not interested in 0,1,…,(b − 1)  In general, the base case in induction does not have to be 0  If base case is some integer b  Induction proves the proposition for n = b, b+1, b+2, …  Does not say anything about n = 0,1,…,b −

What are the “Dominos”? 12  In some problems, it can be tricky to determine how to set up the induction  This is particularly true for geometric problems that can be attacked using induction

A Tiling Problem 13  A chessboard has one square cut out of it  Can the remaining board be tiled using tiles of the shape shown in the picture (rotation allowed)?  Not obvious that we can use induction! 8 8

Proof Outline 14  Consider boards of size 2 n x 2 n for n = 1,2,…  Basis: Show that tiling is possible for 2 x 2 board  Induction Hypothesis: Assume the 2 k x 2 k board can be tiled  Inductive Step: Using I.H. show that the 2 k+1 x 2 k+1 board can be tiled  Conclusion: Any 2 n x 2 n board can be tiled, n = 1,2,…  Our chessboard (8 x 8) is a special case of this argument  We will have proven the 8 x 8 special case by solving a more general problem!

Basis 15  The 2 x 2 board can be tiled regardless of which one of the four pieces has been omitted 2 x 2 board

4 x 4 Case 16  Divide the 4 x 4 board into four 2 x 2 sub-boards  One of the four sub-boards has the missing piece  By the I.H., that sub-board can be tiled since it is a 2 x 2 board with a missing piece  Tile center squares of three remaining sub-boards as shown  This leaves three 2 x 2 boards, each with a missing piece  We know these can be tiled by the Induction Hypothesis

2 k+1 x 2 k+1 case 17  Divide board into four sub-boards and tile the center squares of the three complete sub-boards  The remaining portions of the sub-boards can be tiled by the I.H. (which assumes we can tile 2 k x 2 k boards)

Conclusion 18  Induction is a powerful proof technique  Recursion is a powerful programming technique  Induction and recursion are closely related  We can use induction to prove correctness and complexity results about recursive programs