subject

Suppose you are managing a consulting team of expert computer hackers, and each week you have to choose a job for them to undertake. The set of possible jobs is divided into those that are low-stress (e. g. setting up a Web site for a class at the local elementary school) and those that are high-stress (e. g., protecting the deanโ€™s most valuable secrets.) The basic question each week is whether to take on a low-stress job or a high-stress job. If you select a low-stress job for your team in week i, then you get a revenue of li > 0 dollars; if you select a high-stress job, you get a revenue of hi > 0 dollars. High-stress jobs typically pay more. The catch, however, is that in order for the team to take on a high-stress job in week i, it is required that they do no job (of either type) in week i โˆ’ 1; they need a full week of prep time to get ready for the crushing stress level. On the other hand, it is okay for them to take a low-stress job in week i even if they have done a job (of either type) in week i โˆ’ 1. So, given a sequence of n weeks, a plan is specified by a choice of low-stress, high-stress or none for each of the n weeks, with the property that if high-stress is chosen for week i > 1, then none has to be chosen for week i โˆ’ 1. (It is okay to choose a high-stress job in week 1.) The value of the plan is determined in the natural way; for each i, you add li to the value if you choose low-stress in week i, and you add hi to the value if you choose high-stress in week i. (You add 0 if you choose none in week i.) Given sets of values l1, l2, ..., ln and h1, h2, ..., hn, find a plan of maximum value (such a plan is called optimal.) Give an efficient algorithm to take the input values and return the value of an optimal plan.

What would a recursive dynamic programming solution to this be?

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 03:00
Jason, samantha, ravi, sheila, and ankit are preparing for an upcoming marathon. each day of the week, they run a certain number of miles and write them into a notebook. at the end of the week, they would like to know the number of miles run each day, the total miles for the week, and average miles run each day. write a program to them analyze their data. your program must contain parallel arrays: an array to store the names of the runners and a two-dimensional array of five rows and seven columns to store the number of miles run by each runner each day. furthermore, your program must contain at least the following functions: a function to read and store the runnersโ€™ names and the numbers of miles run each day; a function to find the total miles run by each runner and the average number of miles run each day; and a function to output the results. (you may assume that the input data is stored in a file and each line of data is in the following form: runnername milesday1 milesday2 milesday3 milesday4 milesday5 milesday6 milesday7.)
Answers: 3
question
Computers and Technology, 23.06.2019 17:30
Scientists have changed the model of the atom as they have gathered new evidence. one of the atomic models is shown below. what experimental evidence led to the development of this atomic model from the one before it? a few of the positive particles aimed at a gold foil seemed to bounce back. the colors of light emitted from heated atoms had very specific energies. experiments with water vapor showed that elements combine in specific proportions. cathode rays were bent in the same way whenever a magnet was brought near them.
Answers: 2
question
Computers and Technology, 24.06.2019 00:30
Which boolean operator enables you to exclude a search term? a} not b} and c} or d} plus
Answers: 1
question
Computers and Technology, 24.06.2019 07:00
Why would a business likely use a java applet - to back up their data files for the business - to create a program that a customer can launch in their web browser - to create music on a powerpoint presentation - to organize files on their company directory
Answers: 3
You know the right answer?
Suppose you are managing a consulting team of expert computer hackers, and each week you have to cho...
Questions
question
Mathematics, 03.05.2020 13:02
question
Mathematics, 03.05.2020 13:02
question
Mathematics, 03.05.2020 13:02
question
English, 03.05.2020 13:02
Questions on the website: 13722361