# Selected Solutions for Chapter 3

:
Growth of Functions
Solution to Exercise 3.1-2
To show that .n ÷a/
b
= ‚.n
b
/, we want to ﬁnd constants c
1
; c
2
; n
0
> 0 such that
0 _ c
1
n
b
_ .n ÷a/
b
_ c
2
n
b
for all n _ n
0
.
Note that
n ÷a _ n ÷[a[
_ 2n when [a[ _ n ,
and
n ÷a _ n ÷ [a[
_
1
2
n when [a[ _
1
2
n .
Thus, when n _ 2 [a[,
0 _
1
2
n _ n ÷a _ 2n :
Since b > 0, the inequality still holds when all parts are raised to the power b:
0 _

1
2
n

b
_ .n ÷a/
b
_ .2n/
b
;
0 _

1
2

b
n
b
_ .n ÷a/
b
_ 2
b
n
b
:
Thus, c
1
= .1=2/
b
, c
2
= 2
b
, and n
0
= 2 [a[ satisfy the deﬁnition.
Solution to Exercise 3.1-3
Let the running time be T.n/. T.n/ _ O.n
2
/ means that T.n/ _ f.n/ for some
function f.n/ in the set O.n
2
/. This statement holds for any running time T.n/,
since the function g.n/ = 0 for all n is in O.n
2
/, and running times are always
nonnegative. Thus, the statement tells us nothing about the running time.
3-2 Selected Solutions for Chapter 3: Growth of Functions
Solution to Exercise 3.1-4
2
nC1
= O.2
n
/, but 2
2n
= O.2
n
/.
To show that 2
nC1
= O.2
n
/, we must ﬁnd constants c; n
0
> 0 such that
0 _ 2
nC1
_ c 2
n
for all n _ n
0
:
Since 2
nC1
= 2 2
n
for all n, we can satisfy the deﬁnition with c = 2 and n
0
= 1.
To show that 2
2n
,= O.2
n
/, assume there exist constants c; n
0
> 0 such that
0 _ 2
2n
_ c 2
n
for all n _ n
0
:
Then 2
2n
= 2
n
2
n
_ c 2
n
=2
n
_ c. But no constant is greater than all 2
n
, and
Solution to Exercise 3.2-4
{lg n¦Š is not polynomially bounded, but {lg lg n¦Š is.
Proving that a function f.n/ is polynomially bounded is equivalent to proving that
lg.f.n// = O.lg n/ for the following reasons.

If f is polynomially bounded, then there exist constants c, k, n
0
such that for
all n _ n
0
, f.n/ _ cn
k
. Hence, lg.f.n// _ kc lg n, which, since c and k are
constants, means that lg.f.n// = O.lg n/.

Similarly, if lg.f.n// = O.lg n/, then f is polynomially bounded.
In the following proofs, we will make use of the following two facts:
1. lg.nŠ/ = ‚.nlg n/ (by equation (3.19)).
2. {lg n¦ = ‚.lg n/, because

{lg n¦ _ lg n

{lg n¦ < lg n ÷1 _ 2 lg n for all n _ 2
lg.{lg n¦Š/ = ‚.{lg n¦ lg {lg n¦/
= ‚.lg nlg lg n/
= !.lg n/ :
Therefore, lg.{lg n¦Š/ = O.lg n/, and so {lg n¦Š is not polynomially bounded.
lg.{lg lg n¦Š/ = ‚.{lg lg n¦ lg {lg lg n¦/
= ‚.lg lg nlg lg lg n/
= o..lg lg n/
2
/
= o.lg
2
.lg n//
= o.lg n/ :
Selected Solutions for Chapter 3: Growth of Functions 3-3
The last step above follows from the property that any polylogarithmic function
grows more slowly than any positive polynomial function, i.e., that for constants
a; b > 0, we have lg
b
n = o.n
a
/. Substitute lg n for n, 2 for b, and 1 for a, giving
lg
2
.lg n/ = o.lg n/.
Therefore, lg.{lg lg n¦Š/ = O.lg n/, and so {lg lg n¦Š is polynomially bounded.

3-2 Selected Solutions for Chapter 3: Growth of Functions Solution to Exercise 3.lg n/. But no constant is greater than all 2n .19)). dlg ne D ‚. which. 2.n lg n/ (by equation (3. f . Hence.lg2 . and so dlg neŠ is not polynomially bounded. To show that 22n 6D O. lg. assume there exist constants c.lg n// o. Similarly.n// D O. n0 > 0 such that 0  22n  c  2n for all n  n0 : Then 22n D 2n  2n  c  2n ) 2n  c. To show that 2nC1 D O. we must ﬁnd constants c. but 22n ¤ O.f .1-4 2nC1 D O. means that lg.lg n/ : Therefore.lg lg n/2 / o. and so the assumption leads to a contradiction.dlg ne lg dlg ne/ D ‚.2n /. then there exist constants c. lg.n// D O. because   dlg ne  lg n dlg ne < lg n C 1  2 lg n for all n  2 lg. Solution to Exercise 3.2n /. then f is polynomially bounded.lg n lg lg n/ D !.lg n/.f .dlg neŠ/ ¤ O. n0 > 0 such that 0  2nC1  c  2n for all n  n0 : Since 2nC1 D 2  2n for all n. lg.lg n/.2-4 dlg neŠ is not polynomially bounded.n/  cnk .f .f . we can satisfy the deﬁnition with c D 2 and n0 D 1.nŠ/ D ‚.2n /.n// D O.lg n/ : .dlg lg neŠ/ D D D D D ‚. if lg.   If f is polynomially bounded.2n /.lg n/.n//  kc lg n. k. lg. Proving that a function f . In the following proofs. we will make use of the following two facts: 1.n/ is polynomially bounded is equivalent to proving that lg. but dlg lg neŠ is.lg lg n lg lg lg n/ o. n0 such that for all n  n0 .lg n/ for the following reasons.. since c and k are constants.dlg neŠ/ D ‚.dlg lg ne lg dlg lg ne/ ‚.

b > 0. Substitute lg n for n.e. that for constants a.Selected Solutions for Chapter 3: Growth of Functions 3-3 The last step above follows from the property that any polylogarithmic function grows more slowly than any positive polynomial function.lg n/. and 1 for a.dlg lg neŠ/ D O. 2 for b. and so dlg lg neŠ is polynomially bounded. ..lg n/ D o. we have lgb n D o. i. giving lg2 .lg n/. Therefore.na /. lg.