Here is a more precise definition of theta notation, along with another
example.
(3) Theta (precise version)
Definiton: A function f(n) is of exact order g(n), noted f(n)
= Q(g(n)),
if there exist positive constants c1, c2 and n0
such that c1*g(n) <= f(n) <= c2*g(n)
for all n >= n0.
Example:
COMMENTS:
The following chart shows both upper bound (2*nlgn) and lower bound
(1*nlgn) functions for the formula (n + nlgn).
As for n0, it must be chosen so that the resulting range of
n is the intersection of the range for big-Oh and the range for
omega. The chart above shows that visually: