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: 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 ≥ : ) ( ) ( 1 1 n h n f c ≤ ≤ , and for all 2 n n ≥ : ) ( ) ( 2 2 n h n g c ≤ ≤ . Let ) , max( 2 1 n n n = . Then for all n n ≥ , we can multiply the above inequalities to get ) ( ) ( ) ( ) ( 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 n are positive, and for all n n ≥ : ) ( ) ( ) ( ) ( 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 Θ = ....
View
Full
Document
This note was uploaded on 12/03/2009 for the course CS CS101 taught by Professor Agoreback during the Spring '09 term at American College of Gastroenterology.
 Spring '09
 AgoreBack
 Algorithms

Click to edit the document details