7

A homework assignment asks me to state the complexity in Big-O notation of the function $$f(n) = 7n – 3n \log n + 100000 $$

I graphed this function and decreases all the way down to zero nearly its entire lifespan. Therefore I concluded that the complexity is bounded by a constant and has the complexity $O(1)$.

Is this correct?

Also out of curiosity, what is the Big-Omega of this function is? The best it could ever run is also O(1). What about Big-Theta? I'm having trouble getting my head around these.

Raphael
  • 72,336
  • 29
  • 179
  • 389
CodyBugstein
  • 2,957
  • 10
  • 30
  • 45

1 Answers1

1

If you use suitable definitions, you'll find that your function is in

  • $O(2^n)$,
  • $O(n^4)$,
  • $o(1)$ and
  • $\Omega(-n^2)$,

among many others. It's likely that the question (implicitly) asks for sharper bounds; I'll leave that for you to figure out.

Raphael
  • 72,336
  • 29
  • 179
  • 389