subject

You're trying to run a large computing job in which you need to simulate a physical system for as many discrete steps as you can. The lab you're working in has two large supercomputers (which we'll call A and B) which are capable of processing this job. However, you're not one of the high- priority users of these supercomputers, so at any given point in time, you're only able to use as many spare cycles as these machines have available Here's the problem you face. Your job can only run on one of the machines in any given minute Over each of the next n minutes, you have a "profile" of how much processing power is available on each machine. In minute i, you would be able to run ai > 0 steps of the simulation if your job is on machine A, and bi > 0 steps of the simulation if your job is on machine B. You also have the ability to move your job from one machine to the other; but doing this costs you a minute of time in which no processing is done on your job
So, given a sequence of n minutes, a plan is specified by a choice of A, B, or "move for each minute, with the property that choices A and B cannot appear in consecutive minutes. For example, if your job is on machine A in minute i, and you want to switch to machine B, then your choice for minute i +1 must be move, and then your choice for minute i 2 can be B. The value of a plan is the total number of steps that you manage to execute over the n minutes: so it's the sum of ai over all minutes in which the job is on A, plus the sum of bi over all minutes in which the job is on B
The problem. Given values a1, a2, an and b1, b2, bn, find a plan of maximum value (Such a strategy will be called optimal.) Note that your plan can start with either of the machines A or B in minute1
Example. Suppose n = 4, and the values of ai and bi are given by the following table. Minute 1 Minute 2 Minute 3 Minute 4 A 10 B 5 20 20
Then the plan of maximum value would be to choose A for minute 1, then move for minute 2, and then B for minutes 3 and 4, The value of this plan would be 10 + 0 + 20 + 20 = 50
(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 In minute 1, choose the machine achieving the larger of a bi Set 1-2 While n what was the choice in ninute-1? If A: If bHi> ata then Choose move in ninute f and B in ninute +1 Proceed to iteration +2 Else Choose A in minute i Proceed to iteration +1 Endif If B: behave as above vith roles of A and B reversed Endwhile In your example, say what the correct answer is and also what the algorithm above finds
(b) Give an efficient algorithm that takes values for a1, a2, ,an and b1, b2, … ,bn and returns the value of an optimal plan.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:00
Read this excerpt from helen keller’s autobiography, the story of my life. have you ever been at sea in a dense fog, when it seemed as if a tangible white darkness shut you in, and the great ship, tense and anxious, groped her way toward the shore with plummet and sounding-line, and you waited with beating heart for something to happen? i was like that ship before my education began, only i was without compass or sounding-line, and had no way of knowing how near the harbour was. "light! give me light! " was the wordless cry of my soul, and the light of love shone on me in that very hour. . the morning after my teacher came she led me into her room and gave me a doll. the little blind children at the perkins institution had sent it and laura bridgman had dressed it; but i did not know this until afterward. when i had played with it a little while, miss sullivan slowly spelled into my hand the word "d-o-l-l." i was at once interested in this finger play and tried to imitate it. when i finally succeeded in making the letters correctly i was flushed with childish pleasure and pride. running downstairs to my mother i held up my hand and made the letters for doll. i did not know that i was spelling a word or even that words existed; i was simply making my fingers go in monkey-like imitation. in the days that followed i learned to spell in this uncomprehending way a great many words, among them pin, hat, cup and a few verbs like sit, stand and walk. based on this excerpt, which words best describe helen keller?
Answers: 2
question
Computers and Technology, 23.06.2019 06:00
Which statement is true of web-based social media? a.they allow consumers to interact with and update content. b.they cannot be updated easily, as compared to print media. c.they are expensive to produce and maintain, as compared to print and television. d.they can exist independent of the internet.
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Plz ( which is an example of a good url?
Answers: 1
question
Computers and Technology, 23.06.2019 21:50
Description: write function lastfirst() that takes one argument—a list of strings of the format "lastname, firstname" —and returns a list consisting of two lists: (a) a list of all the last names (b) a list of all the first names
Answers: 2
You know the right answer?
You're trying to run a large computing job in which you need to simulate a physical system for as ma...
Questions
question
Advanced Placement (AP), 15.10.2020 01:01
question
Computers and Technology, 15.10.2020 01:01
question
English, 15.10.2020 01:01
Questions on the website: 13722363