mid1solns - CMPS 101 Algorithms and Abstract Data Types...

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

View Full Document Right Arrow Icon
CMPS 101 Algorithms and Abstract Data Types Summer 2009 Midterm Exam 1 Solutions 1. (20 Points) Prove that )) ( ) ( ( )) ( ( )) ( ( n g n f n g n f Ω = Ω Ω . In other words, if )) ( ( ) ( 1 n f n h Ω = and )) ( ( ) ( 2 n g n h Ω = , then )) ( ) ( ( ) ( ) ( 2 1 n g n f n h n h Ω = . Proof: Assume )) ( ( ) ( 1 n f n h Ω = and )) ( ( ) ( 2 n g n h Ω = . Then there exist positive constants 2 1 2 1 , , , n n c c such that for all 1 n n : ) ( ) ( 0 1 1 n h n f c , and for all 2 n n : ) ( ) ( 0 2 2 n h n g c . Let ) , max( 2 1 0 n n n = . Then for all 0 n n , we can multiply the above inequalities to get ) ( ) ( ) ( ) ( 0 2 1 2 1 n h n h n g n f c c . Now let 2 1 c c c = . Observe that c , and 0 n are positive, and for all 0 n n : ) ( ) ( ) ( ) ( 0 2 1 n h n h n g n cf , showing that )) ( ) ( ( ) ( ) ( 2 1 n g n f n h n h Ω = , as required. /// 2. (20 Points) Use Stirling’s formula to prove that ) log ( ) ! log( n n n Θ = . Proof: Taking ) log( of both sides of Stirling’s formula: ( ) ) / 1 ( 1 2 ! n e n n n n Θ + = π , we get ( ) ) / 1 ( 1 log log log 2 log ) ! log( n e n n n n Θ + + + + = π ( ) ) / 1 ( 1 log log log log ) 2 / 1 ( 2 log n e n n n n Θ + + - + + = π , whence ( ) n n n n e
Image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern