# HW1_sol_2 - Fall Semester 2009 CS300 Algorithms Solution#1...

This preview shows pages 1–2. Sign up to view the full content.

Fall Semester 2009 CS300 Algorithms Solution #1 1. O ( g 4 ) O ( g 3 ) O ( g 5 ) O ( g 1 ) O ( g 2 ) O ( g 7 ) O ( g 6 ) 2. For case 1, we have f ( n ) = O ( n log b a - ± ), implying that f ( n/b j ) = O (( n/b j ) log b a - ± ). Sub- stituting into g ( n ) yields g ( n ) = O ( log b n - 1 j =0 a j ( n/b j ) log b a - ± ) . We bound the summation within the O -notation by factoring out terms and simplifying, which leaves an increasing geometric series: log b n - 1 X j =0 a j ( n/b j ) log b a - ± = n log b a - ± log b n - 1 X j =0 ( ab ± /b log b a ) j = n log b a - ± log b n - 1 X j =0 ( b ± ) j = n log b a - ± ± b ± log b n - 1 b ± - 1 ² = n log b a - ± ± n ± - 1 b ± - 1 ² Since b and ± are constants, the last expression reduces to n log b a - ± O ( n ± ) = O ( n log b a ). Substituting this expression for the summation in equation (1) yields g ( n ) = O ( n log b a ) , (1) and case 1 is proved. Under the assumption that f ( n ) = Θ( n log b a ) for case 2, we have that f ( n/b j ) = Θ(( n/b j ) log b a ). Substituting into

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 2

HW1_sol_2 - Fall Semester 2009 CS300 Algorithms Solution#1...

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

View Full Document
Ask a homework question - tutors are online