Course Home | Assignments | Peer Assessment Procedures | Schedule & Lecture Notes

Saint Louis University

Computer Science 314
Algorithms

Michael Goldwasser

Fall 2014

Dept. of Math & Computer Science

Homework Assignment 02

Asymptotics, Dynamic Programming


Overview

Topics: Asymptotics, Dynamic Programming
Related Reading: Chapters 3, 4, 9, 15 of CLRS
Due: 10:00am, Monday, September 22, 2014

Please make sure to strictly adhere to the stated course procedures regarding the format of your submitted homework. In particular, your name should not appear on anything other than the cover page, and your solution for each problem must be in a separate packet, labeled appropriately with your assigned codename.

You must also adhere to the policies on academic integrity, paying particular attention to the limits on collaboration.


Problems to be Submitted

  1. Work entirely on your own

    Exercise 4.3-7 (on page 87 of CLRS). One of the challenges of this is to determine what low-order term to subtract.

  2. Work entirely on your own

    Determine a tight asymptotic upper bound for each of the following recurrence equations, and give a formal proof of the upper bound. If the master theorem applies, you simply need to prove what case applies. Otherwise, you might use a recursion tree to guess the answer and the substitution method to prove it by induction. You may assume that T(1) = 1 for all examples.

    1. T(n) = T(n-2) + n2

    2. T(n) = 2T(n-1) + 1

    3. T(n) = T(4n/5) + n

    4. T(n) = 2T(n/4) + sqrt(n)

  3. You may discuss ideas with other students (but your writeup must be independent)

    Exercise 9.3-7 (on page 223 of CLRS). Let me add a few comments:

  4. Work entirely on your own

    Exercise 15.3-5 (on page 390 of CLRS).

  5. You may discuss ideas with other students (but your writeup must be independent)

    During hard times, a company with n employees is planning to cut costs through massive layoffs. The company is organized using a classic hierarchy that can be modeled as a general tree, with everyone (other than the president) reporting directly to one other person. The Board of Trustees is considering whom to layoff (including, perhaps, the president), however to make sure that responsibilities for current work don't get reassigned too far, they have decided that they will never fire an employee and his or her direct manager.

    Given this constraint, their goal is to shed as much salary as possible through the layoffs. For notation, let sp denote the current salary for person p. There are 2n possible subsets of employees to consider laying off (not that all of those subsets will meet the constraint about an employee and manager), but a brute force search through all of those subsets is quite expensive. Fortunately, dynamic programming can be used to find the optimal subset of employees to fire in considerably less time.

    You are to describe such an efficient solution using dynamic programming. In evaluating your writeup, we will be looking for how you address the following issues:


Extra Credit

  1. Exercise 15-3 (on page 405 of CLRS).


Michael Goldwasser ©2014
CSCI 314, Fall 2014
Last modified: Saturday, 20 September 2014
Course Home | Assignments | Peer Assessment Procedures | Schedule & Lecture Notes