Exercise 5.7: Minimize J = x + 2*y + 3*z in the first octant subject to y - x >= 0, x + z >= 1.

We introduce two slack variables (s,t), and write the problem in tableau format:

   1  2  3 |  0  0 |  0     min x + 2*y + 3*z
 ----------+-------+----    subject to
  -1  1  0 |  1  0 |  0        -x +   y       + s     = 0
   1  0  1 |  0  1 |  1         x        +  z     + t = 1
The solution we currently have (x,y,z,s,t) = (0,0,0,0,1) is optimal but does not satisfy the original constraints. We have to set the slack variable t to zero. If t has to become zero, we have the choice between x and z to become nonzero. We prefer x to become 1, because x has the smallest coefficient in the objective function. Adding the last row to the second row, and substracting the last row from the first row, we bring the tableau to standard format:
   0  2  2 |  0 -1 | -1     min     2*y + 2*z     - t + 1
 ----------+-------+----    subject to
   0  1  1 |  1  1 |  1               y       + s     = 1 
   1  0  1 |  0  1 |  1         x        +  z     + t = 1
Now we have the solution (x,y,z,s,t) = (1,0,0,1,0), so s changed as well. We now exchange s for y, i.e.: s becomes zero and y becomes one. To bring the tableau to standard form, we subtract the second row twice from the first row:
   0  0  0 | -2 -3 | -3     min               - 2*s - 3*t + 3
 ----------+-------+----    subject to
   0  1  1 |  1  1 |  1               y       +   s       = 1 
   1  0  1 |  0  1 |  1         x        +  z       +   t = 1
So finally, we have the solution (x,y,z,s,t) = (1,1,0,0,0), with value of the objective function 3. We cannot do better, but notice the alternative solution (x,y,z) = (3/4,3/4,1/4), which also yields the value 3.

From the last tableau above we can read off the solution to the dual problem as the (2,3), from the values -2 and -3 in the top row. Solving the dual problem is almost trivial:

   max  0*s + 1*t
   subject to
       -1*s + t <= 1
          s     <= 2
              t <= 3
Notice that (s,t) = (2,3) is the optimal solution. We can find the dual solution to this problem by bringing the tableau in standard form:
    0  1 |  0  0  0 |  0     max      t
  -------+----------+----    subject to
   -1  1 |  1  0  0 |  1         -s + t + x         = 1
    1  0 |  0  1  0 |  2          s         + y     = 2
    0  1 |  0  0  1 |  3            + t         + z = 3
We need to bring the identity matrix to the first two columns, using the ones on the last two rows as pivots. First we add the third row to the second:
    0  1 |  0  0  0 |  0     max      t
  -------+----------+----    subject to
    0  1 |  1  1  0 |  3              t + x + y     = 3 
    1  0 |  0  1  0 |  2          s         + y     = 2
    0  1 |  0  0  1 |  3            + t         + z = 3
Then we subtract the third row from first and second row:
    0  0 |  0  0 -1 | -3     max                 -z + 3 
  -------+----------+----    subject to
    0  0 |  1  1 -1 |  0                  x + y - z = 0 
    1  0 |  0  1  0 |  2          s         + y     = 2
    0  1 |  0  0  1 |  3            + t         + z = 3
The exercise was well worth it, because we discover another solution to the original minimization problem: (x,y,z) = (0,0,1).