CS 373
Homework 0 (due 1/26/99)
Spring 1999
CS 373: Combinatorial Algorithms, Spring 1999
http://wwwcourses.cs.uiuc.edu/ cs373
Homework 0 (due January 26, 1999 by the beginning of class)
Name:
Net ID:
Alias:
Neatly print your name (first name first, with no comma), your network ID, and a short alias into
the boxes above. Do not
sign
your name. Do not write your Social Security number. Staple this
sheet of paper to the top of your homework. Grades will be listed on the course web site by alias,
so your alias should not resemble your name (or your Net ID). If you do not give yourself an alias,
you will be stuck with one we give you, no matter how much you hate it.
Everyone must do the problems marked
◮
. Problems marked
a3
are for 1unit grad students
and others who want extra credit.
(There’s no such thing as “partial extra credit”!) Unmarked
problems are extra practice problems for your benefit, which will not be graded. Think of them as
potential exam questions.
Hard problems are marked with a star; the bigger the star, the harder the problem.
This homework tests your familiarity with the prerequisite material from CS 225 and CS 273
(and
their
prerequisites)—many of these problems appeared on homeworks and/or exams in those
classes—primarily to help you identify gaps in your knowledge.
You are responsible for filling
those gaps on your own.
Undergrad/.75U Grad/1U Grad Problems
◮
1.
[173/273]
(a) Prove that any positive integer can be written as the sum of distinct powers of
2
. (For
example:
42 = 2
5
+ 2
3
+ 2
1
,
25 = 2
4
+ 2
3
+ 2
0
,
17 = 2
4
+ 2
0
.)
(b) Prove that any positive integer can be written as the sum of distinct
nonconsecutive
Fi
bonacci numbers—if
F
n
appears in the sum, then neither
F
n
+1
nor
F
n
−
1
will.
(For
example:
42 =
F
9
+
F
6
,
25 =
F
8
+
F
4
+
F
2
,
17 =
F
7
+
F
4
+
F
2
.)
(c) Prove that
any
integer can be written in the form
∑
i
±
3
i
, where the exponents
i
are
distinct nonnegative integers. (For example:
42 = 3
4
−
3
3
−
3
2
−
3
1
,
25 = 3
3
−
3
1
+ 3
0
,
17 = 3
3
−
3
2
−
3
0
.)
◮
2.
[225/273]
Sort the following functions from asymptotically smallest to largest, indicating
ties if there are any:
n
,
lg
n
,
lg lg
∗
n
,
lg
∗
lg
n
,
lg
∗
n
,
n
lg
n
,
lg(
n
lg
n
)
,
n
n/
lg
n
,
n
lg
n
,
(lg
n
)
n
,
(lg
n
)
lg
n
,
2
√
lg
n
lg lg
n
,
2
n
,
n
lg lg
n
,
1000
√
n
,
(1 +
1
1000
)
n
,
(1
−
1
1000
)
n
,
lg
1000
n
,
lg
(1000)
n
,
log
1000
n
,
lg
n
1000
,
1
.
[To simplify notation, write
f
(
n
)
≪
g
(
n
)
to mean
f
(
n
) =
o
(
g
(
n
))
and
f
(
n
)
≡
g
(
n
)
to
mean
f
(
n
) = Θ(
g
(
n
))
. For example, the functions
n
2
,
n
,
(
n
2
)
,
n
3
could be sorted as follows:
n
≪
n
2
≡
(
n
2
)
≪
n
3
.]
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
CS 373
Homework 0 (due 1/26/99)
Spring 1999
3.
[273/225]
Solve the following recurrences. State tight asymptotic bounds for each function
in the form
Θ(
f
(
n
))
for some recognizable function
f
(
n
)
. You do not need to turn in proofs
(in fact, please
don’t
turn in proofs), but you should do them anyway just for practice. Assume
reasonable (nontrivial) base cases. Extra credit will be given for more exact solutions.
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '09
 A
 Analysis of algorithms, LG, Fibonacci number, Fibonacci heap, Thu

Click to edit the document details