{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# hw6 - Homework 6 Section 1.3 1(E 10 If x > 1 then x3 < x4...

This preview shows pages 1–2. Sign up to view the full content.

Homework 6 Section 1.3 1. (E) 10. If x > 1 then x 3 < x 4 . So clearly x 3 is O ( x 4 ) for C=1 and k=1. But if x 4 is O ( x 3 ) then x 4 < C.x 3 for some C and k. Dividing both sides by x 3 we get x < C . Clearly this condition will not hold for all large x. 2. (E) ( n 3 + n 2 logn )( logn + 1) + (17 logn + 19)( n 3 + 2) = n 3 logn + n 3 + n 2 ( logn ) 2 + n 2 logn + 17 n 3 logn + 19 n 3 + 34 logn + 38 < n 3 logn + n 3 logn + n 3 logn + n 3 logn + 17 n 3 logn + 19 n 3 logn + 34 n 3 logn + 38 n 3 logn (Using logn < n and that n 3 logn > logn for n > 1 etc.) < 112 n 3 logn . So This is O ( n 3 logn ) for C = 112 and n > 1 . 2. (E) 20b. (2 n + n 2 )( n 3 + 3 n ) = 2 n n 3 + 6 n + n 2 3 n + n 5 < = 6 n + 6 n + 6 n + 6 n (As 6 n is larger than other terms for n > 4 .) = 4 . 6 n Thus it is O (6 n ) for C = 4 and n > 4 . 3. (M) 38. From definitions of Big-Theta we have numbers C1, k1, C2, k2, C3, k3, C4 and k4 such that 1. | f ( x ) | ≤ C 1 | g ( x ) | for x > k 1 2. | f ( x ) | ≥ C 2 | g ( x ) | for x > k 2 3. | g ( x ) | ≤ C 3 | h ( x ) | for x > k 3 4. | g ( x ) | ≥ C 4 | h ( x ) | for x > k 4 Combining 1, 3 nad 2,4 we get 5. | f ( x ) | < = C 1 C 3 | h ( x ) | for x > max { k 1 , k 3 } 6. | f ( x ) | > = C 2 C 4 | h ( x ) | for x > max { k 2 , k 4 } This Shows that f(x) is Θ( h ( x )) Section 3.3 4. (E) Each iteration takes a bounded amount of time, and there are at most n iterations, since each iteration decreases the number of cents remaining. Therefore there are O(n) comparisons.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern