2^n + 6n^2 + 3n
I guess it’s just O(2^n), using the highest order term, but what is the formal approach to go about proving this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can prove that
2^n + n^2 + n = O(2^n)by using limits at infinity. Specifically,f(n)isO(g(n))iflim (n->inf.) f(n)/g(n)is finite.Since you have inf/inf, an indeterminate form, you can use L’Hopital’s rule and differentiate the numerator and the denominator until you get something you can work with:
The limit is 1, so
2^n + n^2 + nis indeedO(2^n).