Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
CSE 20 DISCRETE MATH Prof. Shachar Lovett http://cseweb.ucsd.edu/classes/wi15/cse20-a/ Clicker frequency: CA Todays topics β’ Strong induction β’ Section 3.6.1 in Jenkyns, Stephenson Strong vs regular induction β’ Goal is the same: prove βπ β₯ 1, π(π) β’ Standard induction: β’ Base case: n=1 β’ From one step to the next: βπ β₯ 1, π π β π(π + 1) β’ Strong induction: β’ Base case: n=1 β’ Assume more in each step: βπ β₯ 1, π 1 β§ β― β§ π π β π(π + 1) Strong vs regular induction β’ Goal is the same: prove βπ β₯ 1, π(π) β’ Standard induction: β’ Base case: n=1 β’ From one step to the next: βπ β₯ 1, π π β π(π + 1) P(1) P(2) P(3) β¦ P(n) P(n+1) β¦ β’ Strong induction: β’ Base case: n=1 β’ Assume more in each step: βπ β₯ 1, π 1 β§ β― β§ π π P(1) P(2) P(3) β¦ P(n) β π(π + 1) P(n+1) β¦ 5 Example for the power of strong induction β’ Theorem: For all prices p >= 8 cents, the price p can be paid using only 5-cent and 3-cent coins β’ Proof: β’ Base cases: 8=3+5, 9=3+3+3, 10=5+5 β’ Assume it holds for all prices 8...p-1, prove for price p when π β₯ 11 β’ Proof: since π β 3 β₯ 8 we can use the inductive hypothesis for p-3. To get price p simply add another 3-cent coin. β’ Much easier than standard induction! Another example: divisibility β’ Thm: For all integers n>1, n is divisible by a prime number. β’ Before proving it (using strong induction), lets first review some of the basic definitions, but now make them precise Definitions and properties for this proof β’ Definitions: β’ n is prime if βπ, π β π, π = ππ β (π = 1 β¨ π = 1) β’ n is composite if n=ab for some 1<a,b<n β’ Prime or Composite exclusivity: β’ All integers greater than 1 are either prime or composite (exclusive orβcanβt be both). β’ Definition of divisible: β’ n is divisible by d iff n = dk for some integer k. β’ 2 is prime (you may assume this; it also follows from the definition). Definitions and properties for this proof (cont.) β’ Goes without saying at this point: β’ The set of Integers is closed under addition and multiplication β’ Use algebra as needed Thm: For all integers n>1, n is divisible by a prime number. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n = ________. Inductive step: Assume [or βSupposeβ] that WTS that So the inductive step holds, completing the proof. Thm: For all integers n>1, n is divisible by a prime number. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n = ________. Inductive step: Assume [or βSupposeβ] that WTS that A. B. C. D. E. So the inductive step holds, completing the proof. 0 1 2 3 Other/none/more than one Thm: For all integers n>1, n is divisible by a prime number. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n = _2______. Inductive step: Assume [or βSupposeβ] that WTS that A. For some integer n>1, n is divisible by a prime number. B. For some integer n>1, k is divisible by a prime number, for all integers k where 2ο£kο£n. C. Other/none/more than one So the inductive step holds, completing the proof. Thm: For all integers n>1, n is divisible by a prime number. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n = _2______. Inductive step: Assume [or βSupposeβ] that for some integer n>1, k is divisible by a prime number for all integers k where π β€ π β€ π WTS that A. n+1 is divisible by a prime number. B. k+1 is divisible by a prime number. C. Other/none/more than one So the inductive step holds, completing the proof. 13 Thm: For all integers n>1, n is divisible by a prime number. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n=2. Inductive step: Assume that for some nο³2, all integers 2ο£kο£n are divisible by a prime. WTS that n+1 is divisible by a prime. Proof by cases: β’ Case 1: n+1 is prime. n+1 divides itself so we are done. β’ Case 2: n+1 is composite. Then n+1=ab with 1<a,b<n+1. By the induction hypothesis, since aο£n there exists a prime p which divides a. So p|a and a|n+1. Weβve already seen that this Implies that p|n+1 (in exam β give full details!) So the inductive step holds, completing the proof. Theorems about recursive definitions β’ Consider the following sequence: β’ d1=9/10 β’ d2=10/11 β’ dn=dn-1 * dn-2 βπ β₯ 3 β’ Theorem: βπ β₯ 1, 0 < ππ < 1 β’ Facts the we will need for the proof: β’ If 0<x,y<1 then 0<xy<1 β’ Algebra, etc Definition of the sequence: d1 = 9/10 d2 = 10/11 dk = (dk-1)(dk-2) for all integers kο³3 Thm: For all integers n>0, 0<dn<1. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n = ________. Inductive step: Assume [or βSupposeβ] that WTS that So the inductive step holds, completing the proof. Definition of the sequence: d1 = 9/10 d2 = 10/11 dk = (dk-1)(dk-2) for all integers kο³3 Thm: For all integers n>0, 0<dn<1. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n = ________. A. 0 Inductive step: Assume [or βSupposeβ] that WTS that So the inductive step holds, completing the proof. B. C. D. E. 1 2 3 Other/none/more than one Definition of the sequence: d1 = 9/10 d2 = 10/11 dk = (dk-1)(dk-2) for all integers kο³3 Thm: For all integers n>0, 0<dn<1. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n = _1,2_____. Inductive step: Assume [or βSupposeβ] that WTS that A. For some int n>0, 0<dn<1. B. For some int n>1, 0<dk<1, for all integers k where 1ο£kο£n. C. Other/none/more than one So the inductive step holds, completing the proof. Definition of the sequence: d1 = 9/10 d2 = 10/11 dk = (dk-1)(dk-2) for all integers kο³3 Thm: For all integers n>0, 0<dn<1. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n = _1,2_____. Inductive step: Assume [or βSupposeβ] that WTS that A. For some int n>0, 0<dn<1. B. For some int n>1, 0<dk<1, for all integers k where 1ο£kο£n. C. 0<dn+1<1 D. Other/none/more than one So the inductive step holds, completing the proof. Definition of the sequence: d1 = 9/10 d2 = 10/11 dk = (dk-1)(dk-2) for all integers kο³3 Thm: For all integers n>0, 0<dn<1. Proof (by strong mathematical induction): Basis step: Show the theorem holds for n=1,2. Inductive step: Assume [or βSupposeβ] that the theorem holds for nο³2. WTS that 0<dn+1<1. By definition, dn+1=dn dn-1. By the inductive hypothesis, 0<dn-1<1 and 0<dn<1. Hence, 0<dn+1<1. So the inductive step holds, completing the proof. Fibonacci numbers β’ 1,1,2,3,5,8,13,21,β¦ β’ Rule: F1=1, F2=1, Fn=Fn-2+Fn-1. β’ Question: can we derive an expression for the n-th term? Fibonacci numbers β’ 1,1,2,3,5,8,13,21,β¦ β’ Rule: F1=1, F2=1, Fn=Fn-2+Fn-1. β’ Question: can we derive an expression for the n-th term? β’ YES! 1 1+ 5 πΉπ = 2 5 π 1 1β 5 β 2 5 π 22 Fibonacci numbers β’ Rule: F1=1, F2=1, Fn=Fn-2+Fn-1. β’ We will prove an upper bound: πΉπ β€ ππ, β’ Proof by strong induction. 1+ 5 π= 2 23 Fibonacci numbers β’ Rule: F1=1, F2=1, Fn=Fn-2+Fn-1. β’ We will prove an upper bound: πΉπ β€ 1+ 5 π= 2 ππ, β’ Proof by strong induction. β’ Base case: A. B. C. D. E. n=1 n=2 n=1 and n=2 n=1 and n=2 and n=3 Other 24 Fibonacci numbers β’ Rule: F1=1, F2=1, Fn=Fn-2+Fn-1. β’ We will prove an upper bound: πΉπ β€ 1+ 5 π= 2 ππ, β’ Proof by strong induction. β’ Base case: A. B. C. D. E. n=1 n=2 n=1 and n=2 n=1 and n=2 and n=3 Other 25 Fibonacci numbers β’ Rule: F1=1, F2=1, Fn=Fn-2+Fn-1. β’ We will prove an upper bound: πΉπ β€ ππ, 1+ 5 π= 2 β’ Proof by strong induction. β’ Base case: n=1,2 β’ Verify by direct calculation: πΉ1 = 1 β€ π, πΉ2 = 1 β€ π 2 26 Fibonacci numbers β’ Rule: F1=1, F2=1, Fn=Fn-2+Fn-1. β’ We will prove an upper bound: πΉπ β€ ππ, 1+ 5 π= 2 β’ Proof by strong induction. β’ Base case: n=1,2 β’ Inductive case: showβ¦ A. B. C. D. E. Fn=Fn-1+Fn-2 Fnο£Fn-1+Fn-2 Fn=rn Fn ο£rn Other Proof of inductive case β’ WTS: πΉπ β€ π π β’ What can we use? β’ Definition: πΉπ = πΉπβ1 + πΉπβ2 β’ Inductive assumption: πΉπ β€ π π βπ < π β’ So, we know that πΉπ β€ π πβ1 + π πβ2 β’ Need to show that π πβ1 + π πβ2 β€ π π Proof of inductive case (contd) β’ Need to show that π πβ1 + π πβ2 β€ π π β’ Equivalently: r + 1 β€ π 2 β’ It turns out that this is satisfied by our choice of π = β’ In fact, it is a root of the quadratic π₯ 2 β π₯ β 1 = 0 (so in fact r + 1 = π 2 ) β’ The other root is 1β 5 2 1 ; recall the formula 1+ 5 πΉπ = 2 5 β’ π 1 1β 5 β 2 5 π 1+ 5 2 29 Fibonacci numbers - recap β’ Recursive definition of a sequence β’ Base case: verify for n=1, n=2 β’ Inductive step: β’ Formulated what needed to be shown as an algebraic inequality, using the definition of Fn and the inductive hypothesis β’ Simplified algebraic inequality β’ Proved the simplified version Next class β’ Applying proof techniques to analyze algorithms β’ Read section 3.7 in Jenkyns, Stephenson