CSCI-665 Foundations of Algorithms
Homeworks, dates for section 5
Spring 2017


Homework 1 ( pdf ), due Thursday, February 9

Homework 2, due Tuesday, February 21

  1. Solve exercises 4.5-1/abcd page 96. Justify your answers.
  2. Solve problems 4.1/aceg page 107. Justify your answers.
  3. Solve problems 4.3/aceg page 108. Justify your answers.
  4. Solve exercise 3.2-7 page 60 from CLRS (Fibonacci).
  5. Solve exercise 4.2-1 page 82 from CLRS (Strassen).
  6. Solve exercise 4.2-4 page 82 from CLRS (Strassen).

Homework 3, due Tuesday, February 28

This homework will not be graded. It is meant mostly as preparation for the first midterm exam 2/28.
  1. Rate of growth of functions. Say, about how many decimal digits has the number 2^2^2^2^2?
  2. Asymptotic notation: definitions, comparisons and basic manipulation.
  3. Divide and conquer: Karatsuba, MAXMIN and other algorithms.
  4. Only parts of some exercises were done for the first two assignments. Solve the other parts.
  5. Become the master of the Master Method to solve recurrences.
  6. Dynamic programming: the classical approach to the LCS problem. Determine all LCS's of the sequences BBACBCA and BABCCBA. Draw a diagram similar to that in Figure 15.8 page 395, but mark also all the ties.
  7. Solve exercise 15.4-5 page 397 from CLRS (LCS-like).
  8. The overview of the Hirschberg's algorithm for the LCS, the main lemma and theorem it relies on. You will become the master of all aspects of this algorithm for the next exam.
  9. MIT lecture slides covered include units 1, 2, 3 and 15.

First Midterm Exam, Tuesday, February 28, in class

Homework 4, due Thursday, March 23

  1. Trace the behaviour of the recursive Hirschberg's quadratic-time linear-space Algorithm C on the strings BBCABA and CBBBAAB. It is enough to show in detail only the main level of recursion of Algorithm C.
  2. Study the rod cutting problem of section 15.1, pages 360-369. Solve exercise 15.1-3 page 370.
  3. Study matrix-chain multiplication problem in section 15.2. Find an optimal parenthesization of a matrix-chain product whose sequence of dimensions is < 20, 6, 50, 10, 3, 20, 25>. Show triangular matrices m[i,j] and s[i,j] as on page 376, the details of computations of m[1,6], and how to use s[1,6] to obtain the final result.
  4. Solve exercise 15.2-3 page 378.
  5. Solve exercise 15.3-1 page 389. Be brief, but justify your answer.
  6. Solve exercise 15.3-3 page 389. Be brief, but justify your answer.


Homework 5, due Thursday, April 6

This homework will not be graded. It is meant mostly as preparation for the second midterm exam 4/6.
  1. Given
    C_n = \frac{1}{n+1}{2n\choose n} = \frac{(2n)!}{(n+1)!\,n!
} \qquad\mbox{ for }n\ge 0,

    show that the following hold for Catalan numbers:

    C_0 = 1 \quad \mbox{and} \quad C_{n+1}=\frac{2(2n+1)}{n+2}
C_n,
    and
    C_n = {2n\choose n} - {2n\choose n-1} \quad\mbox{ for }n\g
e 1.

  2. Prove that the number of ways a convex polygon with n + 2 sides can be triangulated is equal to the Catalan number Cn. This and other interesting applications of Catalan numbers are in the handout given in class.
  3. Solve exercise 15.3-4 page 390.
  4. Solve exercise 15.3-5 page 390.
  5. Solve exercise 16.3-2 page 436.
  6. Solve exercise 16.3-3 page 436.
  7. Solve exercise 23.1-5 page 629.
  8. Solve exercise 23.1-5 page 629.
  9. Study chapter 23, in particular 23.2.
  10. Two exercises on MST, pdf

Second Midterm Exam, Thursday, April 6, in class

Homework 6 ( pdf ), due Thursday, April 20

Homework 7 ( pdf ), due Friday, May 12


Back to the course page