1 / 10

Quiz 6

Quiz 6. The way I expected it. How to do it!. 1. Use mathematical induction to prove that 1 2 + 3 2 + 5 2 + ... + (2 n + 1) 2 = ( n + 1)(2 n + 1)(2 n + 3)/3 whenever n is a nonnegative integer. Be sure to use the formula provided in class.

dorad
Download Presentation

Quiz 6

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. Quiz 6 The way I expected it.

  2. How to do it! 1. Use mathematical induction to prove that 12 + 32 + 52 + ... + (2n + 1)2 = (n + 1)(2n + 1)(2n + 3)/3 whenever n is a nonnegative integer. Be sure to use the formula provided in class.

  3. State what you are trying to prove! Prove 12 + 32 + 52 + ... + (2n + 1)2 = (n + 1)(2n + 1)(2n + 3)/3 whenever n is a nonnegative integer using mathematical induction. Nonnegative means 0, 1, 2, …

  4. Basis Step Prove 12 + 32 + 52 + ... + (2n + 1)2 = (n + 1)(2n + 1)(2n + 3)/3 whenever n is a nonnegative integer using mathematical induction. (a) Basis Step: plugging in n = 0 we have that P(0) is the statement: (2 * 0 + 1)2 = (0 + 1)(2 * 0 + 1)(2 * 0 + 3)/3. Expanding both sides we have: 1 = 1 * 1 * 3/3 = 1 Both sides of P(0) shown in part (a) equal 1. Here we are just plugging in the smallest nonnegative integer and showing that both sides are equivalent.

  5. Inductive Hypotheses (b) Inductive Hypotheses: The inductive hypothesis is the statement that 12 + 32 + 52 + ... + (2k + 1)2 = (k + 1)(2k + 1)(2k + 3)/3. Here we substitute k for n and restate what we are trying to prove.

  6. Inductive step (c) For the inductive step, we want to show for each k ≥ 1 that P(k) implies P(k + 1). In other words, we want to show that by assuming the inductive hypothesis we can prove 12 + 32 + 52 + ... + (2k + 1)2+ (2(k + 1) + 1)2 = ((k + 1) + 1)(2(k + 1) + 1)(2(k + 1) + 3)/3 We take the last k term on the left side , (2k + 1)2, add another similar term with the k value replaced by k + 1, and replay all k terms on the right-hand side by k + 1 terms.

  7. Substitution Proof (d) Replacing the quantity in brackets on the left-hand side of part(c) by what it equals by virtue of the inductive hypothesis (12 + 32 + 52 + ... + (2k + 1)2 = (k + 1)(2k + 1)(2k + 3)/3), we have (k + 1)(2k + 1)(2k + 3)/3 + (2(k + 1) + 1)2= ((k + 1) + 1)(2(k + 1) + 1)(2(k + 1) + 3)/3 ((k + 1)(2k + 1)(2k + 3) +3(2(k + 1) + 1)2)/3 = ((k + 2)(2k + 2 + 1)(2k + 2 + 3)/3 (k + 1)(2k + 1)(2k + 3) + 3(2k + 2 + 1)2 = ((k + 2)(2k +3)(2k + 5) {divide both sides by 3} (k + 1)(2k + 1)(2k + 3) + 3(2k + 3)2 = ((k + 2)(2k + 3)(2k + 5) (k + 1)(2k + 1) + 3(2k + 3) = ((k + 2)(2k + 5) {divide both sides by (2k + 3)} 2k2 + 3k + 1 + 6k + 9 = 2k2 + 9k + 10 2k2 + 9k + 10 = 2k2 + 9k + 10 we have shown that both sides are equal as we desired. 

  8. N Factorial 2. Give a recursive algorithm (in the pseudo format specified in appendix A3) for computing: a. n! (n factorial). procedure factorial(n:nonnegative integer) if n = 0 then return 1 else return n ∙ factorial(n − 1) {output is n!}

  9. A Recursive Algorithm for Computing an 2. Give a recursive algorithm (in the pseudo format specified in appendix A3) for computing: b. an (a to the nth power). procedure power(a: nonzero real number, n:nonnegative integer) if n = 0 then return 1 else return a ∙ power (a, n − 1) {output is an}

  10. Bonus 3. Bonus question: Using 2.b. above, show the value of an generated at each step given a=5 and n= 4 (starting with n = 0). hint1: procedurepower(a, n) hint2: {54}

More Related