This
** preview**
has intentionally

**sections.**

*blurred***to view the full version.**

*Sign up*
**Unformatted text preview: **CS 173: Discrete Structures, Fall 2010 Homework 7 This homework contains 4 problems worth a total of 40 points. It is due on Friday, October 22 at 4:00 PM. Put your homework in the appropriate dropbox in the Siebel basement. 1. Proofs using Big-O and Θ [9 points] For both parts of this problem, make sure that your proof is presented clearly and in forward order, that your variables and assumptions are introduced at the beginning, and that your algebra is shown (around 4-5 lines) to receive full credit. (a) (6 points) Prove that f ( n ) = 4 n 3 − 8 n 2 − 36 n + 72 is Θ( n 3 ) [Solution] We must show that f ( n ) is both O ( n 3 ) and ω ( n 3 ). First, notice that if n ≥ 5 then n 2 ≥ 2 n + 9, so n 3 ≥ 2 n 2 + 9 n , so 4 n 3 ≥ 8 n 2 + 36 n . Therefore, f ( n ) is positive for n ≥ 5. So if we are careful to choose k at least this big when we invoke the definition of big-O, we don’t need to take absolute values. ( f is actually positive for n ≥ 4, but the algebra worked out easily for n ≥ 5.) i. Claim: f ( n ) = 4 n 3 − 8 n 2 − 36 n + 72 is O ( n 3 ). Consider c = 1 and k = 5. Suppose we pick any n ≥ k . Then 2 n 2 + 9 n = n (2 n + 9) ≥ 95. So 8 n 2 + 26 n ≥ 95 > 72. So − 8 n 2 − 36 n + 72 is negative. This means that f ( n ) = 4 n 3 + ( − 8 n 2 − 36 n + 72) < 4 n 3 = cn 3 So f ( n ) is O ( n 3 ). ii. Claim: f ( n ) = 4 n 3 − 8 n 2 − 36 n +72 is Ω( n 3 ). That is n 3 is O (4 n 3 − 8 n 2 − 36 n +72). Consider c = 1 and k = 7. Suppose we pick any n ≥ k . Then ( n − 2) 2 > 22. So n 2 − 4 n − 18 = ( n − 2) 2 − 22 is positive. So 2 n 3 − 8 n 2 − 36 n is positive. So f ( n ) ≥ 2 n 3 ≥ n 3 ....

View
Full
Document