Lecture 25(Wednesday)

# Lecture 25(Wednesday) - Special case Was the rst big-Oh...

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

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

View Full Document

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: Special case? Was the rst big-Oh exercise a special case? What happens to the argument if you add a constant: Prove 3n2 + 2n + 5 P y(n2) See what needs to be modi ed in the proof to accommodate the constant 5. slide 9 in general, O(g ): y( g ) = ff : N U3 R0 j Wc P R+; WB P N; Vn P N; n ! B A f (n) 7n6 5n4 + 2n3 P y(6n8 4n5 + n2) cg n ( )g Prove: slide 10 how to prove n3 TP y(3n2)? slide 12 non-polynomials Big-oh statements about polynomials are pretty easy to prove: f P y(g ) exactly when the highest-degree term of g is no smaller than the highest-degree term of f . What about functions such as log(n) or 3n? Logarithmic functions are in big-Oh of any polynomial, whereas exponential functions (with a base bigger than 1) are not in big-Oh of any polynomial. How do you prove such things? slide 14 the long way Without the techniques of calculus, you could prove that 2n TP y(n2). The key idea is that you'd have to show that for any given c, you could nd an n so that 2n > cn2. To make this work nicely, it would be nice to have a piece of n to overwhelm any multiplier c that could be thrown at us in the form of cn2. For example, it would be convenient if 2n were greater than n3 = nn2. This certainly isn't true for all n, but is it true \eventually"? Exercise: nd natural number k so that you can prove that for all natural numbers greater than k, 2n > n3. slide 15 ...
View Full Document

{[ snackBarMessage ]}

### Page1 / 5

Lecture 25(Wednesday) - Special case Was the rst big-Oh...

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

View Full Document
Ask a homework question - tutors are online