Exercise XIII

  • Rank asymptotic complexities from smallest to largest.

Exercise For each of the T(n)T(n) running time listed below, figure out the asymptotic runtime and express it in Big-Oh notation. Then rank the functions in growth rate order, starting with the slowest growth rate (i.e those resulting in a fast runtime), and ending with the fastest growth rate (worst runtime). If two functions have the same asymptotic runtime, then rank them based on the original expressions (including constants).

T(n)T(n)Big-OhRank
(lgn4)3\left ( \lg \frac{n}{4} \right )^3
(n24)/(n+2)(n^2-4)/(n+2)
(3n+lgn)2\left ( 3n + \lg n \right )^2
2lgn22 \lg n^2
(2n)2+lgn\left ( 2^n \right )^2 + \lg n
n2lg16n^2 \lg 16
2nlglgn2n\lg\lg n
4n2+n(10+lgn)4n^2+n(10 + \lg n)
Solution
T(n)T(n)Big-OhRank
(lgn4)3\left ( \lg \frac{n}{4} \right )^3(lgnlg4)3=(lgn2)3O(lg3n)\left ( \lg n - \lg 4 \right )^3 = \left ( \lg n - 2 \right )^3 \in \Omicron(\lg^3 n)2
(n24)/(n+2)(n^2-4)/(n+2)(n2)(n+2)/(n+2)O(n)(n-2)(n+2)/(n+2) \in \Omicron(n)3
(3n+lgn)2\left ( 3n + \lg n \right )^29n2+lg2n+6nlgnO(n2)9n^2+\lg^2 n + 6n\lg n \in \Omicron(n^2)7
2lgn22 \lg n^24lgnO(lgn)4 \lg n \in \Omicron(\lg n)1
(2n)2+lgn\left ( 2^n \right )^2 + \lg n4n+lgnO(4n)4^n+\lg n \in \Omicron(4^n)8
n2lg16n^2 \lg 164n2O(n2)4n^2 \in \Omicron(n^2)5
2nlglgn2n\lg\lg nO(nlglgn)\Omicron(n\lg\lg n)4
4n2+n(10+lgn)4n^2+n(10 + \lg n)4n2+10n+nlgnO(n2)4n^2+10n+n\lg n \in \Omicron(n^2)6
Resources

Logarithmic identities are essential for solving the above exercise.