CSE 20 Lecture 12 Induction CK Cheng 1. Induction Outlines Introduction Theorem Examples: The complexity calculation – Tower of Hanoi – Merge Sort – Fibonacci.

Slides:



Advertisements
Similar presentations
Introduction to Proofs
Advertisements

PROOF BY CONTRADICTION
22C:19 Discrete Structures Induction and Recursion Fall 2014 Sukumar Ghosh.
Induction Lecture 5: Sep 21 (chapter of the book and chapter of the notes)
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.
Snick  snack CPSC 121: Models of Computation 2011 Winter Term 1 Revisiting Induction Steve Wolfman, based on work by Patrice Belleville and others 1.
CS5371 Theory of Computation
1 Intro to Induction Supplementary Notes Prepared by Raymond Wong Presented by Raymond Wong.
Snick  snack CPSC 121: Models of Computation 2010 Winter Term 2 Revisiting Induction Steve Wolfman, based on work by Patrice Belleville and others 1.
1 Indirect Argument: Contradiction and Contraposition.
1 CSE 20 Lecture 12: Analysis of Homogeneous Linear Recursion CK Cheng May 5, 2011.
Module #1 - Logic 1 Based on Rosen, Discrete Mathematics & Its Applications. Prepared by (c) , Michael P. Frank. Modified By Mingwu Chen Induction.
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.
CSE115/ENGR160 Discrete Mathematics 03/29/11 Ming-Hsuan Yang UC Merced 1.
Mathematical Induction
Properties of the Integers: Mathematical Induction
Induction and recursion
Lecture 9. Arithmetic and geometric series and mathematical induction
Induction and recursion
Chapter 6 Mathematical Induction
Discrete Mathematics, 1st Edition Kevin Ferland
Introduction to Proofs
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,
Advance Data Structure and Algorithm COSC600 Dr. Yanggon Kim Chapter 1.
Proofs 1/25/12.
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,
CSC201 Analysis and Design of Algorithms Asst.Proof.Dr.Surasak Mungsing Oct-151 Lecture 2: Definition of algorithm and Mathematical.
Discrete Mathematics Tutorial 11 Chin
Mathematical Induction I Lecture 4: Sep 16. This Lecture Last time we have discussed different proof techniques. This time we will focus on probably the.
1 CSE 20 Lecture 11 Function, Recursion & Analysis CK Cheng UC San Diego.
Chap 3 –A theorem is a statement that can be shown to be true –A proof is a sequence of statements to show that a theorem is true –Axioms: statements which.
1 CSE 20 Lecture 13: Analysis of Recursive Functions CK Cheng.
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.
(CSC 102) Lecture 23 Discrete Structures. Previous Lecture Summery  Sequences  Alternating Sequence  Summation Notation  Product Notation  Properties.
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
Foundations of Discrete Mathematics Chapters 5 By Dr. Dalia M. Gil, Ph.D.
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.
Inductive Proofs and Inductive Definitions Jim Skon.
Mathematical Induction
Copyright © Zeph Grunschlag, Induction Zeph Grunschlag.
CS104:Discrete Structures Chapter 2: Proof Techniques.
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 I Lecture 5: Sep 20 (chapter of the textbook and chapter of the course notes)
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.
1 Discrete Mathematical Mathematical Induction ( الاستقراء الرياضي )
Mathematical Induction EECS 203: Discrete Mathematics Lecture 11 Spring
Mathematical Induction I Lecture 19 Section 4.2 Mon, Feb 14, 2005.
Chapter 5 1. Chapter Summary  Mathematical Induction  Strong Induction  Recursive Definitions  Structural Induction  Recursive Algorithms.
Hubert Chan (Chapters 1.6, 1.7, 4.1)
(Proof By) Induction Recursion
CSE15 Discrete Mathematics 03/22/17
CS2210:0001Discrete Structures Induction and Recursion
Chapter 3 The Real Numbers.
Induction and recursion
Hubert Chan (Chapters 1.6, 1.7, 4.1)
Chapter 5 Induction and Recursion
Notes 9.5 – Mathematical Induction
Induction and recursion
Mathematical Induction I
CSE 20: Lecture 8 Boolean Postulates and Theorems CK Cheng
Induction Chapter
Advanced Analysis of Algorithms
Mathematical Induction
Mathematical Induction II
Lecture 3.1: Mathematical Induction
Presentation transcript:

CSE 20 Lecture 12 Induction CK Cheng 1

Induction Outlines Introduction Theorem Examples: The complexity calculation – Tower of Hanoi – Merge Sort – Fibonacci 2

Induction: Introduction Definition: The process of estimating the validity of observations of part of a class of facts as evidence for a proposition about the whole class. (Webster 2. logic b.) We verify the statement starting from the smallest cases, and incrementing to larger cases with assumption that the smaller cases are true. Key: We need to be able to grow from the smallest cases. 3

Induction: Theorem Let P(n) be an assertion defined on the integer n. 1. Base case: P(n 0 ) is true for an integer n Assumption: We assume that for a k ≥ n 0, P(n) is true for all n with k≥n≥ n Incremental case: We can show P(k+1) is true for any k ≥ n 0 using assumption in 2. Then P(n) is true for every n≥n 0. Proof: By contradiction. Suppose P(n) is false for some n ≥ n 0. Let m be the least such n. We thus have m>n 0 (from condition 1). P(m-1) is true (from assumption). From condition 3, we have P(m) to be true which contradicts the assumption. 4

Induction: Example The Tower of Hanoi: The sequence of the number of moves: f 1 =1, f n =2f n-1 +1, can be expressed as f n = 2 n -1. Proof: By induction. Base case: The base case is true because f 1 = =1 Assumption: We assume f n = 2 n -1 for n in 1≤n≤k where k≥1. Incremental: We show that f k+1 =2 k+1 -1 for any k≥1. f k+1 =2f k +1 (Complexity of recursion) = 2×(2 k -1)+1 (From assumption) =2 k+1 -1 (Arithmetic operation) Based on induction theorem f n = 2 n -1 for all integer n≥1 5

Induction: Example Merge Sort Complexity: f 0 =0, f n =2f n-1 +2 n. We can express f n =n2 n for n≥0. Proof: By induction. Base case: The base case is true because f 0 = 0×2 0 =0 Assumption: We assume f n = n2 n for n in 0≤n≤k where k≥0. Incremental: We show that f k+1 =(k+1)2 k+1 for any k≥0. f k+1 =2f k +2 k+1 (Complexity of recursion) = 2×(k2 k )+2 k+1 (From assumption) =(k+1)2 k+1 (Arithmetic operation). From induction theorem, f n =n2 n for all integer n≥0. 6

Induction: Example Complexity in terms of the number of elements: Merge Sort Complexity: f 0 =0, f n =2f n-1 +2 n. We can express f n =n2 n for n≥0. Note that we have m=2 n elements to sort. In other words, the complexity to sort m elements takes mlog 2 m comparison operations. 7

Induction: Example Fibonacci sequence: f 0 =0,f 1 =1, f n =f n-1 +f n-2, can be expressed as f n = √5/5{[(1+√5)/2] n -[(1-√5)/2] n } Proof: By induction. Base case: f 0 =√5/5{[(1+√5)/2] 0 -[(1-√5)/2] 0 } =0 f 1 =√5/5{[(1+√5)/2] -[(1-√5)/2]}=1 (Why f 1 ?) Assumption: The expression is correct for n in 1≤n≤k where k≥1. Incremental: f k+1 =f k +f k-1 =√5/5{[(1+√5)/2] k -[(1-√5)/2] k } +√5/5{[(1+√5)/2] k-1 -[(1- √5)/2] k-1 } (From Assumption) =√5/5{[(1+√5)/2] k+1 -[(1-√5)/2] k+1 } (Arithmetic operation) 8

Induction: Fibonacci exm. iClicker A.The f 1 case in the proof is necessary. B.The f 0 case already covers the base case. C.Fibonacci sequence is supposed to be integers. Thus, we should remove the square root of 5 in the formula. D.None of the above. 9

Induction: Example Exercise: Show that √5/5{[(1+√5)/2] k -[(1-√5)/2] k } +√5/5{[(1+√5)/2] k-1 -[(1- √5)/2] k-1 } = √5/5{[(1+√5)/2] k+1 -[(1-√5)/2] k+1 } Hint: Derive that [(1+√5)/2] k +[(1+√5)/2] k-1 = [(1+√5)/2] k+1 And [(1-√5)/2] k +[(1-√5)/2] k-1 = [(1-√5)/2] k+1 10

Induction: Example Statement: All horses are the same color. Proof: By induction. Base case: A horse is the same color. Assumption: Assume that n horses are the same color for all 1≤n≤k where k≥1. Incremental: We show that k+1 horses are the same color. We separate the horses into two groups x and y with |x|≤k, |y|≤k, |x|+|y|=k+2. Thus x and y overlap by one. From assumption, x are the same color, y are the same color. Because x and y overlaps, x and y are the same color. 11

Induction: iClicker From the proof that all horses are the same color, we can conclude the following: A. All horses are the same color. B. The induction theorem has flaws. C. The induction theorem is correct, but the argument in the proof has flaws. D. The assumption in the proof is wrong. E. None of the above. 12

Induction: iClicker From the proof that all horses are the same color, we can conclude the following: A. The base case has flaws. B. The assumption has flaws. C. The incremental case cannot grow from base case. D. The incremental case has flaws when we have 3 or more horses. E. None of the above. 13