{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

2c03-review - 00028

# 2c03-review - 00028 - 6 Let us denote a...

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

2 In principle it suffices to find such n’ than for every n n’, g(n)>Cf(n). Then clearly for every n > max(n’, n 0 >0), the above formula hold. In practice finding n’ is considered as a solution. It does not need to be the smallest n’ such that g(n)>Cf(n). a.[3] 10n 3 +9 = O(n). We have to find such n’ (not necessarily the smallest one) that for every n n’ 10n 3 +9 > Cn. Note that if n C, then 10n 3 + 9 10Cn 2 + 9 Cn holds. b.[6] n 3 2 n + 6n 2 3 n = O(n 3 2 n ). We have to find such n’ (not necessarily the smallest one) that for every n n’ n 3 2 n + 6n 2 3 n > Cn 3 2 n . Since n >0, it can be reduced to the inequality (divide both sides by n 2 2 n ): n+ 6(3/2) n > Cn, or equivalently: (3/2) n > (Cn – n)/6 = ((C-1)/6) n. After applying log to both sides we have: n(log3-log2) = n(log3-1) > log(C-1)-log6 + logn, or, equivalently n > (log(C-1)-log6)/(log3-1) + logn/(log3-log2). The above inequality is satisfied for all n>0 if C-1 < 6, so suppose that C-1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 6. Let us denote: a = (log(C-1)-log6)/ (log3-1), b = log3-1. Note that 1<b<2 since log4=2, log2=2. Then we have: n > a + (1/b) logn. The above is clearly true if n satisfies: n/2 > a and n/2 > (1/b) logn. The first inequality implies n > 2a, the second is equivalent to: (b/2)n > logn. In the question 1d above we have proved that logn ≤ 2 n 1/2 . We can now consider (b/2)n > n/2 > 2 n 1/2 . But n/2 > 2 n 1/2 is equivalent to n 1/2 > 4, i.e. n>8. Hence for n>8 we have (b/2)n > n/2 > 2 n 1/2 > logn. This means n > max(8,2a)=max(8,2(log(C-1)-log6)/ (log3-1)). c.[3] n(n-1)/2 = O(n). We have to find such n’ (not necessarily the smallest one) that for every n ≥ n’ n(n-1)/2 > Cn. If n > 2C+1, then n 2 > (2C+1)n = 2Cn+n ⇒ n 2-n > 2Cn ⇒ n(n-1)/2 = (n 2-n)/2 > Cn d.[5] n+1 = O(log n). We have to find such n’ (not necessarily the smallest one) that for every n ≥ n’...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online