Algorithms: Assignment 1 Kishore Kothapalli Due: 26-AUGUST-2014, 830 AM, in The Drop Box at CSTAR

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Algorithms

Assignment 1
Kishore Kothapalli
Due: 26-AUGUST-2014, 830 AM, in the drop box at CSTAR

Problem 1. Consider n appliances that you want to buy at the rate of exactly one each month. They all cost
the same initially, but due to inflationary pressures, the rate of the ith item increases by a factor of ri each
month. (So, in t months, the cost of the item is raised by rit .) Find an algorithm to arrive at the optimal
buying sequence that minimizes the total purchase cost. Obtain the runtime of your algorithm, and also
prove the correctness of your algorithm.
Problem 2. Do Problem 16-1, on page 402, in the book by Cormen et al., Second edition. (Note: The
problem is titled Coin changing)
Problem 3. In the problem discussed in class as an example to the exchange argument, change the objective
(goal) to minimize the average lateness. Would the same algorithm work now? Justify your answer.
Problem 4. Problem 16-2 (a) on Page 402, in the book by Cormen et al. Second edition.
You are given a set of n jobs with their durations and one machine to process all these jobs. The goal is
to minimize the average completion time for the schedule. The completion time of a job is the time when
the job finishes.
Problem 5. Do Problem 15-7, Page 369, in the book by Cormen et al., Second edition.

You might also like