CS 173: Discrete Structures, Spring 2010
Homework 8
This homework contains 5 problems worth a total of 46 regular points.
It is due on Friday,
April 2nd at 4pm. Put your homework in the appropriate dropbox in the Siebel basement.
1.
Solving recurrences [10 points]
(a) Use unrolling to find a closed form for the following recurrence, for inputs that are
powers of 2. Show at least three steps of unrolling, convert to a closed form, and
simplify your closed form.
p
(
n
) =
braceleftbigg
4
p
(
n
2
)
if
n >
1
2
otherwise
(b) The function
g
:
Z
+
→
Z
+
is defined below.
Find a closed form for
g
, correctly
handling inputs that aren’t powers of three. Show your work and/or provide a brief
explanation. However, it is not necessary to show details of unrolling, since it’s very
similar to a problem you did for homework 7.
g
(
n
) =
braceleftbigg
g
(
⌊
n
3
⌋
) + 21
if
n
≥
3
0
otherwise
2.
Recurrence tree [10 points]
Consider the following recurrence:
T
(
n
) =
d
if
n <
= 4
T
(
n
) = 2
T
(
n/
2) +
cn
+
p
otherwise
where
c
,
d
, and
p
are constants. Let’s analyze
T
when the input
n
is a power of 2.
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.
 Spring '08
 Erickson
 1920, 1922, 1918, 1926, 1927, 1925

Click to edit the document details