You must also write down with whom you worked on the assignment, and any sources used.
Start early, be concise but rigorous, and enjoy!
Specific Instructions:
Be sure to review any parts of Chapters 1-4 with which you are
not familiar.
All logs are base 2 unless otherwise specified.
Unless otherwise specified, all problems and exercises are from
CLRS, Introduction to Algorithms, 3rd edition.
Problems to do but not hand in:
Problem 2-3.
Problem 4-1.
Problems To Hand In:
Show that for any positive real constants b, and d, (n^2 - b)d = Θ(n2d).
Is 34n = O(24n)? Is 34n = 2O(4n)
Exercise 3.2-4
Problem 2-4. Inversions.
Problem 3-4 b, d, e, g . Big-O and other notation.
Place the following functions by order of growth, from smallest
to largest. For each adjacent pair in the list, give a proof that the
earlier one is assymptotically smaller than (or equal to ) the second, by giving a
big-O proof.
n2
n0.8
2n
4lg lg n
lg4 n
4lg n
n2 + n1.99 lg n
16 n
(lg n)lg n / lg lg n
6n/2
Problem 4-3. c, e, i, j. For each
recurrence, provide an upper
bound. If the recurrence cannot be solved by the master method, you must justify the
solution via a substitution proof or by drawing a recursion tree.
You are given as input an array A[1..n], with n entries. Furthermore, you know that, the array consists of
a series of 0's followed by a series of 1's, but you don't know how many of each there are. Your goal is to
find the first 1 in the array. There is a cost associated with checking the value of an array.
Each time you check a value and it turns out to be 0, you must pay 1 dollar.
If value turns out to be 1, you have to pay 1 "Famous Algorithmist Trading Card (FATC)".
In each of the parts of this question, you will have some number of dollars and some number of FATC. You
must give an algorithm which will return the index of the first (lowest index 1) which works given your
resources. For each part write pseudocode and explain why your algorithm works, given your resources.
You have n dollars and 1 FATC
You have 1 dollars and n FATC
You have O(log n) dollars and O(log n) FATC
You have 2 dollars and O(n .5 ) FATC
You have k dollars and O(n1/k) FATC, for some constant k.