1

Is the complexity of $F(n) = n \cdot n^{\log_3 2}$ allowed to be written as $O(n)$, or must you specify and say $O(n^{1.63})$, or even must you write $O(n^2)$ since it is an upper bound?

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503
  • 2
    Outgoing from that math.log$(2,3)=0.6309297535714574$ (from python), then $O(n^{1.63})$ cannot be upper bound, IMHO, tight and/or the best estimation is to write it as $O(n^{1+\log_3 2})$ or, more good, $\Theta(n^{1+\log_3 2})$. – zkutch Sep 20 '22 at 06:00

2 Answers2

2

It definitely isn't $O(n)$, it's rather $\Omega (n)$. $O(n^2)$, $O(n^{1+\log_3{2}})$ (and not $O(n^{1.63})$, thanks to the comments) are both correct, with $O(n^{1 + \log_32})$ being the tighter upper bound of the two, and the tightest upper bound in this particular example.

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503
Rinkesh P
  • 1,024
  • 1
  • 5
  • 17
1

If $f(n)=O(n^\alpha)$ (your exponent, $\approx1.63$), then certainly $f(n)=O(n^2)$. But you may not conclude $f(n)=O(n)$. If you want to keep the available information, stick to $O(n^\alpha)$. The exponent needs not be integer.