Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started