M340(92) Solutions Problem Set 6 (c) 203, Philip D Loewen. (a) If each pig is fed y kilograms of corn, y 2 kilos of tankage, and y 3 kilos of alfalfa, the cost per pig is g = 35y + 30y 2 + 25y 3. The nutritional minimums on carbohydrates, protein, and vitamins give, respectively, 90y + 20y 2 + 40y 3 200 30y + 80y 2 + 60y 3 80 0y + 20y 2 + 50y 3 50 Of course, the feeding amounts cannot be negative. So the farmer s problem is minimize g = 35y + 30y 2 + 25y 3 subject to 90y + 20y 2 + 40y 3 200 30y + 80y 2 + 60y 3 80 0y + 20y 2 + 50y 3 50 y, y 2, y 3 0 (b) A primal problem that would give the diet problem above as its dual is (c) Giving the online simplex solver the input maximize f = 200 x + 80 x2 + 50 x3 90 x + 30 x2 + 0 x3 <= 35 20 x + 80 x2 + 20 x3 <= 30 40 x + 60 x2 + 50 x3 <= 25 leads to this response: maximize f = 200x + 80x 2 + 50x 3 subject to 90x + 30x 2 + 0x 3 35 20x + 80x 2 + 20x 3 30 40x + 60x 2 + 50x 3 25 x, x 2, x 3 0 Optimal Solution: f = 04.268; x = 0.365854, x2 = 0, x3 = 0.20737 The optimal tableau is also of interest: x x2 x3 s s2 s3 f 0.2952 0 0.0295 0-0.00243902 0 0.365854 0 55.22 0-0.0487805-0.390244 0 8.5366 0.02439-0.009756 0 0.02952 0 0.20737 0 7.56 0 0.9756 0 2.80488 04.268 The bottom row of the tableau corresponds to the objective equation f = 04.3 7.56x 2 0.9756s 2.805s 3. (The online tool names the slack vector s.) The slack coefficients in the optimal objective row reveal the dual minimizer, so the solution to the diet problem in (a) is y = (0.9756, 0, 2.805). File hw06, version of 4 Jun 203, page. Typeset at 4:25 June 2, 203.
2 UBC M340 Solutions for Problem Set #6 That is, each pig should get 0.9756 Kg of corn, 2.805 Kg of alfalfa, and no tankage at all. This will cost the farmer g min = f max = 04.27 cents per pig (each day). Of course one can enter the problem from (a) directly: minimize e = 35 y + 30 y2 + 25 y3 90 y + 20 y2 + 40 y3 >= 200 30 y + 80 y2 + 60 y3 >= 80 0 y + 20 y2 + 50 y3 >= 50 The response is consistent with our findings above.: Optimal Solution: e = 04.268; y = 0.9756, y2 = 0, y3 = 2.80488 The objective row in the optimal tableau (not shown here) includes the slack-variable coefficients that we saw earlier in the components of x = (0.3659, 0, 0.2073). (d) In any LP of standard symmetric form, the optimal dual values reveal the rate of change of the optimum objective value with respect to small variations in the constraint vector b. To put the diet problem into standard symmetric form we would need to apply sign changes to both the constraints and the objective. These two changes cancel, so the optimal dual values for problem (a) reveal the rate of change of the optimal feeding cost with respect to the pigs nutritional requirements. If the nutritional guarantees for the pigs were changed to Carbohydrates: 90y + 20y 2 + 40y 3 200 + α Protein: Vitamins: 30y + 80y 2 + 60y 3 80 + β 0y + 20y 2 + 50y 3 50 + γ then the minimum daily cost of feeding each one, in cents, would be Z = 04.27 + 0.366α + 0.207γ. This relation is exact when the perturbation vector (α, β, γ) has small components. Promising the pigs more protein adds nothing to the cost because the current feeding strategy already gives them about 98 units well over the 80 they are entitled to currently. 2. (a) This is a case for complementary slackness. The given problem has dual minimize f = b y + b 2 y 2 + b 3 y 3 subject to 3y + y 2 + 4y 3 c 2y + y 2 + 3y 3 c 2 y + y 2 + 3y 3 c 3 2y + y 2 + 4y 3 c 4 y, y 2, y 3 0 (i) Primal Feasibility. Nonnegativity of x = (0, 2, 3, 0) and w = (0, 6, 0) are evident, and the prescribed values leave no flexibility in the choice of b: 0 = w = b 3x 2x 2 x 3 2x 4 = b 7 = b = 7 6 = w 2 = b 2 x x 2 x 3 x 4 = b 2 5 = b 2 = 0 = w 3 = b 3 4x 3x 2 3x 3 4x 4 = b 3 5 = b 3 = 5 (ii) Complementary Slackness, I. Since w2 > 0, we must have y 2 = 0. Remember this. (iii) Complementary Slackness, II. Positive primal decision variables require zero dual slacks. Thus x 2 > 0 = 0 = z 2 = 2y + y 2 + 3y 3 c 2 = 2y + 3y 3 c 2 x 3 > 0 = 0 = z 3 = y + y 2 + 3y 3 c 3 = y + 3y 3 c 3 File hw06, version of 4 Jun 203, page 2. Typeset at 4:25 June 2, 203.
UBC M340 Solutions for Problem Set #6 3 This gives a 2 2 system of linear equations to solve for y and y 3 : ] 2y + 3y3 = c 2 y + 3y 3 = c y = c 2 c 3 3 y3 = 3 c 2 + 2 3 c 3 (iv) Dual Feasibility. The vector y = (y, 0, y 3 ) will obey y 0 in R 3 if and only if y 0 and y 3 0, i.e., c 2 c 3 and c 2 2c 3. Feasibility also requires z 0 in R 4. Two components of this vector inequality have been arranged in part (iii); the others require 0 z = 3y + 4y 3 c = 5 3 c 2 3 c 3 c 0 z 4 = 2y + 4y 3 c 4 = 2 3 c 2 + 2 3 c 3 c 4 Combining these two inequalities with the ones given above leads to the system c 3 c 2 2c 3, 5c 2 c 3 3c, 2c 2 + 2c 3 3c 4. ( ) The four inequalities in ( ) hold if and only if the full complementary slackness recipe works out, so they are logically equivalent to the statement x achieves the maximum. Notes (not required):. Given some vector c R 4 satisfying all the inequalities listed in (a), the following vector has no negative entries: ( y = c 2 c 3, 0, 3 c 2 + 2 ) 3 c 3. Moreover, it satisfies all the inequalities in the dual problem, with zero surplus in lines 2 and 3. The value of this feasible solution for the dual is ( ) g(y 2c3 c 2 ) = 7(c 2 c 3 ) + 5 = 2c 2 + 3c 3. 3 (Here we use the vector b from step (i).) This is the same the value of the feasible solution x = (0, 2, 3, 0) for the primal, so this pair is simultaneously optimal. 2. In the converse, there is no promise of uniqueness for the solution x in the original problem. We can be sure of uniqueness when all the inequalities listed in (a) hold in their strict form, but not in general. See part (c). (b) As shown above, b = (7,, 5) is the only possibility. (c) Try c 3 = 2. Then the inequality system reduces to 2 c 2 4, 5c 2 2 3c, 2c 2 + 4 3c 4. Taking c 2 = 2 satisfies the first condition and reduces the others to One compatible vector is c () = (, 2, 2, ). 8 3c and 8 3c 4. Taking c 2 = 3 satisfies the first condition and reduces the others to A compatible vector is c (2) = (, 3, 2, ). 3 3c and 0 3c 4. File hw06, version of 4 Jun 203, page 3. Typeset at 4:25 June 2, 203.
4 UBC M340 Solutions for Problem Set #6 Taking c 2 = 4 satisfies the first condition and reduces the others to 8 3c and 2 3c 4. A compatible vector is c (3) = (, 4, 2, 2). Here f max = 4, achieved not only at x but also at (0, 7/2, 0, 0). Note that c (2) c () = (0,, 0, 0) and c (3) c () = (0, 2, 0, ) are not parallel, so the three vectors above are not colinear. Each one produces the desired optimum in computerized tests. Sometimes the optimizer is not unique and the computer finds a point different from x. In such cases it suffices to confirm that f(x ) agrees with the computed value of f max.] 3. (a) Some people have memorized this handy formula for the inverse of a 2 2 matrix: ] a b = c d ad bc d b c a Using this is just one of several acceptable ways to show that ] 3 7 B = = B = 2 5 ]. 5 7 2 3 (b) The partitioning scheme based on B = {3, 7} and N = {, 2, 4, 5, 6} puts Ax = b into the form Here we get x3 x 7 ] = Bx B + Nx N = b, i.e., x B = B b B Nx N. = 5 7 2 3 ] ] 36 25 5 7 2 3 ] 5 2 0 3 39 9 3] 5 4 5 6 3 Writing these equations explicitly produces the desired dictionary: ]. ] 2 4 5 6 0 2 3 x x 2 x 4 x 5 x 6. x 3 = 5 2x 0x 2 3x 4 39x 5 9x 6 x 7 = 3 + 5x + 4x 2 + 5x 4 + 6x 5 + 3x 6 ] x x 2 x 4 x 5 x 6 (c) The optimality test in the RSM starts with solving y T B = c T B. In rare cases like this one, where B is known, we can simply write ( ) y T = c T 5 7 B B = ( c 3 c 7 ) = (5c 2 3 3 2c 7 7c 3 + 3c 7 ). Then the nonbasic cost coefficient row is u T = c T N yt N = (c c 2 c 4 c 5 c 6 ) (5c 3 2c 7 7c 3 + 3c 7 ) = (c c 2 c 4 c 5 c 6 ) ( ) 2 4 5 6 0 2 3 ((2c 3 5c 7 ) (0c 3 4c 7 ) (3c 3 5c 7 ) (39c 3 6c 7 ) (9c 3 3c 7 )). File hw06, version of 4 Jun 203, page 4. Typeset at 4:25 June 2, 203.
UBC M340 Solutions for Problem Set #6 5 The current basis is optimal if and only if each component here is nonpositive. Taking the transpose, we can express this in the requested form: c 2 5 c 2 0 4 c 4 3 5 c 5 39 6 c 6 9 3 (d) When c = (, 3t, 2, 4t,, t, 0), the system of inequalities above becomes... 3t 4t t 2 5 0 4 3 5 39 6 9 3 ( c3 c 7 ( ) 2 = 0 ). 24 20 26. 78 8 All five component inequalities must hold at once. Two are independent of t, and the other three are simultaneously satisfied if and only if t 3/2. So B = {3, 7} is an optimal basis t 3 2. 4. The difference between the given problem and its antecedent in the textbook is the new variable x 4. Had this variable been present in the original problem, the dictionary in which x, w 2, and x 3 are basic variables would have come out like this: f = 3 w 3x 2 w 3 + αx 4 x = 2 2w 2x 2 + w 3 d x 4 w 2 = + 2w + 5x 2 d 2 x 4 x 3 = + 3w + x 2 2w 3 d 3 x 4 To find d here, recall the dictionary formula x B Bd = a (4). So we solve the system = B b B Nx N. It shows that d = B a (4), or x w 2 x 3 2 0 4 2 3 0 2 d d 2 = d 3, i.e., 2d + d 3 = 4d + d 2 + 2d 3 = 3d + 2d 3 =. The unique solution here is (d, d 2, d 3 ) = (,, ), so the lower rows of the new dictionary are x = 2 2w 2x 2 + w 3 x 4 w 2 = + 2w + 5x 2 + x 4 x 3 = + 3w + x 2 2w 3 + x 4 We can use these to refresh the objective function (optionally focussing only on the x 4 -dependence): f = 5 (2 2w 2x 2 + w 3 x 4 ) + 4x 2 + 3 ( + 3w + x 2 2w 3 + x 4 ) + 3x 4 = 3 w 3x 2 w 3 + x 4. Together with the system above, this gives a dictionary that shows x 4 should enter the basis and x should leave. Pivoting with the equation x 4 = 2 2w + w 3 2x 2 x changes the objective function to f = 5 x 5x 2 3w. File hw06, version of 4 Jun 203, page 5. Typeset at 4:25 June 2, 203.
6 UBC M340 Solutions for Problem Set #6 Unfortunately the nonbasic variable w 3 has a zero coefficient here, suggesting that the maximizer is not unique. So we need the details of the final dictionary. Here it is: f = 5 x 5x 2 3w x 3 = 3 x x 2 + w w 3 x 4 = 2 x 2x 2 2w + w 3 w 2 = 3 x + 3x 2 + w 3 We may choose w 3 = t for 0 t 3. The full set of solutions is f max = 5 attained when (x, x 2, x 3, x 4 ) = (0, 0, 3 t, 2 + t), 0 t 3. 5. The given problem differs from the one in the textbook because the coefficients of x 3 are all changed. Unfortunately, in the optimal dictionary for the textbook problem, variable x 3 is basic. So we treat this as a problem in which the modified coefficients actually introduce a new variable named x 3, thinking instead about maximize f = 5x + 4x 2 + 2 x 3 subject to 2x + 3x 2 + x 3 + x 3 5 4x + x 2 + 2x 3 + x 3 3x + 4x 2 + 2x 3 + x 3 8 x, x 2, x 3, x 3 0 The optimal dictionary for this problem will have the form f = 3 w 3x 2 w 3 + α x 3 x = 2 2w 2x 2 + w 3 d x 3 w 2 = + 2w + 5x 2 d 2 x 3 x 3 = + 3w + x 2 2w 3 d 3 x 3 To find the mystery coefficients d, d 2, d 3, recall that the RSM formulas x B = B b B Nx N reveal d = B ã (3), which is equivalent to Bd = ã (3), or x w 2 x 3 2 0 4 2 3 0 2 d d 2 = d 3, i.e., 2d + d 3 = 4d + d 2 + 2d 3 =. 3d + 2d 3 = The unique solution here is (d, d 2, d 3 ) = (,, ), leading to the lower equations x = 2 2w 2x 2 + w 3 x 3 w 2 = + 2w + 5x 2 + x 3 x 3 = + 3w + x 2 2w 3 + x 3 Now it is x 3 that should appear in the basis, so we pivot it in and x 3 out, writing x 3 = x 2 + x 3 3w + 2w 3. Back-substitution gives x = 3 x 2 x 3 + w w 3 x 3 = x 2 + x 3 3w + 2w 3 w 2 = 0 + 4x 2 + x 3 w + 2w 3 File hw06, version of 4 Jun 203, page 6. Typeset at 4:25 June 2, 203.
UBC M340 Solutions for Problem Set #6 7 In the modified objective, these choices imply f = 5x + 4x 2 + 2 x 3 = 3 3x 2 3x 3 w w 3. Now we have no further use for the variable x 3, which has become nonbasic, so we do not write it in the dictionary summarizing our work so far: f = 3 3x 2 w w 3 x = 3 x 2 + w w 3 x 3 = x 2 3w + 2w 3 w 2 = 0 + 4x 2 w + 2w 3 This dictionary is dual-feasible, although not feasible, so we proceed with the Dual Simplex Method. Variable x 3 must leave the basis, and the entering variable is found by considering f + t x 3 = (3 t) (3 + t)x 2 ( + 3t)w ( 2t)w 3. As t 0 increases, w 3 first attracts a zero coefficient, so w 3 must enter the basis. We pivot w 3 with x 3 via Substitution gives an optimal dictionary: w 3 = 2 + 2 x 2 + 2 x 3 + 3 2 w. f = 2.5 3.5x 2 0.5 x 3 2.5w x = 2.5.5x 2 0.5 x 3 0.5w w 2 =.0 + 5.0x 2 + x 3 + 2.0w w 3 = 0.5 + 0.5x 2 + 0.5 x 3 +.5w The modified problem has f max = 2.5, attained uniquely by (x, x 2, x 3) = (2.5, 0, 0). 6. (a) Suppose the firm s daily production is x bookcases, x 2 desks, x 3 chairs, and x 4 futon frames. Of course, each x i 0. Each product generates a different net profit; the firm s total profit is f = 9x + 3x 2 + 2x 3 + 7x 4. Comparing the materials needed to produce each product with the amounts available leads to the three constraints in the firm s optimization problem, which is to maximize f = 9x + 3x 2 + 2x 3 + 7x 4 subject to 3x + 2x 2 + x 3 + 2x 4 225 (hours of work) x + x 2 + x 3 + x 4 7 (units of metal) 4x + 3x 2 + 3x 3 + 4x 4 420 x, x 2, x 3, x 4 0 (units of wood) The optimal production levels are given: x = 39, x 2 = 0, x 3 = 48, x 4 = 30. Since a basis in this problem must have exactly three elements, we deduce that B = {, 3, 4} is the optimal basis for the current situation. To find the corresponding dictionary, we need to note that B = x x 3 x 4 3 2, implies B = 2 0 4. 4 3 4 5 2 File hw06, version of 4 Jun 203, page 7. Typeset at 4:25 June 2, 203.
8 UBC M340 Solutions for Problem Set #6 If we write (x 5, x 6, x 7 ) = (w, w 2, w 3 ) for the slack variables above, the lower rows of the optimal dictionary are x B = B b B Nx N, i.e., x x 3 = 2 0 4 225 7 2 0 4 2 0 0 x 2 0 0 x 5 x x 4 5 2 420 5 2 3 0 0 6 x 7 x x 3 = 39 48 2 x 2 0 4 x 5 x x 4 30 5 2 6 x 7 The famous RSM formulas also specify the objective row. The optimal dictionary is f = 827 x 2 2x 5 x 6 3x 7 x = 39 x 2 x 5 2x 6 + x 7 x 3 = 48 x 2 4x 6 + x 7 x 4 = 30 + x 2 + x 5 + 5x 6 2x 7 (b) Boosting the amount of metal available from 7 to 25 changes the second component of the constraint vector b. This affects the numbers in the current BFS: the new ones obey x x 3 x 4 3 2 x x 3 = 225 25, i.e., 4 3 4 x 4 420 3x + x 3 + 2x 4 = 225 x + x 3 + x 4 = 25 4x + 3x 3 + 4x 4 = 420 The unique solution (x B = B b) is x = 55, x 3 = 80, x 4 = 0. Its objective value is f = 9x + 3x 2 + 2x 3 + 7x 4 = 835. So a dual-feasible dictionary for the new problem is f = 835 x 2 2x 5 x 6 3x 7 x = 55 x 2 x 5 2x 6 + x 7 x 3 = 80 x 2 4x 6 + x 7 x 4 = 0 + x 2 + x 5 + 5x 6 2x 7 This dictionary is infeasible: thinking simplistically about how to use the additional metal produces a scheme we can t implement without having more wood as well. But we don t, so we need to think more strategically. The infeasibility identifies x 4 as a leaving variable. Expressing f + tx 4 = 835 x 2 2x 5 x 6 3x 7 + t ( 0 + x 2 + x 5 + 5x 6 2x 7 ) = (835 0t) + (t )x 2 + (t 2)x 5 + (5t )x 6 (2t + 3)x 7 shows that x 6 should enter in place of x 4 (and t = /5 gives a preview of the objective row when it does). Pivoting gives the optimal dictionary f = 833 0.8x 2.8x 5 0.2x 4 3.4x 7 x = 5 0.6x 2 0.6x 5 0.4x 4 + 0.2x 7 x 3 = 72 0.2x 2 + 0.8x 5 0.8x 4 + 0.6x 7 x 6 = 2 0.2x 2 0.2x 5 + 0.2x 4 + 0.4x 7 File hw06, version of 4 Jun 203, page 8. Typeset at 4:25 June 2, 203.
UBC M340 Solutions for Problem Set #6 9 All the company s production is now devoted to 5 bookcases and 72 chairs per day; its profit rises to $833. (c) We can express the new requirement that x 3 5x 2 by defining a new slack variable x 8 : x 8 = 5x 2 x 3, with x 8 0. We add this definition to the bottom of our original optimal dictionary, effectively adding x 8 to the list of basic variables. To fit the dictionary, the right side must be expressed using only nonbasic variables. So we calculate x 8 = 5x 2 x 3 = 5x 2 (48 x 2 4x 6 + x 7 ) = 48 + 6x 2 + 4x 6 x 7. Since the new variable has a coefficient of 0 in the cost, there is no impact on the objective function. A dual-feasible dictionary is f = 827 x 2 2x 5 x 6 3x 7 x = 39 x 2 x 5 2x 6 + x 7 x 3 = 48 x 2 4x 6 + x 7 x 4 = 30 + x 2 + x 5 + 5x 6 2x 7 x 8 = 48 + 6x 2 + 4x 6 x 7 Again the Dual Simplex Method is appropriate. Arranging primal feasibility will require x 8 to leave the basis. Notice f + tx 8 = 827 x 2 2x 5 x 6 3x 7 + t ( 48 + 6x 2 + 4x 6 x 7 s) = (827 48t) + (6t )x 2 2x 5 + (4t )x 6 (t + 3)x 7. Here t = /6 is largest choice that maintains dual feasibility. It identifies x 2 as the entering variable. Pivoting leads to f = 89 (/6)x 8 2x 5 (/3)x 6 (9/6)x 7 x = 3 (/6)x 8 x 5 (4/3)x 6 + (5/6)x 7 x 3 = 40 (/6)x 8 (0/3)x 6 + (5/6)x 7 x 4 = 38 + (/6)x 8 + x 5 + (3/3)x 6 (/6)x 7 x 2 = 8 + (/6)x 8 (2/3)x 6 + (/6)x 7 This optimal dictionary reveals a net profit of $89 (which is lower than the $827 we had in the original problem, because new limitations can never improve profits), with a production plan of x = 3 bookcases, x 2 = 8 desks, x 3 = 40 chairs, x 4 = 38 bedframes. File hw06, version of 4 Jun 203, page 9. Typeset at 4:25 June 2, 203.