0

How it can possible

$\ 1/2n^2 -3n = Θ(n^2) $

Why we dont care $\ 3n $ and $\ 1/2 $

  • By definition $f(n)=\Theta(n^2)$ if $f(n)$ can be sandwiched between two different constant multiples of $n^2$. In your example, we have that $0.4n^2 \le 0.5n^2-3n \le 0.5n^2$ for all sufficiently large $n$. For large $n$, the $n^2$ term dominates the linear term. For eg, $0.5 (1000^2) - 3(1000)$ is roughly $0.5(1000^2)$). Also, the coefficient $0.5$ doesn't matter - see the literature for why we do asymptotic analysis. It's the asymptotic growth rate (which is quadratic) that determines how good/bad the algorithm is. Having a computer twice as fast would take care of the constant. – Ashwin Ganesan Oct 07 '19 at 04:04
  • @AshwinGanesan thank you – Ceren Bülbül Oct 07 '19 at 05:30

0 Answers0