UML CS
91.404 Midterm Exam
Spring, 2004
1 of 5
MIDTERM EXAM &
SOLUTIONS
1. (20 points)
What can you conclude?
Given:
( )
( )
n
n
n
f
lg
2
lg
)
(
)
2
Ω
∈
( )
)
(
)
(
)
3
lg
lg
3
n
n
n
f
Θ
∈
2
1
)
(
)
1
n
n
f
Ω
∈
a) (10 points) Can we conclude from statements (1)(3) that
?
))
(
(
)
(
2
3
n
f
O
n
f
∈
Why or why not?
Either prove or provide a counterexample.
)
(
1
n
f
2
n
)
(
2
n
f
)
(
3
n
f
()
n
n
n
n
lg
lg
lg
lg
=
SOLUTION
:
YES.
First, observe that
()
.
This can be verified by taking lg of
both sides.
Next,
because lglgn > 2 for n > 16.
From
this we obtain the picture above.
n
n
n
n
lg
lg
lg
lg
=
()
lg
lg
lg
lg
n
n
n
n
>
=
2
n
To show that
, we first use the definition of
Θ
to conclude
that
.
Since
))
(
(
)
(
2
3
n
f
O
n
f
∈
)
(
)
3
lg
lg
n
n
f
n
∈
⇒
)
(
(
)
(
lg
lg
3
n
n
O
n
f
Θ
∈
( )
n
n
n
n
lg
lg
lg
lg
=
, this implies,
transitively, that
.
Now,
()
)
lg
n
n
lg
(
)
(
3
O
n
f
∈
( )
n
n
n
lg
2
)
(lg
)
(
Ω
∈
f
implies, using
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentUML CS
91.404 Midterm Exam
Spring, 2004
2 of 5
transpose symmetry, that
( ) ( )
)
(
lg
2
lg
n
f
O
n
n
∈
.
Thus, transitively,
.
))
(
(
)
(
2
3
n
f
O
n
f
∈
b) (10 points) Can we conclude from statements (1)(3) that
?
))
(
(
)
(
3
1
n
f
O
n
f
∈
Why or why not?
Either prove or provide a counterexample.
SOLUTION
:
NO.
Counterexample:
and
.
n
n
=
n
n
n
f
lg
lg
3
)
(
=
n
f
)
(
1
2.
(20 points)
Recurrence
In this problem, you will find a tight upper and lower bound on the closed
form solution for the following recurrence:
⎪
⎭
⎪
⎬
⎫
⎪
⎩
⎪
⎨
⎧
=
>
+
−
+
⎟
⎠
⎞
⎜
⎝
⎛
=
1
1
1
3
8
5
6
)
(
2
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '09
 DR.KARENDANIELS
 Analysis of algorithms, LG, lg lg

Click to edit the document details