Great Theoretical Ideas In Computer Science Steven Rudich CS 15 251 Lecture 4 Jan 22 2004 Spring 2004 Carnegie Mellon University Induction One Step At A Time Last time we talked about different ways to represent numbers unary binary decimal base b plus minus binary Egyptian binary Different representations had different advantages and disadvantages Today we will talk about INDUCTION Induction is the primary way we 1 Prove theorems 2 Construct and define objects Representing a problem or object inductively is one of the most fundamental abstract representations Let s start with dominoes Domino Principle Line up any number of dominos in a row knock the first one over and they will all fall n dominoes numbered 1 to n Fk The kth domino will fall If we set them all up in a row then we know that each one is set up to knock over the next one For all 1 k n Fk Fk 1 n dominoes numbered 1 to n Fk The kth domino will fall For all 1 k n Fk Fk 1 F1 F2 F3 F1 All Dominoes Fall n dominoes numbered 0 to n 1 Fk The kth domino will fall For all 0 k n 1 Fk Fk 1 F0 F1 F2 F0 All Dominoes Fall The Natural Numbers 0 1 2 3 Plato The Domino Principle works for an infinite row of dominoes Aristotle Never seen an infinite number of anything much less dominoes Plato s Dominoes One for each natural number An infinite row 0 1 2 of dominoes one domino for each natural number Knock the first domino over and they all will fall Proof Suppose they don t all fall Let k 0 be the lowest numbered domino that remains standing Domino k 1 0 did fall but k 1 will knock over domino k Thus domino k must fall and remain standing Contradiction The Infinite Domino Principle Fk The kth domino will fall Assume we know that for every natural number k Fk Fk 1 F 0 F 1 F2 F0 All Dominoes Fall Mathematical Induction statements proved instead of dominoes fallen Infinite sequence of dominoes Fk domino k fell Establish 1 F0 Infinite sequence of statements S0 S1 Fk Sk proved 2 For all k Fk Fk 1 Conclude that Fk is true for all k Inductive Proof Reasoning To Prove k Sk Establish Base Case S0 Establish k Sk Sk 1 that k Sk Sk 1 Assume hypothetically that Sk for any particular k Conclude that Sk 1 Inductive Proof Reasoning To Prove k Sk Establish Base Case S0 Establish that k Sk Sk 1 Induction Hypothesis Sk k Sk Sk 1 Use I H to show Sk 1 Inductive Proof Reasoning To Prove k b Sk Establish Base Case Sb Establish that k b Sk Sk 1 Assume k b Assume Inductive Hypothesis Sk Prove that S follows We already know that n n 1 2 3 n 1 n n n 1 2 Let s prove it by induction Let Sn n n 1 2 Sn n n n 1 2 Use induction to prove k 0 Sk Establish Base Case S0 0 The sum of the first 0 numbers 0 Setting n 0 the formula gives 0 0 1 2 0 Establish that k 0 Sk Sk 1 Inductive Hypothesis Sk k k k 1 2 k 1 k k 1 k k 1 2 k 1 Using I H k 1 k 2 2 which proves Induction is also how we can define and construct our world So many things from buildings to computers are built up stage by stage module by module each depending on the previous stages Well almost always Inductive Definition Of Functions Stage 0 Initial Condition or Base Case Declare the value of the function on some subset of the domain Inductive Rules Define new values of the function in terms of previously defined values of the function F x is defined if and only if it is implied by finite iteration of the rules Inductive Definition Recurrence Relation for F X Initial Condition or Base Case F 0 1 Inductive Rule For n 0 F n F n 1 F n 1 n 0 F n 1 1 2 3 4 5 6 7 Inductive Definition Recurrence Relation for F X Initial Condition or Base Case F 0 1 Inductive Rule For n 0 F n F n 1 F n 1 n 0 1 F n 1 2 2 3 4 5 6 7 Inductive Definition Recurrence Relation for F X Initial Condition or Base Case F 0 1 Inductive Rule For n 0 F n F n 1 F n 1 n 0 1 2 F n 1 2 4 3 4 5 6 7 Inductive Definition Recurrence Relation for F X Initial Condition or Base Case F 0 1 Inductive Rule For n 0 F n F n 1 F n 1 n F n 0 1 1 2 2 4 3 4 5 6 8 1 6 3 2 6 4 7 1 2 8 Inductive Definition Recurrence Relation for F X 2X Initial Condition or Base Case F 0 1 Inductive Rule For n 0 F n F n 1 F n 1 n F n 0 1 1 2 2 4 3 4 5 6 8 1 6 3 2 6 4 7 1 2 8 Inductive Definition Recurrence Relation Initial Condition or Base Case F 1 1 Inductive Rule For n 1 F n F n 2 F n 2 n F n 0 1 1 2 3 4 5 6 7 Inductive Definition Recurrence Relation Initial Condition or Base Case F 1 1 Inductive Rule For n 1 F n F n 2 F n 2 n F n 0 1 2 1 2 3 4 5 6 7 Inductive Definition Recurrence Relation Initial Condition or Base Case F 1 1 Inductive Rule For n 1 F n F n 2 F n 2 n F n 0 1 2 1 2 3 4 4 5 6 7 Inductive Definition Recurrence Relation Initial Condition or Base Case F 1 1 Inductive Rule For n 1 F n F n 2 F n 2 n 0 1 2 3 4 5 6 7 F n 1 2 4 Inductive Definition Recurrence Relation F X X for X a whole power of 2 Initial Condition or Base Case F 1 1 Inductive Rule For n 1 F n F n 2 F n 2 n 0 1 2 3 4 5 6 7 F n 1 2 4 Base Case 8x2 P X 0 X Inductive Rule 8x y2 y 0 P x y P x y 1 1 P x y 0 1 2 3 0 1 2 3 4 5 6 7 Base Case 8x2 P X 0 X Inductive Rule 8x y2 y 0 P x y P x y 1 1 P x y 0 0 0 1 1 2 2 3 3 1 2 3 4 5 6 7 Base Case 8x2 P X 0 X Inductive Rule 8x y2 y 0 P x y …
View Full Document
Unlocking...