This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Sample Problem 2 In this problem you are NOT allowed to use the theorems about BigOh stated in the lecture notes. Your proof should follow just from the definition of BigOh. (As usual in problems with BigOh, we assume that the functions map nonnegative reals to strictly positive reals.) Prove Theorem 5 on slide 30 of Lecture Notes 2, that is, prove that for any(all) f,g,h,k if f ( n ) is O ( h ( n )) and g ( n ) is O ( k ( n )) then f ( n ) + g ( n ) is O ( h ( n ) + k ( n )). Answer Assume f ( n ) is O ( h ( n )) therefore ∃ N 1 ,c 1 > 0 such that ∀ n ≥ N 1 we have f ( n ) ≤ c 1 h ( n ). Assume also that g ( n ) is O ( k ( n )) therefore ∃ N 2 ,c 2 > 0 such that ∀ n ≥ N 2 we have g ( n ) ≤ c 2 k ( n ). We want to show that these assumptions imply that ∃ N 3 ,c 3 > 0 such that ∀ n ≥ N 3 we have f ( n ) + g ( n ) ≤ c 3 ( h ( n ) + k ( n )). From f ( n ) ≤ c 1 h ( n ) and g ( n ) ≤ c 2 k ( n ), we can add the sides of these two inequalities obtaining f ( n ) + g ( n ) ≤ c 1 h ( n ) + c 2 k ( n )....
View
Full Document
 Spring '09
 TANNEN
 Algorithms, Data Structures, Analysis of algorithms, Negative and nonnegative numbers, Existential quantification

Click to edit the document details