Suppose you are given a set S = {a1,a2,.,an} of tasks, where task a; requires pi...
Fantastic news! We've Found the answer you've been seeking!
Transcribed Image Text:
Suppose you are given a set S = {a1,a2,.,an} of tasks, where task a; requires pi units of processing time to complete, once it has started. You have one computer on which to run these tasks, and the computer can run only one task at a time. Let c; be the completion time of task a;, that is, the time at which task a; completes processing. Your goal is to minimize the average completion time, that is, to minimize E1 Ci. For example, suppose there are two tasks, aj and az, with pi = 3 and p2 = 5, and consider the schedule in which az runs first, followed by a1. Then c2 = 5, cl = 8, and the average completion time is (5+8)/236.5. If task aj runs first, however, then c1 = 3, c2 = 8, and the average completion time is (3+8)/2 = 5.5. (1) Design an algorithm that schedules the tasks in S so as to minimize the average completion time. Write down the pseudocode of your algorithm, which should return the minimum average completion time at the end. (2) Compute the time complexity of your algorithm. (3) Prove that your algorithm indeed minimizes the average completion time. Suppose you are given a set S = {a1,a2,.,an} of tasks, where task a; requires pi units of processing time to complete, once it has started. You have one computer on which to run these tasks, and the computer can run only one task at a time. Let c; be the completion time of task a;, that is, the time at which task a; completes processing. Your goal is to minimize the average completion time, that is, to minimize E1 Ci. For example, suppose there are two tasks, aj and az, with pi = 3 and p2 = 5, and consider the schedule in which az runs first, followed by a1. Then c2 = 5, cl = 8, and the average completion time is (5+8)/236.5. If task aj runs first, however, then c1 = 3, c2 = 8, and the average completion time is (3+8)/2 = 5.5. (1) Design an algorithm that schedules the tasks in S so as to minimize the average completion time. Write down the pseudocode of your algorithm, which should return the minimum average completion time at the end. (2) Compute the time complexity of your algorithm. (3) Prove that your algorithm indeed minimizes the average completion time.
Expert Answer:
Answer rating: 100% (QA)
1 Algorithm is very simple Just we have to observe the thing that scheduling that with less completion time before scheduling task having greater comp... View the full answer
Related Book For
Database management systems
ISBN: 978-0072465631
3rd edition
Authors: Raghu Ramakrishan, Johannes Gehrke, Scott Selikoff
Posted Date:
Students also viewed these accounting questions
-
Suppose you are given a set S = {a 1 , a 2 , . . . ,a n } of tasks, where task a i requires p i units of processing time to complete, once it has started. You have one computer on which to run these...
-
Suppose you are given a set S of n line segments in the plane, such that each makes a positive angle with the x-axis of either 30 or 60 (so there are only two possible slopes for the lines in S)....
-
Suppose you are given a set of small boxes, numbered 1 to n, identical in every respect except that each of the first i contain a pearl whereas the remaining n i are empty. You also have two magic...
-
The distance between the K+ and Cl ions in KCl is 2.80 1010 m. Calculate the energy required to separate the two ions to an infinite distance apart, assuming them to be point charges initially at...
-
What do you think are the risks of placing too much reliance on merchandising software? Do the risks outweigh the benefits? Explain your answer.
-
A 0.6 m diameter gas pipeline is being used for the long-distance transport of natural gas. Just past a pumping station, the gas is found to be at a temperature of 25 C and a pressure of 3.0 MPa....
-
A \(5.0-\mathrm{m}\)-wide channel has a slope of 0.004 , a \(8.0-\mathrm{m}^{3} / \mathrm{s}\). water flow rate, and a water depth \(1.5 \mathrm{~m}\) after a hydraulic jump. Find the water depth...
-
Assume that you have been hired as a consultant by CGT, a major producer of chemicals and plastics, including plastic grocery bags, styrofoam cups, and fertilizers, to estimate the firms weighted...
-
1. A car is traveling at 60 mph and needs to come to a stop in 100 feet. What acceleration is required if the brakes are applied after a 0.5-second delay? 2. A ball is rolled around a circular track...
-
Anyone whos ever watched late-night TV knows how many people want to lose weight the easy way. On the basis of recent medical studies, there may be such a thing. Glaxo Smith Kline bought the drug...
-
Your retired client has accumulated investment and retirement assets totaling $5,233,000 and is happy with an after-tax lifestyle of $255,000 a year. He is going to spend this amount every year...
-
My observations of the budget prepared for Bruin Sales and Service are that it appears to be well-structured and comprehensive. The budget takes into consideration various factors such as seasonality...
-
Q-3. A set of 4 helical spring set, made of chrome-vanadium steel (Ty= 690 MPa, G = 76 GPa), is to support 20 kN of load. Springs have the following features: N = 12; d = 16 mm; C = 6; Using the...
-
Find the force on the person's hands CM 80 cm 700 N 40 cm
-
What was the deviant behavior? What was the punishment, if any? What are the ramifications on sport and society due to this particular situation? Is this behavior a common theme in sports? If so,...
-
There is a personality type that is more at risk for coronary heart disease and heart attacks. What is the central aspect of this personality type that is most predictive of these health problems?
-
Joe's income is 120 dollars and he spend it only on apples, which cost pa per unit, and bananas, which cost pb per unit. Joe likes to consume bananas with each apple. (a) Derive Joe's demand function...
-
The trade-off theory relies on the threat of financial distress. But why should a public corporation ever have to land in financial distress? According to the theory, the firm should operate at the...
-
In answering the following questions, assume that the full deletion algorithm is used. Assume that merging is done when a bucket becomes empty. 1. Give an example of Extendible Hashing where deleting...
-
Consider a relation R with five attributes ABCDE. 1. For each of the following instances of R, state whether it violates (a) the FD BC D and (b) the MVD BC D: (a) { } (i.e., empty relation) (b)...
-
Briefly answer the following questions: 1. Consider the three basic techniques, iteration, indexing, and partitioning, and the relational algebra operators selection, projection, and join. For each...
-
To what amount will the following investments accumulate? a. $6,000 invested for 12 years at 12 percent compounded annually b. $7,500 invested for 8 years at 8 percent compounded annually c. $6,400...
-
What is the present value of the following future amounts? a. $805 to be received 10 years from now discounted back to the present at 10 percent b. $376 to be received 5 years from now discounted...
-
At what annual rate would the following have to be invested? a. \($820\) to grow to \($1,988.12\) in 13 years b. \($320\) to grow to \($423.10\) in 6 years c. \($57\) to grow to \($290.30\) in 18...
Study smarter with the SolutionInn App