comp250_midterm2

# comp250_midterm2 - Computer Science 308-250B Midterm...

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

Computer Science 308-250B Midterm, Feb 20, 2002, 18:30-19:30. S O L U T I O N S

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

View Full Document
Computer Science 308-250B Midterm, Feb 20, 2002, 18:30-19:30. O P E N • B O O K S •/• O P E N • N O T E S 1) Show the following (and justify your steps) a) n 1000 is O(n n ) For n>1000000 we have that n >1000. Therefore, for all n>1000000 we have n 1000 < n n . By definition this means n 1000 is O(n n ). b) n+n log n+7 is Ω ( n log(log n) ) We actually show “n log(log n) is O(n 2 +n log n+7)” and conclude “n 2 +n log n+7 is Ω (n log(log n) )” since f(n) is O(g(n)) if and only if g(n) is Ω (f(n)) by definition. To prove this, first notice 2 a,b a+b a*b since 1/a 1/2 1-1/b thus 2 x,b x*b = a+b+b+…+b a*b*b*…*b = b x where a = x-floor(x-2) log(log n) is O(log n) using rule 10 n log 2 n is O(n 2 ) (*) using rule 6 and then, n 2 < n 2 +n log n+7, for all n>0 (since n log n +7 > 0) n 2 is O(n 2 +n log n+7) (**) by definition. Therefore, using (*), (**) and rule 3, n log 2 n is O(n 2 +n log n+7).
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