1 / 27

CS322

Week 5 - Friday. CS322. Last time. What did we talk about last time? Sequences Summation and production notation Proof by induction. Questions?. Logical warmup. Consider six straight silver chains made up of five links each What if you want to make one large circular chain?

faolan
Télécharger la présentation

CS322

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. Week 5 - Friday CS322

  2. Last time • What did we talk about last time? • Sequences • Summation and production notation • Proof by induction

  3. Questions?

  4. Logical warmup • Consider six straight silver chains made up of five links each • What if you want to make one large circular chain? • The jeweler will charge $1 for every link that he must cut open and then weld close • What is the cheapest price possible to make the six chains into one chain?

  5. Review of Sequences

  6. Explicit formulas • It is often possible to use a formula to describe the relationship between the value of a subscript and the value of the corresponding term • Example: ai = i2, for integers i 1

  7. Summation notation • Summation notation is used to describe a summation of some part of a series • Expanded form is the summation written without the sigma

  8. Product notation • Product notation is used to describe a product of some part of a series • Expanded form is the product written without the pi

  9. Return to Mathematical Induction

  10. Proof by mathematical induction • To prove a statement of the following form: • n  Z, where n a, property P(n) is true • Use the following steps: • Basis Step: Show that the property is true for P(a) • Induction Step: • Suppose that the property is true for some n = k, where k  Z, k a • Now, show that, with that assumption, the property is also true for k + 1

  11. Example • Prove that, for all integers n  8, n = 3a + 5b, where a,b are integers greater than or equal to zero • Hint: Use induction and cases • This is the example given in the book • Another way to write it is that any amount of change above 8 cents can be made using only 3 cent and 5 cent coins

  12. Geometric series • Prove that, for all real numbers r  1 • Hint: Use induction • This is the sum of a geometric sequence, also known as a geometric series • This result generalizes our example with the sum of powers of 2 • There is a small issue for r = 0, but Epp ignores it

  13. More Examples

  14. Divisibility • Prove that, for all integers n ≥ 1, 22n– 1 is divisible by 3 • Hint: Use induction

  15. Inequality • Prove that, for all real number n ≥ 3, 2n + 1 < 2n • Hint: Use induction

  16. Fibonacci • The Fibonacci sequence is 1, 1, 2, 3, 5, 8, … • We can define it (recursively) as follows: • F1 = F2 = 1 • Fn = Fn-1 + Fn-2, n≥ 2 • Prove that, for all integers n ≥ 1, F4n is divisible by 3 • Hint: Use induction

  17. Student Lecture Strong Induction

  18. Strong Induction

  19. Strong induction • There are situations where we need more than the fact that the kth element maintains some property to prove the k + 1st element has the same property • Strong induction allows us to use the kth element, the k-1st, element, the k-2nd element, and so on • This is usually most helpful when the subterms you are doing induction on are of unknown size

  20. Proof by strong induction • To prove a statement of the following form: • n  Z, where n a, property P(n) is true • Use the following steps: • Basis Step: Show that the property is true for P(a), P(a+1), … P(b-1) , P(b), where a ≤ b, bZ • Induction Step: • Suppose that the property is true for some a ≤ i < k, where k  Z and k > b • Now, show that, with that assumption, the property is also true for k

  21. Example Theorem: For all integers n  2, n is divisible by a prime Proof: • Basis step: (n = 2) The property is true for n = 2 because 2 is divisible by 2 • Induction step: Assume that all numbers i where 2 ≤ i < k are divisible by a prime, where k > 2 and k  Z • Case 1:k is prime • If k is prime, k = k∙1, therefore k is divisible by a prime, namely itself • Case 2: k is composite • If k is composite, k = a∙b, where a,b  Z and 2 ≤ a < k and 2 ≤ b < k • By the induction hypothesis, a is divisible by some prime p • Thus, k = p∙c∙b = p∙d and k is divisible by prime p • Since we have shown the basis step and induction step of strong mathematical induction, the claim is true QED

  22. Example Theorem: It takes exactly n-1 steps to assemble a jigsaw puzzle with n pieces Proof: • Basis step: (n = 1) A puzzle with 1 piece takes 0 steps to put together • Induction step: Assume it takes i – 1 steps to put together puzzles of size i where 1 ≤ i < k, where k > 1 and k  Z • The last step in a puzzle of size k is putting together a subpuzzle of size j and a subpuzzle of size k – j where j  Z and 1 ≤ j < k and 1 ≤ k - j < k • By the induction hypothesis, it took j – 1 steps to put together one subpuzzle and k – j – 1 steps to put together the other • Thus, the total number of steps is j – 1 + k + j – 1 + 1 = k – 1 steps • Since we have shown the basis step and induction step of strong mathematical induction, the claim is true QED

  23. Well-Ordering Principle for Integers • It turns out that the concept of truth through mathematical induction is equivalent to another principle • Well-Ordering Principle for the Integers: • Let S be a set containing one or more integers all of which are greater than some fixed integer. Then S has a least element.

  24. Quiz

  25. Upcoming

  26. Next time… • Recursion • Second-order linear homogeneous recurrence relations with constant coefficients

  27. Reminders • Homework 3 is due on Monday • Keep reading Chapter 5

More Related