subject
Engineering, 04.06.2020 14:07 gorillalover9000

The linear partition problem (LP1) is defined as follows: Given a sequence Sof n positive integers (s1, s2, . . . , sn) and an integer k, partition S into k ranges so as to minimize the maximum sum over all ranges. Note that "minimizing the maximum sum" is one way to quantify fairness. It minimizes the most work that anyone has to do. Another way to quantify fairness given the same input instead maximizes the minimum sum over all ranges. Call this version of the problem LP2. For an input sequence (1 2 4) with k= 2, an optimal solution to LP2 would place a divider between 2 and 4 giving a fairness index of min(1+2,4) = 3. This is superior to placing the divider between 1 and 2 resulting in a fairness index of min(1,2+4) = 1. a. Prove that the two definitions are equivalent when k= 2; i. e., given (s1, s2, . . . , sn), show that an optimal solution to both LP1 and LP2 will partition the sequence in exactly the same location.

b. Using a small example, show that, in general, the two problems are not equivalent; i. e., a partition corresponding to an optimal solution under one definition is not an optimal partition under the other definition.

c. What is the size of the solution space of the linear partition problem? This should be a formula in terms of n and k that counts the number of distinct ways to partition S into k ranges.

d. Provide the recurrence relation (including base cases) for LP2.

e. Implement a recursive algorithm for LP2 in code based on your recurrence relation above. Suggested languages include Python or C++.

f. Implement a dynamic programming algorithm in code (that uses a table to avoid recomputation) to compute the optimal fairness index for LP2.

g. Implement a traceback step in code that identifies the locations of the dividers in an optimal solution to LP2.

h. Demonstrate that your code works correctly by showing its results on the following instance. S= (10 6 7 3 8 5 7 9 11 7 15 10 12 6 19 7 3 12 14 6); k= 4.

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 03:10
What precautions should you take to prevent injuries when dealing with heavy loads?
Answers: 1
question
Engineering, 04.07.2019 18:10
Asingle-geared blanking press has a stroke of 200 mm and a rated capacity of 320 kn. a cam driven ram is assumed to be capable of delivering the full press load at constant force during the last 15 percent of a constant-velocity stroke. the camshaft has an average speed of 90 rev/min and is geared to the flywheel shaft at a 6: 1 ratio. the total work done is to include an allowance of 16 percent for friction a) estimate the maximum energy fluctuation b) find the rim weight for an effective diameter of 1.2 m and a coefficient of speed fluctuation of 0.10
Answers: 1
question
Engineering, 04.07.2019 18:10
For the closed feedwater heater below, feedwater enters state 3 at a pressure of 2000 psia and temperature of 420 °f at a rate of ix10 ibhr. the feedwat extracted steam enters state 1 at a pressure of 1000 psia and enthalpy of 1500 btu/lbm. the extracted er leaves at an enthalpy of 528.7 btu/lbm steam leaves as a saturated liquid. (16) a) determine the mass flow rate of the extraction steam used to heat the feedwater (10) b) determine the terminal temperature difference of the closed feedwater heater
Answers: 3
question
Engineering, 04.07.2019 18:10
Consider a large isothermal enclosure that is maintained at a uniform temperature of 2000 k. calculate the emissive power of the radiation that emerges from a small aperture on the enclosure surface. what is the wavelength ? , below which 10% of the emission is concentrated? what is the wavelength ? 2 above which 10% of the emission is concentrated? determine the wavelength at which maximum spectral emissive power occurs. what is the irradiation incident on a small object placed inside the enclosure?
Answers: 2
You know the right answer?
The linear partition problem (LP1) is defined as follows: Given a sequence Sof n positive integers (...
Questions
question
Computers and Technology, 29.05.2020 11:58
question
World Languages, 29.05.2020 11:58
question
English, 29.05.2020 11:58
question
Mathematics, 29.05.2020 11:58
question
Mathematics, 29.05.2020 11:58
question
History, 29.05.2020 11:58
Questions on the website: 13722367