CPSC 121: Models of Computation Unit 9 Mathematical Induction Based on slides by Patrice Belleville and Steve Wolfman
Announcements Pre-class quiz #10 is tentatively due on Wednesday November 22nd at 9:00pm. Textbook sections: o Epp, 4th edition: 6.1, 7.1 o Epp, 3rd edition: 5.1, 6.1 o Rosen, 6th edition: 2.1, 2.3 up to the top of page 136. o Rosen, 7th edition: 2.1, 2.3 down to the bottom of page 141. Assignment #5 is due Monday November 27th at 4:00 pm. Unit 9 : Induction 2
Pre-Class Learning Goals By the start of class, you should be able to Convert sequences to and from explicit formulas that describe the sequence. Convert sums to and from summation/Σ notation. Convert products to and from product/ Π notation. Manipulate formulas in summation/product notation by adjusting their bounds, merging or splitting summations/products, and factoring out values. Given a theorem to prove and the insight into how to break the problem down in terms of smaller problems , write out the skeleton of an inductive proof including: o the base case(s), o the induction hypothesis, and o the inductive step Unit 9 : Induction 3
Quiz 9 Feedback Generally: Issues: Essay Question: As usual, we will revisit the open-ended question shortly. Unit 9 : Induction 4
In-Class Learning Goals By the end of this unit, you should be able to: Prove properties of self-referential structures using inductive proofs that naturally build on those self-references. Critique formal inductive proofs to determine whether they are valid and where the error(s) lie if they are invalid. Formally prove properties of the non-negative integers (or a subset like integers that have appropriate self-referential structure) — including both equalities and inequalities — using either weak or strong induction as needed. Unit 9 : Induction 5
? ? Addressing the Course Big Questions CPSC 121: the BIG questions: How can we convince ourselves that an algorithm does what it's supposed to do? How do we determine whether or not one algorithm is better than another one? Mathematical induction is a very useful tool when proving the correctness or efficiency of an algorithm. We will see several examples of this. Unit 9 : Induction 6
Outline Example: single-elimination tournaments. Validating mathematical induction. A Pattern for Induction More examples using induction. A slightly different type of induction. Additional Examples Unit 9 : Induction 7
Example: Single-Elimination Tournament Problem: single-elimination tournament Teams play one another in pairs The winner of each pair advances to the next round The tournament ends when only one team remains. Los Angeles Vancouver Los Angeles Toronto Toronto St. Louis Los Angeles Montréal Pittsburgh New York Isl. New York Isl. Montréal Montréal Buffalo Round 3 Round 2 Round 1 Unit 9 : Induction 8
Question What is the maximum number of teams which can participate in a n -round single-elimination tournament ? (Try some examples first) A. n B. 2n C. n 2 D. 2 n E. None of the above. Unit 9 : Induction 9
How can we prove it? How can we prove it for every n ? We will use a technique called mathematical induction. We show some basic cases first (for 0,1,2 ) Then we show that if the statement is true for case n then it is true for case n+1 ( inductive step ) (OR if it is true for case n-1, then it is true for case n). Then we conclude that the statement is true for every n. First we will convince ourselves that this is a valid proof technique. Many theorems involve summations, so it is important to be comfortable manipulating them. Hence the reading for pre-class quiz #9. Unit 9 : Induction 10
Base Case : n=0 What is the max number of teams which can participate in a tournament with 0 rounds? A. 0 B. 1 C. 2 D. Any number E. None of the above Is the statement correct for n = 0? Yes, because ____________________ Unit 9 : Induction 11
Inductive Step: Case for n Case for n+1 If at most 2 n teams can participate in a tournament with n rounds, then at most 2 n+1 teams can participate in a tournament with n+1 rounds? If we want to prove this statement, which of the following techniques might we use? A. Antecedent assumption B. Witness proof C. WLOG D. Proof by cases E. None of the above. Unit 9 : Induction 12
Working out the proof: Proof : Consider an unspecified tournament with n rounds. Assume that How many teams we need to have a tournament with n+1 rounds? We can think of a tournament with n+1 rounds as follows: o Two tournaments with n rounds proceed in parallel. o The two winners then play the n+1 round. Since each tournament with n rounds has at most 2 n teams, the tournament with n+1 rounds has at most _______________ teams. QED Unit 9 : Induction 13
Completing the proof: Inductive Step : if at most 2 n teams can play in an n - round tournament, then at most 2 n+1 teams can play in an ( n+1) -round tournament. Proof: Assume at most 2 n teams can play in an n -round tournament. An ( n+1) -round tournament is two n -round tournaments where the winners play each other (since there must be a single champion). By assumption, each of these may have at most 2 n teams. So, the overall tournament has at most 2*2 n = 2 n+1 teams. QED! Unit 9 : Induction 14
How Induction Works How do we use this to prove what we want? Recall Universal Modus Ponens: P(a) ∀ x ∈ D, P(x) → Q(x) \ Q(a) If we define P(n, 2 n ) : Up to 2 n teams can participate in a tournament with n rounds then we have proved ∀ n ∈ N , P(n, 2 n ) → P(n+1, 2 n+1 ) Unit 9 : Induction 15
How Induction Works(cont') So We know that at most only 1 team can play with 0 rounds. This is P(0, 1) . Given P(0, 1) ∀ n ∈ N , P(n, 2 n ) → P(n+1, 2 n+1 ) We can deduce: P(1, 2) Unit 9 : Induction 16
How Induction Works(cont') Given P(1, 2) ∀ n ∈ N , P(n, 2 n ) → P(n+1, 2 n+1 ) We can deduce: P(2, 4) Given P(2, 4) ∀ n ∈ N , P(n, 2 n ) → P(n+1, 2 n+1 ) We can deduce: P(3, 8) Unit 9 : Induction 17
How Induction Works(cont') Given P(3, 8) ∀ n ∈ N , P(n, 2 n ) → P(n+1, 2 n+1 ) We can deduce: P(4, 16) Etc... Therefore we can show that ∀ n ∈ N, P(n, 2 n ) Unit 9 : Induction 18
How Induction Works(cont') Another way to think about this: Given an unspecified positive integer n. To prove P(n+1, 2 n+1 ): o First we prove P(n, 2 n ) o Then we use the fact that • ∀ n ∈ N , P(n, 2 n ) → P(n+1, 2 n+1 ) Hence induction is more or less the same as recursion! A fun example involving induction: http://www.youtube.com/watch?v=daRS98L9rHs&feat ure=related Unit 9 : Induction 19
Outline Example: single-elimination tournaments. Validating mathematical induction. A Pattern for Induction More examples using induction. A slightly different type of induction. Additional Examples Unit 9 : Induction 20
Validating Mathematical Inducton Define Q(n) ≡ P(n, 2 n ) In the previous example, we proved Q(0) ∀ n ∈ N, Q(n) → Q(n+1) and deduced that ∀ n ∈ N, Q(n) Why is this a valid proof technique? Unit 9 : Induction 21
Validating M.I. (cont') Theorem: Q(0) ^ ( ∀ n ∈ N, Q(n) → Q(n+1)) → ∀ n ∈ N, Q(n) Proof: We use a proof by contradiction. Suppose that the premises hold, but that ∀ n ∈ N, Q(n) is false. Then there is at least one value of n for which Q(n) does not hold. Let y be the smallest such value. Clearly y > 0, so y – 1 ∈ N. Unit 9 : Induction 22
Validating M.I. (cont') Proof (continued): Because y is the smallest value for which Q(n) is false, and y – 1 ∈ N, Q(y - 1) is true. But then the 2nd premise implies that Q(y) is true, a contradiction (since we assumed Q(y) was false). Therefore the conclusion must be true, that is ∀ n ∈ N, Q(n) holds. Unit 9 : Induction 23
Validating M.I. (cont') So a proof by mathematical induction has One (or more) base case(s): Q(0) oUsually very straightforward to prove. An induction step: ∀ n ∈ N, Q(n) → Q(n+1) oWe can use any proof technique we know for it. oUsually a WLOG + antecedent assumption proof will work well. Unit 9 : Induction 24
Outline Example: single-elimination tournaments. Validating mathematical induction. A Pattern for Induction More examples using induction. A slightly different type of induction. Additional Examples Unit 9 : Induction 25
Guidelines for a Simple Induction Proof Type of Problem: Prove some property of a structure that is naturally defined in terms of itself. Part 1: Insight: First figure out how the problem “breaks down” in terms of smaller pieces? More specifically: How to define a problem of size n+1 using one or more pieces of size n. Part 2: Proof. Base case(s) : Figure out which problems cannot be broken down (usually small ones!). Those will end up as your base cases. Establish that the property is true for your base case(s). Inductive Step: prove that if the property is true for the piece(s) of size n, it is also true for the piece of size n+1. Unit 9 : Induction 26
Recommend
More recommend