CSE 20 DISCRETE MATH Prof Shachar Lovett http

  • Slides: 30
Download presentation
CSE 20 DISCRETE MATH Prof. Shachar Lovett http: //cseweb. ucsd. edu/classes/wi 15/cse 20 -a/

CSE 20 DISCRETE MATH Prof. Shachar Lovett http: //cseweb. ucsd. edu/classes/wi 15/cse 20 -a/ Clicker frequency: CA

Todays topics • Strong induction • Section 3. 6. 1 in Jenkyns, Stephenson

Todays topics • Strong induction • Section 3. 6. 1 in Jenkyns, Stephenson

Strong vs regular induction •

Strong vs regular induction •

Strong vs regular induction • P(1) P(2) P(3) … P(n) P(n+1) …

Strong vs regular induction • P(1) P(2) P(3) … P(n) P(n+1) …

5 Example for the power of strong induction •

5 Example for the power of strong induction •

Another example: divisibility • Thm: For all integers n>1, n is divisible by a

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 and properties for this proof •

Definitions and properties for this proof (cont. ) • Goes without saying at this

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

Thm: For all integers n>1, n is divisible by a prime number. Proof (by strong mathematical induction): Basis step: Show 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

Thm: For all integers n>1, n is divisible by a prime number. Proof (by strong mathematical induction): Basis step: Show 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

Thm: For all integers n>1, n is divisible by a prime number. Proof (by strong mathematical induction): Basis step: Show 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. • A.

Thm: For all integers n>1, n is divisible by a prime number. • A. n+1 is divisible by a prime number. B. k+1 is divisible by a prime number. C. Other/none/more than one

13 Thm: For all integers n>1, n is divisible by a prime number. Proof

13 Thm: For all integers n>1, n is divisible by a prime number. Proof (by strong mathematical induction): Basis step: Show 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 •

Theorems about recursive definitions •

Definition of the sequence: d 1 = 9/10 d 2 = 10/11 dk =

Definition of the sequence: d 1 = 9/10 d 2 = 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 theorem holds for n = ____. Inductive step: Assume [or “Suppose”] that WTS that So the inductive step holds, completing the proof.

Definition of the sequence: d 1 = 9/10 d 2 = 10/11 dk =

Definition of the sequence: d 1 = 9/10 d 2 = 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 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: d 1 = 9/10 d 2 = 10/11 dk =

Definition of the sequence: d 1 = 9/10 d 2 = 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 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: d 1 = 9/10 d 2 = 10/11 dk =

Definition of the sequence: d 1 = 9/10 d 2 = 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 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: d 1 = 9/10 d 2 = 10/11 dk =

Definition of the sequence: d 1 = 9/10 d 2 = 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 theorem holds for n=1, 2. Inductive step: Assume [or “Suppose”] that 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:

Fibonacci numbers • 1, 1, 2, 3, 5, 8, 13, 21, … • Rule: F 1=1, F 2=1, Fn=Fn-2+Fn-1. • Question: can we derive an expression for the n-th term?

Fibonacci numbers •

Fibonacci numbers •

22 Fibonacci numbers •

22 Fibonacci numbers •

23 Fibonacci numbers • A. B. C. D. E. n=1 n=2 n=1 and n=2

23 Fibonacci numbers • A. B. C. D. E. n=1 n=2 n=1 and n=2 and n=3 Other

24 Fibonacci numbers • A. B. C. D. E. n=1 n=2 n=1 and n=2

24 Fibonacci numbers • A. B. C. D. E. n=1 n=2 n=1 and n=2 and n=3 Other

25 Fibonacci numbers •

25 Fibonacci numbers •

26 Fibonacci numbers • A. B. C. D. E. Fn=Fn-1+Fn-2 Fn=rn Fn rn Other

26 Fibonacci numbers • A. B. C. D. E. Fn=Fn-1+Fn-2 Fn=rn Fn rn Other

Proof of inductive case •

Proof of inductive case •

Proof of inductive case (contd) •

Proof of inductive case (contd) •

29 Fibonacci numbers - recap • Recursive definition of a sequence • Base case:

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

Next class • Applying proof techniques to analyze algorithms • Read section 3. 7 in Jenkyns, Stephenson