%%%%%%%%%%%%%%%%%%%%% CS525 Midterm of March 18, 1999 Answers%%%%%%%%%%%%% >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> %Answer to Question 1 >> A=[1 2 1;2 5 1;3 -1 10];b=[1;3;-5];H=totbl(A,b); x1 x2 x3 1 -------------------------------------------- 0=y1= | 1.0000 2.0000 1.0000 -1.0000 0=y2= | 2.0000 5.0000 1.0000 -3.0000 0=y3= | 3.0000 -1.0000 10.0000 5.0000 >> H=ljx(H,1,1); 0=y1 x2 x3 1 -------------------------------------------- x1= | 1.0000 -2.0000 -1.0000 1.0000 0=y2= | 2.0000 1.0000 -1.0000 -1.0000 0=y3= | 3.0000 -7.0000 7.0000 8.0000 >> H=ljx(H,2,2); 0=y1 0=y2 x3 1 -------------------------------------------- x1= | 5.0000 -2.0000 -3.0000 -1.0000 x2= | -2.0000 1.0000 1.0000 1.0000 0=y3= | 17.0000 -7.0000 0.0000 1.0000 >> %No solution, because whenever y1=0, y2=0, then y3=1. >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> %Answer to Question 2 >> A=[-1 1 -1;2 0 3;-1 2 -1];b=[-2;-3;0];p=[-2;-1;-3];H=totbl(A,b,p); x1 x2 x3 1 -------------------------------------------- x4= | -1.0000 1.0000 -1.0000 2.0000 x5= | 2.0000 0.0000 3.0000 3.0000 x6= | -1.0000 2.0000 -1.0000 -0.0000 -------------------------------------------- z= | -2.0000 -1.0000 -3.0000 0.0000 >> %Feasible undounded problem:z-->-infinity for x1=0,x3=0, x2-->+infinity >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> %Answer to Question 3 >> A=[3 1 -1;1 -1 2;1 2 1];b=[-1 -1 2]';p=[1 3 4]';H=totbl(A,b,p); x1 x2 x3 1 -------------------------------------------- x4= | 3.0000 1.0000 -1.0000 1.0000 x5= | 1.0000 -1.0000 2.0000 1.0000 x6= | 1.0000 2.0000 1.0000 -2.0000 -------------------------------------------- z= | 1.0000 3.0000 4.0000 0.0000 >> %Dual feasible. Use dual simplex. >> H=dualbl(H); u4= u5= u6= w= x1 x2 x3 1 -------------------------------------------- -u1 x4= | 3.0000 1.0000 -1.0000 1.0000 -u2 x5= | 1.0000 -1.0000 2.0000 1.0000 -u3 x6= | 1.0000 2.0000 1.0000 -2.0000 -------------------------------------------- 1 z= | 1.0000 3.0000 4.0000 0.0000 >> H=ljx(H,3,1); u3= u5= u6= w= x6 x2 x3 1 -------------------------------------------- -u1 x4= | 3.0000 -5.0000 -4.0000 7.0000 -u2 x5= | 1.0000 -3.0000 1.0000 3.0000 -u4 x1= | 1.0000 -2.0000 -1.0000 2.0000 -------------------------------------------- 1 z= | 1.0000 1.0000 3.0000 2.0000 >> %Dual/Primal optimal tableau. z_min=w_max=2 at x1=2,x2=x3=0,u1=u2=0, u3=1. >> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> %Answer to Question 4 >> A=[3 2 -1 2;1 1 -1 1 ;-3 -1 1 -2];b=[-2 1 3]';p=[2 1 1 2]'; >> H=totbl(A,b,p); x1 x2 x3=free x4 1 ------------------------------------------------------- x5= | 3.0000 2.0000 -1.0000 2.0000 2.0000 0=x6= | 1.0000 1.0000 -1.0000 1.0000 -1.0000 x7= | -3.0000 -1.0000 1.0000 -2.0000 -3.0000 ------------------------------------------------------- z= | 2.0000 1.0000 1.0000 2.0000 0.0000 >> H=ljx(H,2,3); x1 x2 x6=0 x4 1 ------------------------------------------------------- x5= | 2.0000 1.0000 1.0000 1.0000 3.0000 frx3= | 1.0000 1.0000 -1.0000 1.0000 -1.0000 x7= | -2.0000 0.0000 -1.0000 -1.0000 -4.0000 ------------------------------------------------------- z= | 3.0000 2.0000 -1.0000 3.0000 -1.0000 >> %After deleting column 3 (x6=0) and row 2 (x3=free):Dual feasible >> BUT dual UNBOUNDED tableau. Hence by Strong Duality Theorem, >> the primal problem is infeasible. >> diary off