Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(40 marks) Consider the following optimization problem. You are are writing your final term paper for PHIL 999. You have taken n books out of

image text in transcribed

(40 marks) Consider the following optimization problem. You are are writing your final term paper for PHIL 999. You have taken n books out of the library that you need for your paper, and you have read none of them. The books are all overdue by now, and the library is charging you a late fee of S1 per day per book. For each book j, you have already determined that it will take you tj days to read the book. You can only read one book at a time, and you want to return each book as soon as you finish it so you won't have to pay late fees on a book you have finished reading. The library books problem is to find the order in which to read all n books that minimizes the late fees. (a) (5 marks) Give a formal definition (pre- and post-conditions) of the problem described. (b) (5 marks) Consider the case where there are three books that take t 10, t2 5, and t3- 8 days to read, respectively. What is the optimal solution to the problem? (c) (10 marks) Give an efficient greedy algorithm that finds an optimal solution for the general case. (d) (5 marks) Explain why your algorithm returns an optimal solution (e) (10 marks) Prove that your algorithm returns an/the optimal solution. (f) (5 marks) Prove a tight asymptotic bound on the running time of your algorithm (40 marks) Consider the following optimization problem. You are are writing your final term paper for PHIL 999. You have taken n books out of the library that you need for your paper, and you have read none of them. The books are all overdue by now, and the library is charging you a late fee of S1 per day per book. For each book j, you have already determined that it will take you tj days to read the book. You can only read one book at a time, and you want to return each book as soon as you finish it so you won't have to pay late fees on a book you have finished reading. The library books problem is to find the order in which to read all n books that minimizes the late fees. (a) (5 marks) Give a formal definition (pre- and post-conditions) of the problem described. (b) (5 marks) Consider the case where there are three books that take t 10, t2 5, and t3- 8 days to read, respectively. What is the optimal solution to the problem? (c) (10 marks) Give an efficient greedy algorithm that finds an optimal solution for the general case. (d) (5 marks) Explain why your algorithm returns an optimal solution (e) (10 marks) Prove that your algorithm returns an/the optimal solution. (f) (5 marks) Prove a tight asymptotic bound on the running time of your algorithm

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 19th International Conference Dexa 2008 Turin Italy September 2008 Proceedings Lncs 5181

Authors: Sourav S. Bhowmick ,Josef Kung ,Roland Wagner

2008th Edition

3540856536, 978-3540856535

More Books

Students also viewed these Databases questions

Question

i need correct answrrs 4 9 2 .

Answered: 1 week ago

Question

2. (1 point) Given AABC, tan A b b

Answered: 1 week ago