Create a work plan

Assignment Help Data Structure & Algorithms
Reference no: EM13326598

Suppose you need to create a work plan, and each week you have to choose a job to undertake. The set of possible jobs is divided into low-stress and high-stress jobs.

If you select a low-stress job in week i, then you get a revenue of li dollars; if you select a high-stress job, you get a revenue of hi dollars. The catch, however, is that in order for you to take on a high-stress job in week i, it's required that you rest in weeki - 1 because you need a full week of prep time to get ready for the stress level (It's okay to choose a high-stress job in week 1.) On the other hand, you can take a low-stress job in weeki even if you have done a job (of either type) in week i-1.

So, given a sequence of n weeks, a plan is speci?ed by a choice of "low-stress", "high-stress" or "none" for each of the n weeks, with the constraint that if "high-stress" is chosen for week i> 1, then "none" must be chosen for week i - 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.)

Example: Suppose n=4, and the values of li and hiare given by the following table. Then the plan of the maximum value would be to choose "none" in week 1, a high stress job in week 2, and low-stress jobs in weeks 3 and 4. The value of this plan would be 0+50+10+10=70.
i Week 1 Week 2 Week 3 Week 4

l 10 1 10 10
h 5 50 5 1

Design a dynamic programming algorithm to find the value of the optimal plan. Implement your algorithm using any programming language you prefer. Describe the recurrence relation used by your algorithm at the top of your program or in a separate file.

 

Reference no: EM13326598

Questions Cloud

Compute the youngs modulus of this tendon : A 14.9 cm long tendon was found to stretch 3.50 mm by a force of 15.0 N. The tendon was approximately round with an average diameter of 8.22 mm. Calculate the Young's modulus of this tendon
Calculate the terminal velocity of this skydiver : A skydiver with his parachute has a combined mass of 79 kg and an approximate frontal area of 0.71 m^2. Calculate the terminal velocity of this skydiver in a horizontal position
What is her velocity at the bottom of the swing : A gymnast whose mass is 50.0 kg swings back and forth on a 4.0m long rope. What is her velocity at the bottom of the swing
What is the height of the table : What is the gravitational force between two 20-kg iron balls separated by a distance of .9 m? What is the height of the table
Create a work plan : Design a dynamic programming algorithm to find the value of the optimal plan. Implement your algorithm using any programming language you prefer. Describe the recurrence relation used by your algorithm at the top of your program or in a separate f..
Identify the budgetary accounts used in federal agency : Identify the budgetary accounts used in federal agency accounting and explain the sequential flow of budgetary authority through the accounts in your own words.
Design greedy algorithm to solve activity selection problem : Design a greedy algorithm to solve the activity selection problem. Suppose there are a set of activities: a1, a2, ... an that wish to use a lecture hall. Each activity ai has a start time siand a finish time fi.
Evaluate account balances : Shiras Distributing Company had the following account balances - the company completed the following summary transactions.
What is its maximum height above the ground : A gray kangaroo can bound across level ground with each jump carrying it 8.1m from the takeoff point. What is its maximum height above the ground

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  How output of leaky bucket policer can be fed in second

Illustrate how output of the leaky bucket policer can be fed into second leaky bucket policer so that two leaky buckets in series police average rate, peak rate, and burst size.

  Find the checksum field in a single parity bit scheme

Assume that the information content of a packet is the bit pattern 1111000010100101 and an even parity is being used

  An undirected graph g is called bipartite

An undirected graph G is called bipartite if its vertices can be partitioned into two sets X and Y such that every edge in G has one end vertex in X and one end vertex in Y

  .specify and define a method for linkedbag

Add a constructor to the class LinkedBag that creates a bag from a given array of entries.Specify and define a method for LinkedBag that removes a random entry from the bag.

  Use sequential search algortithm to locate the number

These numbers should be stored in an array. Use the sequential search algortithm to locate the number entered by the user. If the number is in the array, the program should display a message.

  Computing entropy of plaintext message

Compute the entropy of the plaintext message?

  Algorithm for partitioning a set of n weights into k

give a greedy algorithm for partitioning a set of n weights into k bins. b) does it find the perfect solution?

  Use a circular linked list to implement the queue

use a circular linked list to implement the queue data structure as described in java

  Identifying flaws in the design

Identify flaws in design of the Report of Consumers that follows. What assumptions about users and tasks did you make in order to assess this design?

  Portfolio website containing thumbnail imagery

Explain in general terms what you think the role of good design is. Next, recognize 3-characteristics of an effective gallery website. Then find an example of a portfolio website containing thumbnail imagery.

  Question about lan and wan

Think about the following two scenarios two computers are connected to a LAN using a total of 20-feet of cable, and two computers are connected over the Internet and are 8000 miles from each other.

  What would ultimate result of algorithm

Single grain of wheat was to be placed on the first square of chess board, two on second, four on third, eight on the fourth, and so on, until all 64 squares had been filled. What would ultimate result of this algorithm have been?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd