Question

Youre in charge of running a scientific program (job) that simulates a physical system for as many discrete steps as you can

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a.) let V(A,k) denote the maximum value of any plan that ends at machine A at the end of kth minute and let V(B,k) denote the maximum value of any plan that ends at machine B at the end of kth minute.

Now, if any plan ends at machine A at the end of kth sec, then at the end of k-1th second, it could be at machine A or machine B. if there is a simple shift from machine A at the end of k-1th sec to machine A itself, then a[k] is added to the max value plan and if there is a move from machine B to machine A at the end of k-1th sec, then the max value plan remains same(equal to max value plan after k-1th sec) after the kth sec as well since kth sec is utilized in moving.

Hence, we can derive the recurrence relation from this observation as below:-

V(A,k) = max( V(A,k-1) + a[k], V(B,k-1) )

similar explanation can be given for V(B,k) as well and thus the recurrence relation would be

V(B,k) = max( V(B,k-1) + b[k], V(A,k-1) )

  

b.) pseudo code for finding max value plan after nth sec:-

###this is a recursive code:-

max_plan(a[ ], b[ ], n){

// this is base case. if n = 1, it tells that we are at starting point and need to choose the max value from a[1] and b[1]

if( n == 1 ){

return max( a[1], b[1] )

}

// recursive calls

max_A = max( max_plan(a[ ], b[ ], n-1) + a[n], max_plan(b[ ], a[ ], n-1)

  max_B = max( max_plan(b[ ], a[ ], n-1) + b[n], max_plan(a[ ], b[ ], n-1)

// final result

return max( max_A, max_B )

}

Add a comment
Know the answer?
Add Answer to:
You're in charge of running a scientific program (job) that simulates a physical system for as ma...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • A.) show that the following algorithm does not correctly solve this problem, by giving an instance...

    A.) show that the following algorithm does not correctly solve this problem, by giving an instance on which it does not return the correct answer B.) Give an efficient algorithm that takes values for l1, l2,...,ln and h1, h2, hn and returns the value of an optimal plan Suppose you're managing a consulting team of expert computer hackers, and each week you have to choose a job for them to undertake. Now, as you can well imagine, the set of...

  • Fresh out of school, you take a job with a small injection-molding shop with two machines...

    Fresh out of school, you take a job with a small injection-molding shop with two machines (25 ton and 250 ton. On any given shift, there are two workers assigned to each machine one is concerned with setting/loading and unloading while the other packages the final product for shipping. You have been asked to investigate whether you can improve the process, potentially with automation. Having recently re-read The Goal, you are quite aware that adding robots does not necessarily mean...

  • a C++ program that computes the cost of a long-distance call. The cost of the call...

    a C++ program that computes the cost of a long-distance call. The cost of the call is determined according to the following rate schedule: a. Any call started between 8:00 A.M. and 6:00 P.M., Monday through Friday, is billed at a rate of $0.40 per minute. b. Any call starting before 8:00 A.M. or after 6:00 P.M., Monday through Friday, is charged at a rate of $0.25 per minute. c. Any call started on a Saturday or Sunday is charged...

  • Hello, I am having some trouble with a supermarket checkout simulation program in C++. What I...

    Hello, I am having some trouble with a supermarket checkout simulation program in C++. What I have so far just basically adds customers to the queue and prints when they arrive. I am struggling with how to implement a way of keeping track of when a given customer finishes(I will attach what I have so far). I had already created queue and node classes (with headers and cpp files) that I modified in my attempt. I would be very grateful...

  • Part b) Increase the applied force magnitude to the largest value permitted by the simulation. The...

    Part b) Increase the applied force magnitude to the largest value permitted by the simulation. The words “Block on verge of slipping” should appear. This means that the static frictional force on the aluminum block has reached its physical upper limit. It is not possible, given the intermolecular forces between the atoms in the welds, for the static frictional force to be any larger. We shall label this maximum static frictional force as f→s,max. What is f→s,max on the block...

  • a) Provide a critique of three financial project selection models of your choice by discussing the...

    a) Provide a critique of three financial project selection models of your choice by discussing the advantages and disadvantages of each. b) A project requires the purchase of a new piece of machinery. You are the project manager and you must choose between two potential machines (Machine A and Machine B), either of which would be suitable. The cost of each machine is identical at £311,000. However, they differ in performance such that the projected future cash flows are different...

  • One year ago, your company purchased a machine used in manufacturing for $110,000. You have learned...

    One year ago, your company purchased a machine used in manufacturing for $110,000. You have learned that a new machine is available that offers many advantages, you can purchase it for $150,000 today. It will be depreciated on a straight line basis over ten years, after which it has no salvage value. You expect that the new machine will contribute EBITDA (earnings before interest, taxes depreciation, and amortization) of $40,000 per year for the next ten years. The current machine...

  • MATLAB Create a function that provides a definite integration using Simpson's Rule Problem Summar This example demo...

    MATLAB Create a function that provides a definite integration using Simpson's Rule Problem Summar This example demonstrates using instructor-provided and randomized inputs to assess a function problem. Custom numerical tolerances are used to assess the output. Simpson's Rule approximates the definite integral of a function f(x) on the interval a,a according to the following formula + f (ati) This approximation is in general more accurate than the trapezoidal rule, which itself is more accurate than the leftright-hand rules. The increased...

  • This is done in c programming and i have the code for the programs that it wants at the bottom i ...

    This is done in c programming and i have the code for the programs that it wants at the bottom i jut dont know how to call the functions Program 2:Tip,Tax,Total int main(void) {    // Constant and Variable Declarations    double costTotal= 0;    double taxTotal = 0;    double totalBill = 0;    double tipPercent = 0;    // *** Your program goes here ***    printf("Enter amount of the bill: $");    scanf("%lf", &costTotal);    printf("\n");    // *** processing ***    taxTotal = 0.07 * costTotal;    totalBill...

  • with job satisfaction? CC-12. Using job characteristics theory, explain why the present system of job design...

    with job satisfaction? CC-12. Using job characteristics theory, explain why the present system of job design may be con- tributing to employee dissatisfaction. Describe some ways you could help employees feel more satisfied with their work by redesigning their jobs. 1 me idea about **** Repairing Jobs That Fail to Sati Learning Goals Companies often divid ciency, but speciali quences. Drain sed specialization petitors' costs often divide work as a way to impro Secialization can lead to negative DrainFlow is...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT