Data Str & Algorithm HW Solutions 11

Data Str & Algorithm HW Solutions 11 - : Base case....

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
11 2.22 Theorem 2.1 n i =1 (2 i )= n 2 + n . (a) Proof : We know from Example 2.3 that the sum of the f rst n odd numbers is n 2 .The i th even number is simply one greater than the i th odd number. Since we are adding n such numbers, the sum must be n greater, or n 2 + n . (b) Proof : Base case : n =1 yields 2=1 2 +1 , which is true. Induction Hypothesis : n 1 X i =1 2 i =( n 1) 2 +( n 1) . Induction Step : The sum of the f rst n even numbers is simply the sum of the f rst n 1 even numbers plus the n th even number. n X i =1 2 i =( n 1 X i =1 2 i )+2 n =( n 1) 2 +( n 1) + 2 n =( n 2 2 n +1)+( n 1)+2 n = n 2 n +2 n = n 2 + n. Thus, by mathematical induction, n i =1 2 i = n 2 + n . 2.23 Proof
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: : Base case. For n = 1 , Fib (1) = 1 < 5 3 . For n = 2 , Fib (2) = 1 < ( 5 3 ) 2 . Thus, the formula is correct for the base case. Induction Hypothesis. For all positive integers i < n , Fib ( i ) < ( 5 3 ) i . Induction Step. Fib ( n ) = Fib ( n 1) + Fib ( n 2) and, by the Induction Hypothesis, Fib ( n 1) < ( 5 3 ) n 1 and Fib ( n 2) < ( 5 3 ) n 2 . So, Fib ( n ) < ( 5 3 ) n 1 + ( 5 3 ) n 2 < 5 3 ( 5 3 ) n 2 + ( 5 3 ) n 2...
View Full Document

This note was uploaded on 12/27/2011 for the course MAP 2302 taught by Professor Bell,d during the Fall '08 term at UNF.

Ask a homework question - tutors are online