Is $3n^2 - 1$ is or is not $O(n^2)$?
I tried to solve it by adding the constants to get $c: 3 + 1 = 4; c = 4$.
If $n \geq n_0$ and $n_0$ is $1$, $3n^2 - 1 \leq 4n^2$. However, to disprove it, I tried to substitute zero to the equation:
$3n^2 - 1 \leq cn^2$
$\implies 3(0^2) - 1 \leq 4(0^2)$
$\implies 0 - 1 \leq 0$
$\implies -1 \leq 0$
So it seems that for values lower than 1, it is still true. Can someone help me to explain this?
Thanks!
O(n^2)only for alln >= 1? If that's the case, then for alln < 1, it should not beO(n^2)? So if I substitute any value starting from 1 and above,3n^2 - 1is indeed <=4n^2. However, if I substitute zero, I still get<=. – user1764381 Aug 08 '16 at 13:14n >=10, do you mean that it will also be meaningless to check values less than10? – user1764381 Aug 08 '16 at 13:16