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

  Find capacity of a particular airplane type

Consider the entities and their attributes. You should 1st determine what entities want to track. Next determine what attributes are required for each entity, and what relations exist between these entities.

  What is the minimum number of attendants

A nursing home employs attendants who are needed around the clock. Each attendant is paid the same, regardless of when his or her shift begins. Each shift is 8 consecutive hours.

  Algorithm to recognize substrings which form numbers

Given the string of numbers, recognize all the substrings which form numbers which are divisible by 3. For instance, applying algorithm on the string.

  Creating a method find ranks in java

Create a method findRanks in Java that accepts an unsorted array of integers vals, and starting and ending rank start and end, numbering ranks from 0,

  Cost control techniques

Assume your company has just completed the Initiation Process for implementing an Email System Upgrade. It was identified in a recent meeting with management leaders from the Sales,

  What is complexity of the gnome sort for the average case

What is the complexity of the gnome sort for the average case? Justify your answer. The justification can be based on approximate calculations.

  Determine the relative record number in the sector

Assume a direct access file consists of sectors with 1024 byte capacity. Assume also that records are thirty-two bytes long.

  Design algorithm to receive two integer items from terminal

Design an algorithm that will receive two integer items from a terminal operator, and display to the screen their sum, difference, product and quotient.

  Creating a class for services

Make a class for services offered by a hair styling salon. Information fields with a String to hold the service description, a double to hold the price, and an integer to hold average number of minutes it takes to perform the service.

  Design a linked list structure

Design a linked list structure Music that contains data fields Name, Artist, Number_of_Songs, and a pointer to the list. Design the structure with three members and fill in data for each member.

  Explain types of information systems

Question 1. Explain five types of information systems, and give an example of each. Question 2. Describe three common reasons for a systems request. Try and find one not listed in the text.

  Write down the algorithm to insert an item

Write down the sample code to create a Linked List and allocate storage space for a node Write down the algorithm to insert an item At the beginning of a linked list

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