am_lect_21 - Method of Unrolling Consider the following...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Method of Unrolling Consider the following inductively defined function: T (1) = 1 n 2, T ( n ) = T ( n 1) + 3 n Claim: T ( n ) is O ( n 2 ) roof: Suppose very large Then Proof: n is very large. Then T ( n )= T ( n 1) + 3 n (by definition) = T ( n 2) + 3(( n 1) + n ) = T ( n 3) + 3(( n 2) + ( n 1) + n ) = ) + 3(2 + 3 + … + ( ) + ( ) + T (1) 3(2 3 ( n 2) ( n 1) n ) = hich is ) 1 ( 2 3 1 2 ) 1 ( 3 1 1 3 1 3 1 n n n n i i n n which is O ( n 2 ) 1 2 i i
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Method of Unrolling: Another example Consider the following inductively defined function: M (0) = p n 2, M ( n ) = (1.05) M ( n 1) Claim: T ( n ) is O (1.05 n ) roof: Suppose very large Then Proof: n is very large. Then M ( n ) = (1.05) M ( n 1) (by definition) = (1.05) 2 M ( n 2) = (1.05) 3 M ( n 3) = (1.05) n ) M (0) = (1.05) n p hich is 05 which is O (1.05 n )
Background image of page 2
Sample proofs with Big O We have just shown that M ( n ) is O (1.05 n ) Claim 1: M ( n ) is O (2 n ) Proof 1: Since
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

am_lect_21 - Method of Unrolling Consider the following...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online