Ask your own question, for FREE!
Mathematics 23 Online
OpenStudy (anonymous):

Why is 2n^2 = O(n^3) ? This is given as an example of big O notation in the MIT OCW Introduction to Algorithms (SMA 5503) course. It's in lecture 2 around minute 3. My calc background is extremely shaky, and I really don't understand what's going on there.

OpenStudy (anonymous):

Specifically, it looks to me like that should be O(n^2) --I thought that's what dropping the leading terms means.

OpenStudy (anonymous):

It is O(n^2)

OpenStudy (anonymous):

hmm. Then the professor must've made a mistake. Thanks!

OpenStudy (anonymous):

Well

OpenStudy (anonymous):

Recall that big 0 is an upper bound

OpenStudy (anonymous):

So technically everything that's O(n) is also O(n^2) and all higher values?

OpenStudy (anonymous):

Yeah, but we'd like to have as tight a bounds as possible

OpenStudy (anonymous):

I'm watching the vid to see if I can figure out why he was using that

OpenStudy (anonymous):

yeah he just made a mistake.

OpenStudy (anonymous):

yeah, I was really confused. It seems like the point of big O notation is to try to describe the growth of functions for arbitrarily large inputs, but calling that O(n^3) only seems to describe the function's behavior for n = 2.

OpenStudy (anonymous):

Because the definition is: \[f\in O(g(x)) \iff \exists C,k \text{ such that }|f(x)| \le C|g(x)|, \forall x >k \]

OpenStudy (anonymous):

In this case \(f(x) = 2n^2, g(x) = n^2\) And my C would be 2 and my k would be 0

OpenStudy (anonymous):

Actually any x value can serve as the k witness.

OpenStudy (anonymous):

Ack. that's terrible notation, sorry.

OpenStudy (anonymous):

Should be f(n) and g(n) not f(x) etc.

OpenStudy (anonymous):

Cool. Thanks!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!