Homework 4

  • Assigned: Friday, October 16, 2009
  • Due: MONDAY, October 26, 2009 (5pm in 122A mailboxes)
  • Required for Undergraduates: 5 of the following 6 problems 
  • Required for Graduate Students: 5 of the following 6 problems 
  • Points: 10 pts per problem
  • General Instructions: 
  1. Please review the homework and grading policy outlined in the course information and homework page.
  2. Turn in problems separately, based on the signs on the mailboxes in 122A.  DO NOT staple separate problems to one another.
  3. Submit the solutions on a standard A4/letter paper. 
  4. Either type the homework (e.g. using the formatting software called latex), OR,  where applicable, if   written on paper, circle your answers. (running times, true/false, etc.)
  5. For each problem:
        - Staple pages belonging to a single problem.
        - Write UNI and name.
        - Indicate your professor's name (Stein or Monteleoni).
        - Write EC/RC on each problem.
  6. On each problem, you must also write down with whom you worked on the assignment.
  7. Start early, be concise but rigorous, and enjoy!
  • Specific Instructions:
  1. Be sure to review any parts of Chapters 15 and 16 with which you are not familiar.
  2. All logs are base 2 unless otherwise specified.
  3. For a dynamic programming problem, be sure to show optimal substructure, give the algorithm and analyze the running time.
  4. Unless otherwise specified, all problems and exercises are from CLRS, Introduction to Algorithms, 3rd edition.
  • Problems:   
  1.  Problem 15-1.  Longest simple path in a directed acyclic graph
  2.  Problem 15-11.  Inventory planning
  3.    a) Exercise 16.1-1.  (DP for activity selection)
       b) Exercise 16.1-2.  (Last activity to start)
       c) Exercise 16.1-3.  (Greedy choices that do not work)
  4.    a) Exercise 16.2-4 .  (Skating professor)
       b) Exercise 16.2-6.  (Linear fractional knapsack) 
       c) Exercise 16.3-1.  (Huffman)
  5.  Problem 16-1.  Coin changing
  6.  Problem 16-5.  Offline caching