Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Greedy Algorithms and Exchange Arguments Scenario : You play on a local game show where you will complete n different challenges and try to make

Greedy Algorithms and Exchange Arguments

Scenario: You play on a local game show where you will complete n different challenges and try to make as much money as possible. The ith challenge takes ti minutes to complete. You start off with winnings of $1000 but will lose one dollar per minute for each challenge that is not yet completed. In other words, if you complete challenge i at time f(i), you lose f(i) dollars in total for that challenge. Your goal is to order the challenges to lose as little as possible. Assume the times ti are short enough so no matter what order you choose, your winnings will always be positive.

a) Suppose t1 = 2, t2 = 5, t3 = 1

What is the optimal ordering? (to minimize money lost)

How much do you lose from your initial $1000 in winnings?

b) One of the orderings below is guaranteed to be optimal. Select the correct one.

Sort Challenges by:

-Randomly

-Increasing ti

-Decreasing ti

c) Prove that the ordering you selected always finds an optimal solution. Use an exchange argument.

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

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions