2c03-review - 00028

2c03-review - 00028 - 6. Let us denote: a =...

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

View Full Document Right Arrow Icon
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
Background image of page 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&lt;b&lt;2 since log4=2, log2=2. Then we have: n &gt; a + (1/b) logn. The above is clearly true if n satisfies: n/2 &gt; a and n/2 &gt; (1/b) logn. The first inequality implies n &gt; 2a, the second is equivalent to: (b/2)n &gt; logn. In the question 1d above we have proved that logn 2 n 1/2 . We can now consider (b/2)n &gt; n/2 &gt; 2 n 1/2 . But n/2 &gt; 2 n 1/2 is equivalent to n 1/2 &gt; 4, i.e. n&gt;8. Hence for n&gt;8 we have (b/2)n &gt; n/2 &gt; 2 n 1/2 &gt; logn. This means n &gt; 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 &gt; Cn. If n &gt; 2C+1, then n 2 &gt; (2C+1)n = 2Cn+n n 2-n &gt; 2Cn n(n-1)/2 = (n 2-n)/2 &gt; 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

This note was uploaded on 12/10/2009 for the course CAS 2c03 taught by Professor Janicki during the Spring '03 term at McMaster University.

Ask a homework question - tutors are online