Solve exercises 4.5-1/abcd page 96. Justify your answers.
Solve problems 4.1/aceg page 107. Justify your answers.
Solve problems 4.3/aceg page 108. Justify your answers.
Solve exercise 3.2-7 page 60 from CLRS (Fibonacci).
Solve exercise 4.2-1 page 82 from CLRS (Strassen).
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.
Rate of growth of functions. Say, about how many decimal digits
has the number 2^2^2^2^2?
Asymptotic notation: definitions, comparisons
and basic manipulation.
Divide and conquer: Karatsuba,
MAXMIN and other algorithms.
Only parts of some exercises were done for the first two assignments.
Solve the other parts.
Become the master of the Master Method to solve recurrences.
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.
Solve exercise 15.4-5 page 397 from CLRS (LCS-like).
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.
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
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.
Study the rod cutting problem of section 15.1, pages 360-369.
Solve exercise 15.1-3 page 370.
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.
Solve exercise 15.2-3 page 378.
Solve exercise 15.3-1 page 389.
Be brief, but justify your answer.
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.
Given
show that the following hold for Catalan numbers:
and
Prove that the number of ways a convex polygon with n + 2 sides
can be triangulated is equal to the Catalan number C_{n}.
This and other interesting applications of Catalan numbers are
in the handout given in class.