lab2soln

# Sample problem 2 in this problem you are not allowed

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
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Sample Problem 2 In this problem you are NOT allowed to use the theorems about Big-Oh stated in the lecture notes. Your proof should follow just from the definition of Big-Oh. (As usual in problems with Big-Oh, 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

{[ snackBarMessage ]}

### Page1 / 3

Sample Problem 2 In this problem you are NOT allowed to use...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online