>> %%%%%%%%%%%%%%CS525 Midterm Solutions October 22, 1998%%%%%%%%%%%%% >> %Answer to Question 1: >> A=[1 2 -1;-1 -1 0;2 3 -1];b=[1 -2 -1]'; >> H=totbl(A,b); x1 x2 x3 1 -------------------------------------------- 0=y1= | 1.0000 2.0000 -1.0000 -1.0000 0=y2= | -1.0000 -1.0000 0.0000 2.0000 0=y3= | 2.0000 3.0000 -1.0000 1.0000 >> H=ljx(H,1,1); y1=0 x2 x3 1 -------------------------------------------- x1= | 1.0000 -2.0000 1.0000 1.0000 0=y2= | -1.0000 1.0000 -1.0000 1.0000 0=y3= | 2.0000 -1.0000 1.0000 3.0000 >> H=ljx(H,2,2); y1=0 y2=0 x3 1 -------------------------------------------- x1= | -1.0000 -2.0000 -1.0000 3.0000 x2= | 1.0000 1.0000 1.0000 -1.0000 0=y3= | 1.0000 -1.0000 0.0000 4.0000 >> %No solution, because whenever y1=0, y2=0, then y3=4. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> %Answer to Question 2: >> A=[1 1 1 -1;-13 -3 2 1;-2 4 3 -1];b=[-1 -2 -3]';p=[-5 2 -1 1]'; >> H=totbl(A,b,p); x1 x2 x3 x4 1 ------------------------------------------------------- x5= | 1.0000 1.0000 1.0000 -1.0000 1.0000 x6= | -13.0000 -3.0000 2.0000 1.0000 2.0000 x7= | -2.0000 4.0000 3.0000 -1.0000 3.0000 ------------------------------------------------------- z= | -5.0000 2.0000 -1.0000 1.0000 0.0000 >> %Feasible unbounded tableau, because z-->-infinity for x1=x2=x4=0,x3-->infinity >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> %Answer to Question 3: >> A=[3 -1 3;-2 1 -1;7 -2 3];b=[1 -1 1]';p=[3 -1 2]'; >> H=totbl(A,b,p); x1 x2free x3 1 -------------------------------------------- x4= | 3.0000 -1.0000 3.0000 -1.0000 0=x5= | -2.0000 1.0000 -1.0000 1.0000 x6= | 7.0000 -2.0000 3.0000 -1.0000 -------------------------------------------- z= | 3.0000 -1.0000 2.0000 0.0000 >> H=ljx(H,2,2); x1 x5=0 x3 1 -------------------------------------------- x4= | 1.0000 -1.0000 2.0000 0.0000 frx2= | 2.0000 1.0000 1.0000 -1.0000 x6= | 3.0000 -2.0000 1.0000 1.0000 -------------------------------------------- z= | 1.0000 -1.0000 1.0000 1.0000 >> %Optimal tableau AFTER deleting column 2 (x5=0) and row 2 (x2=free) >> %zmin=1 at x1=0,x2=-1,x3=0. >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> %Answer to Question 4 >> A=[1 1 1;0 -1 1;-1 -1 -2];b=[-2 1 -1]';p=[1 2 1]'; >> H=totbl(A,b,p); x1 x2 x3 1 -------------------------------------------- x4= | 1.0000 1.0000 1.0000 2.0000 x5= | 0.0000 -1.0000 1.0000 -1.0000 x6= | -1.0000 -1.0000 -2.0000 1.0000 -------------------------------------------- z= | 1.0000 2.0000 1.0000 0.0000 >> %Dual feasible. Use dual simplex. >> H=dualbl(H); u4= u5= u6= w= x1 x2 x3 1 -------------------------------------------- -u1 x4= | 1.0000 1.0000 1.0000 2.0000 -u2 x5= | 0.0000 -1.0000 1.0000 -1.0000 -u3 x6= | -1.0000 -1.0000 -2.0000 1.0000 -------------------------------------------- 1 z= | 1.0000 2.0000 1.0000 0.0000 >> H=ljx(H,2,3); u4= u5= u2= w= x1 x2 x5 1 -------------------------------------------- -u1 x4= | 1.0000 2.0000 1.0000 3.0000 -u6 x3= | -0.0000 1.0000 1.0000 1.0000 -u3 x6= | -1.0000 -3.0000 -2.0000 -1.0000 -------------------------------------------- 1 z= | 1.0000 3.0000 1.0000 1.0000 >> %Dual feasible but unbounded: w-->infinity for u1=u6=0, u3-->infinity. >> %Hence by Strong Duality Theorem: original primal is infeasible;or >> %from primal tableau labels: x1>=0, x2>=0, x5>=0 implies x6 =< -1. >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%