2c03-review - 00089

2c03-review - 00089 - a.[3] (6n 3 log n + 1)/(n 2 +1000)=...

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

View Full Document Right Arrow Icon
2 2.[11] Using only definition of O(f(n)) proof that the following statements are true: 1.[2] 7000n2 n /(n 2 + 3) = O(2 n ) Let c=1, n 0 =7000. For all n 7000, 7000n2 n /(n 2 + 3) 7000n2 n /(7000n + 3) 2 n . 2.[3] 100n 3 2 n + 6n 2 3 n = O(4 n ) Let c=106, n 0 =16=2 4 . First n 3 = 2 3logn , and n 2 = (4/3) (2/(log4/3))logn (check it by apply logarithm for both side) For all n 16, n 3 2 n = 2 3logn 2 n 2 n 2 n = 4 n 6n 2 3 n = 6*(4/3) (2/(log4/3))logn * 3 n 6*(4/3) n * 3 n = 6*4 n Then, 100n 3 2 n + 6n 2 3 n 7*4 n hold. 3.[2] min(n 3 /log n,100n 2 )=O(n 2 )=O(n 3 ) Let c=101, n 0 =1. For all n 1, min(n 3 /log n,100n 2 ) 100n 2 < 101n 2 . For all n 1, min(n 3 /log n,100n 2 ) n 3 /log n < 101n 3 . 4[2] n! = O(n n ) Let c=1, n 0 =1. For all n 1, n! n n . 5.[2] 10000n + n 2 log n + n 1/2 = O(n 3 ) Let c=10002, n 0 =2. For all n 2, 10000n + n 2 log n + n 1/2 10000n 3 + n 3 + n 3 10002n 3 . 3.[11] Using only definition of O(f(n)) proof that the following statements are false:
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: a.[3] (6n 3 log n + 1)/(n 2 +1000)= O(log n) For all c 0, (6n 3 log n + 1)/(n 2 +1000) 6n 3 log n/2n 2 = 3nlog n , when n 1000. 3nlog n c*log n, when n c/3. Let n 0 = max(c/3, 1000), for all n n , (6n 3 log n + 1)/(n 2 +1000) c*log n. b.[3] max(nlog n,n(n-1)/2)=O(n 3/2 ) For all c 0, n 2 /4 n/2, when n 2. n 2 /4 = (n 1/2 /4)*n 3/2 (4c/4)*n 3/2 = c*n 3/2 , when n 16c 2 . Let n 0 = max(2, 16c 2 ), for all n n , n(n-1)/2 = n 2 /4 + n 2 /4 - n/2 c*n 3/2 . However, max(nlog n,n(n-1)/2) n(n-1)/2, for all n. c.[3] 3 n = O(2 n ) For all c 0, take n 0 = log c / log(3/2)....
View Full Document

Ask a homework question - tutors are online