You cannot prove that n^2-4n=Theta(2^n)
because the statement isn't true.
There are several equivalent ways to define the big-theta notation. One is in terms of big-Oh and big-Omega notations, i.e., that f=Theta(g)
if f=O(g)
and f=Omega(g)
. This means that there are constants C,D>0
such that for all sufficiently large n
we have C*g(n) <= f(n) <= D*g(n)
, that is we can "sandwich" the function f
between C*g
and D*g
. If this should be the case then the limit of f(n)/g(n)
as n
goes to infinity should be a constant---otherwise one of the functions grows asymptotically faster than the other and there's no way to sandwich the functions in that manner because one of the functions will eventually escape (it grows faster than constant times the other function).
To see that n^2-4n
is not Theta(2^n)
, it thus suffices to look at the following limit:
lim_{n -> infty} (n^2-4n)/2^n = 0
This means that the function 2^n
grows asymptotically faster than n^2-4n
, so there's no way to sandwich n^2-4n
between C*2^n
and D*2^n
for all sufficiently large n
for some C,D>0
.