31 August 2007
Jacob Manske
Com S 511  Assignment 1
Exercise 01
Let
f
,
g
be asymptotically positive functions such that the limit
lim
n
→∞
f
(
n
)
g
(
n
)
exists and is finite. Prove that
f
∈
O
(
g
)
.
Proof.
Since
lim
n
→∞
f
(
n
)
g
(
n
)
exists and is finite and
f
and
g
are asymptotically positive,
∃
c
∈
R
+
∪ {
0
}
such that
lim
n
→∞
f
(
n
)
g
(
n
)
=
c.
Then
∃
N
such that
∀
n
≥
N
,
f
(
n
)
g
(
n
)

c <
1. Then
f
(
n
)
g
(
n
)

c <
1, so
f
(
n
)
<
(
c
+ 1)
g
(
n
)
∀
n
≥
N
. Hence
f
∈
O
(
g
), as desired.
Exercise 02
Suppose you have a choice of four algorithms to solve a given problem with the following (approximate)
running times as a function of input size
n
:
Algorithm 1:
n
4
seconds,
Algorithm 2:
30
n
3
seconds,
Algorithm 3:
1200
n
2
seconds,
Algorithm 4:
60000
n
seconds.
Specify a range of
n
for which each of the algorithms is optimal.
Solution.
To find a range of
n
for which algorithm
i
is optimal, we find those
n
such that the running time
for algorithm
i
is less than the running time for algorithm
j
∀
j
=
i
.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '07
 Dick
 Graph Theory, lim, Computational complexity theory, 1920, 1916

Click to edit the document details