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 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
question
Engineering, 04.07.2019 18:10
Water in a partially filled large tank is to be supplied to the roof top, which is 8 m above the water level in the tank, through a 2.2-cm-internal-diameter pipe by maintaining a constant air pressure of 300 kpa (gage) in the tank. if the head loss in the piping is 2 m of water, determine the discharge rate of the supply of water to the roof top in liters per second.
Answers: 3
question
Engineering, 04.07.2019 18:10
Hydraulic fluid with a sg. of 0.78 is flowing through a 1.5 in. i.d. pipe at 58 gal/min. the fluid has an absolute viscosity of 11.8 x 105 lbf-sec/ft2. is the flow laminar, turbulent or within the critical range? give both a numerical reynolds number and a term answer.
Answers: 3
question
Engineering, 04.07.2019 19:10
The air in an automobile tire with a volume of 0.015 m3 is at 32°c and 140 kpa gage. determine the amount of air that must be added to raise the pressure to the recommended value of 206 kpa gage. assume the atmospheric pressure to be 128 kpa and the temperature and the volume to remain constant.[r-0.287 kj/kgk]
Answers: 3
You know the right answer?
The linear partition problem (LP1) is defined as follows: Given a sequence Sof n positive integers (...
Questions
question
Mathematics, 02.09.2021 02:30
question
Mathematics, 02.09.2021 02:30
question
Mathematics, 02.09.2021 02:30
question
Mathematics, 02.09.2021 02:30
question
Chemistry, 02.09.2021 02:30
question
Mathematics, 02.09.2021 02:30
question
Mathematics, 02.09.2021 02:30
question
Mathematics, 02.09.2021 02:30
Questions on the website: 13722367