1 / 16

Math/CSE 1019C: Discrete Mathematics for Computer Science Fall 2012

Math/CSE 1019C: Discrete Mathematics for Computer Science Fall 2012. Jessie Zhao jessie@cse.yorku.ca Course page: http://www.cse.yorku.ca/course/1019. Last date to drop courses without receiving a grade : Nov 9 th No Assignment is released today! Test 2 on Nov 5 th, Ch2.1-2.5

dava
Download Presentation

Math/CSE 1019C: Discrete Mathematics for Computer Science Fall 2012

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Math/CSE 1019C:Discrete Mathematics for Computer ScienceFall 2012 Jessie Zhao jessie@cse.yorku.ca Course page: http://www.cse.yorku.ca/course/1019

  2. Last date to drop courses without receiving a grade : Nov 9th • No Assignment is released today! • Test 2 on Nov 5th, • Ch2.1-2.5 • 7pm-8:20pm • Location: SLH F (Last name from A-L) and SLH A (Last name from M-Z) • Lecture: 8:40pm, SLH A. • You may pick up your Assignment 4 during my office hour: Nov 5th 2:00pm - 4:00pm (TEL 3056)

  3. Mathematical Induction • Proof methods: direct proof, proof by cases, proof by contraposition, proof by contradiction, disproof by counterexample • Mathematical induction • very simple and powerful proof technique • often used to prove P(x) is true for all positive integers • “Guess” and verify strategy

  4. Principle of Mathematical Induction (P(1) ⋀ ∀k(P(k)➝P(k+1)) ➝ ∀nP(n) • To prove that ∀nP(n), where n∈Z⁺ and P(n) is a propositional function, we complete two steps: • i) Basis step: Verify P(1) is true • ii)Inductive step: Show P(k)➝P(k+1) is true for arbitrary k∈Z⁺

  5. Mathematical Induction • Knowing it is true for the first element means it must be true for the next element, i.e. the second element • Knowing it is true for the second element implies it is true for the third and so forth. • Need a starting point (Base case) P(1) P(k) → P(k+1) --------------------- , P(2) P(2) P(k) → P(k+1) --------------------- , … P(3)

  6. How to show P(1) is true? • Replace n by 1 in P(n) • How to show P(k)➝P(k+1) is true? • Direct proof is normally used • (Inductive Hypothesis) Assume P(k) is true for some arbitrary k • Then show P(k+1) is true

  7. Proving Summation • Example: Show that 1² + 2² + 3² + …+n² = n(n+1)(2n+1)/6, where n ∈ Z⁺ • Proof: • Basis case P(1): LHS=1² = 1, RHS=1*(1+1)(2*1+1)/6=1 • Inductive step: • Assume P(k) is true: 1² + 2² + 3² + …+k² = k(k+1)(2k+1)/6 • For P(k+1): Show that 1² + 2² + 3² + …+k²+ (k+1)²= (k+1)(k+2)(2k+3)/6 (Details on Board) • We showed P(k+1) is true under the assumption that P(k) is true. • By mathematical induction P(n) is true for all positive integers

  8. Proving Inequalities • Example: n < 4n , where n ∈ Z⁺ • Proof • Basis case: P(1) holds since 1<4 • Inductive step: • Assume P(k) is true: k < 4k • For P(k+1): k+1 < 4k +1 < 4k + 4k = 2*4k < 4*4k = 4 k+1 • By mathematical induction P(n) is true for all positive integers

  9. Proving divisibility • Example: Prove that n³-n is divisible by 3 whenever n is a positive integer. • Basis step: P(1): 1³-1=0, which is divisible by 3. • Inductive step: • Assume P(k) is true: k³ -k is divisible by 3 • For P(k+1): (k+1)³ -(k+1) =k³ +3k²+3k+1-k-1 =(k³-k ) +3(k²+k) From the assumption, k³-k is divisible by 3, so P(k+1) is true. By mathematical induction, P(n) is true for all positive integers

  10. Mathematical Induction (Base case n≠1) • Basis case doe not have to be n=1 • How to show that P(n) is true for n=b, b+1, b+2,.... where b is an integer other than 1? • i) Basis step: Verify P(b) is true • ii)Inductive step: Show P(k)➝P(k+1) is true for arbitrary k∈Z

  11. Show that 1+2+2²+...+2 n = 2 n+1 -1, where n∈N • Proof by induction: • Basis step: P(0): LHS=1, RHS = 21 -1 = 1. • Inductive step: • Assume P(k) is true for arbitrary k∈N, 1+2+...+2k = 2k+1 -1 • Need to show P(k+1): 1+2+....+2k +2 k+1 = 2 k+2 -1 is true. LHS = (1+2+...+2 k)+2 k+1 = 2 k +1-1+2 k+1 = 2 k+2-1 So LHS = RHS. We showed P(k+1) is true under the assumption that P(k) is true. • By mathematical induction P(n) is true for all natural numbers

  12. Prove • Proof by induction: • P(n): a+ar+ar2.... +arn = (arn+1 -a)/(r-1) • Basis case: P(0): a = (ar-a)/(r-1). So, P(0) is true • Inductive step: • Assume P(k) is true for arbitrary k∈N, a+ar+ar2.... +ark = (ark+1 -a)/(r-1) • Need to show P(k+1): a+ar+ar2.... +ark + ark+1 = (ark+2 -a)/(r-1) is true. • LHS = (ar k+1-a)/(r-1) +ar k+1 = (ar k+1-a +ar k+2 -ark+1 )/(r-1) • So LHS = RHS. • We showed P(k+1) is true under the assumption that P(k) is true. • By mathematical induction P(n) is true for all natural numbers

  13. A wrong proof, WHY? • Show that all horses are the same color. • Proof: • We do induction on the size of sets of horses of the same color. • Basis step: Obviously all sets of 0 horses (and all sets with 1 horse) are the same color • Inductive step: • Assume all horses are the same color for k horses • Now show it must be true for all sets of k+1 horses • Every set of k+1 horses has an overlap of horses which are the same color. • So k+1 horses have the same color. • Therefore all horses have the same color.

  14. Strong Induction (P(1) ⋀ ∀k(P(1)⋀P(2)⋀...⋀P(k)➝P(k+1)))➝ ∀nP(n) • To prove that ∀nP(n), where n∈Z⁺ and P(n) is a propositional function, we complete two steps: • i) Basis step: Verify P(1) is true • ii)Inductive step: Show P(1)⋀P(2)⋀...⋀P(k)➝P(k+1)is true for arbitrary k∈Z⁺

  15. Strong Induction Variation • A more general strong induction can handle cases where the inductive step is valid only for integers greater than a particular integer. • To prove that P(n) is true for all integer n≥b, we complete two steps: • i) Basis step: Verify P(b), P(b+1), ..., P(b+j) are true • ii)Inductive step: Show P(b+1)⋀P(b+2)⋀...⋀P(b+k)➝P(k+1) is true for every integer k≥b+j

  16. Example: Show that if n is an integer greater than 1, then n can be written as the product of primes • Proof by strong induction: • First identify P(n), P(n): n can be written as the product of primes • Basis step: P(2): 2 is a prime number, so P(2) is true. • Inductive step: • Assume P(j) is true for 1<j≤k for an arbitrary k>1, i.e. j can be written as the product of primes when 1<j≤k • Need to show P(k+1). • Case 1: k+1 is prime, then P(k+1) is true. • Case 2: k+1 is composite k+1=a*b, where a and b are positive integers, and 2≤a,b≤k. By the assumption, a and b can be written as the product of primes. Then k+1 can be written as the product of primes.

More Related