This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
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 BigO 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 45 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 bigO, we dont 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
 Spring '08
 FLECK@SHAFFER

Click to edit the document details