hw1-sol - Assignment #1 CS4/531 Due Date: Monday, Sep. 19,...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Assignment #1 CS4/531 Due Date: Monday, Sep. 19, 2011 UNSUPPORTED SOLUTIONS RECEIVE NO CREDIT. Total points: 55 1. (4pts) We want to prove the function f ( n ) = 3 n 2 + 4 n 20 = ( n 2 ) by using the definition of . Namely we need to find c > 0 and n 0 such that: 3 n 2 + 4 n 20 cn 2 for all n n There are many combinations of c and n that will satisfy the definition. Try the following values for c . (a) Pick c = 2, determine the smallest n that satisfies the definition. (b) Pick c = 3, determine the smallest n that satisfies the definition. (c) Pick c = 4, what happens? Answer: (a) When we pick c = 2 then equation becomes: 3 n 2 + 4 n 20 2 n 2 which can be written as n 2 + 4 n 20 Roots of this equation are n 6 . 89 and n 1 2 . 89. Since we look for n 0 then smallest n is 3 (b) When we pick c = 3 then equation becomes: 3 n 2 + 4 n 20 3 n 2 which can be written as n 5 Smallest n is 5 (c) When we pick c = 2 then equation becomes: 3 n 2 + 4 n 20 4 n 2 which can be written as n 2 + 4 n 20 Since this equation has no roots then we cannot find any positive rational n that satisfies equation. a50 2. (16 pts) Rank the following functions by the order of growth rate (that is, list them in a list f 1 ( n ) ,f 2 ( n ) ,f 3 ( n ) ,... such that f 1 ( n ) = O ( f 2 ( n )), f 2 ( n ) = O ( f 3 ( n )) ,... ). Partition your list into equivalent classes such that f ( n ) and g ( n ) are in the same class if and only if f ( n ) = ( g ( n )). You must prove your answer (by limit test or other means). ( 3) lg 3 n , n 2 , ln 2 n 2 , ln ln n, (ln n ) ln n , n ln ln n , 4 lg n , n lg 2 n, n ! , ( n 1)! , (4 / 3) n , n 1 / 2 Note: lg is the log function with base 2. ln is the log function with base e . Answer: We rank the following functions by the order of growth rate as follows: ln ln n , ln 2 n 2 , [ n 1 / 2 , ( 3) lg 3 n ], n lg 2 n , [4 lg n , n 2 ], [ n ln ln n , (ln n ) ln n ],(4 / 3) n , ( n 1)!, n !. The functions in the same class are in [ ... ]. 1 (a) lim n ln ln n ln 2 n 2 = lim n 1 ln n 1 n 4 n ln n (by LHopital rule) = lim n 1 4 ln 2 n = 0 . Thus ln ln n = o (ln 2 n 2 ). (b) lim n ln 2 n 2 n 1 / 2 = lim n (4 ln n ) /n 1 / 2 n- 1 / 2 (by LHopital rule) = lim n 8 ln n n 1 / 2 = lim n 8 /n 1 / 2 n- 1 / 2 (by LHopital rule) = lim n 16 n 1 / 2 = 0 . Thus ln 2 n 2 = o ( n 1 / 2 ). (c) ( 3) lg 3 n = 3 (lg 3 n ) / 2 = n 1 / 2 . (d) lim n n 1 / 2 n lg 2 n = lim n 1 n 1 / 2 lg 2 n = 0. Thus n 1 / 2 = o ( n lg 2 n ). (e) lim n n n lg 2 n = lim n 1 lg 2 n = 0 . Thus n = o ( n lg 2 n )....
View Full Document

Page1 / 8

hw1-sol - Assignment #1 CS4/531 Due Date: Monday, Sep. 19,...

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