Exam 2 Rev SOL
Exam 2 Rev SOL
1. Prove the weak duality theorem: For any x feasible for the primal and y feasible for the
dual, then...
HINT: Consider the quantity yT Ax.
SOLUTION: To use the hint, start with a feasible point in the primal and the dual.
Then we know the following two equations are satisfied:
Ax ≤ b AT y ≥ c
In the first expression, multiply both sides by yT (this is OK since we assume x, y ≥ 0).
Multiply the second expression by xT .
yT Ax ≤ yT b and xT A T y ≥ xT c
cT x ≤ yT Ax ≤ bT y
2. Show that the solution to the dual is y = (cTB B −1 )T (if the primal and dual are both
feasible).
w = yT b = cTB B −1 b = z
since we have an optimal tableau for the primal.
x1 x2 a1 s2 s3 rhs x1 x2 a1 s2 s3 rhs
−5 1 M 0 0 0 −5 − 2M 1 − M 0 0 0 −6M
2 1 1 0 0 6 → 2 1 1 0 0 6
1 1 0 1 0 4 1 1 0 1 0 4
0 1 0 0 1 3 0 1 0 0 1 3
1
Pivot in column 1, row 1:
x1 x2 a1 s2 s3 rhs
5
0 7/2 2
+ M 0 0 15
1 1/2 1/2 0 0 3
0 1/2 −1/2 1 0 1
0 1 0 0 1 3
4. Solve the last problem again using the two phase method.
In two-phase, here is our initial tableau:
x1 x2 a1 s2 s3 rhs x1 x2 a1 s2 s3 rhs
0 0 1 0 0 0 −2 −1 0 0 0 −6
2 1 1 0 0 6 → 2 1 1 0 0 6
1 1 0 1 0 4 1 1 0 1 0 4
0 1 0 0 1 3 0 1 0 0 1 3
x1 x 2 a1 s2 s3 rhs x1 x2 a1 s2 s3 rhs
5
0 7/2 2
+ M 0 0 15 0 0 1 0 0 0
1 1/2 1/2 0 0 3 → 1 1/2 1/2 0 0 3
0 1/2 −1/2 1 0 1 0 1/2 −1/2 1 0 1
0 1 0 0 1 3 0 1 0 0 1 3
End of Phase I. Now we have a feasible point, we can bring in our original Row 0 (and
remove the artificial variable). We perform the row operations to maintain our columns
of the identity.
x1 x2 s2 s3 rhs x1 x2 s2 s3 rhs
−5 1 0 0 0 0 7/2 0 0 15
1 1/2 0 0 3 → 1 1/2 0 0 3
0 1/2 1 0 1 0 1/2 1 0 1
0 1 0 1 3 0 1 0 1 3
5. Use the simplex algorithm to get a tableau that is suitable for the dual simplex algorithm.
In doing so, show that the problem is infeasible, but the dual is feasible.
min z = −3x1 + x2
st x1 − 2x2 ≥ 2
−x1 + x2 ≥ 3
x1 , x2 ≥ 0
SOLUTION: Writing this with columns of the identity in mind, we would get the tableau
on the left, below. To get this in the form for the dual simplex, Row 0 needs to be all
2
non-negative. So, pivot in the first column:
x1 x2 e1 e2 rhs x1 x2 e1 e2 rhs
−3 1 0 0 0 0 −2 0 3 −9
⇒
−1 2 1 0 −2 0 1 1 1 −5
1 −1 0 1 −3 1 −1 0 1 −3
x1 x2 e1 e2 rhs
0 0 2 5 −19
0 1 1 1 −5
1 0 1 2 −8
This is now feasible for the dual, but not feasible for the primal. However, we cannot
pivot anywhere, so the primal remains infeasible.
Find Row 0.
SOLUTION: Row 0 coefficients are given by
The columns in the tableau are already the columns for B −1 A, so we can use them.
Here are the Row zero coefficients:
x1 x2 s1 e2 a2 a3 rhs
0 0 0 1 −1 + M 3/2 + M 9/2
0 0 1 0 0 − 12 1
2
0 1 0 −2 2 − 32 3
2
1 0 0 1 −1 1 1
3
7. Give an argument why, if the primal is unbounded, then the dual must be infeasible.
SOLUTION:
Suppose the dual was feasible. Then there exists a y that satisfies the constraints for
the dual. But in that case, for every x in the primal,
cT x ≤ bT y
But we said that the primal was unbounded, so that cT x → ∞. This is a contradiction-
Thus, the dual must be infeasible.
(a) If we add a new constraint, is it possible that we can increase z? Why or why not?
SOLUTION: Since the feasible set decreases (that is, the new feasible set is a subset
of the original feasible set), then the value of z must either decrease or stay the
same, since the current solution is over a larger set.
(b) If we add the constraint 3x1 + x2 ≤ 10, is the current basis still optimal?
SOLUTION: If we add an extra constraint, the set of feasible points is reduced.
Therefore, if the optimal solution satisfies this constraint, then we’re done (we’re
not adding new points).
In this case, the solution is x1 = 3, x2 = 0 and the constraint is satisfied (and the
current solution remains optimal).
(c) If we add the constraint x1 − x2 ≥ 6, we can quickly see that the optimal solution
changes. Find out if we have a new optimal solution or if we have made the problem
infeasible.
SOLUTION: If the optimal solution does not satisfy the constraint (as in this case),
then we either have a new optimal solution or no feasible points. Let’s add in this
constraint into the tableau and see if it can be incorporated into it.
Adding the constraint adds a new row and column:
x1 x2 s 1 s2 e3 rhs x1 x2 s 1 s2 e3 rhs
0 2 0 3 0 18 0 2 0 3 0 18
0 1/2 1 −1/2 0 2 0 1/2 1 −1/2 0 2
1 1/2 0 1/2 0 3 1 1/2 0 1/2 0 3
−1 1 0 0 1 −6 0 3/2 0 1/2 1 −3
4
whether we have a new optimal solution or if we have made the problem infeasible.
First eliminate x1 as we did before:
x1 x2 s 1 s2 s3 rhs x 1 x2 s 1 s2 s3 rhs
0 2 0 3 0 18 0 2 0 3 0 18
0 1/2 1 −1/2 0 2 −8R2 +R3 → R3 0 1/2 1 −1/2 0 2
1 1/2 0 1/2 0 3 1 1/2 0 1/2 0 3
8 1 0 0 1 12 0 −3 0 −4 1 −12
We pivot using the dual simplex to try to make the solution feasible. Using the
ratio test, pivot in the x2 column:
x1 x2 s 1 s2 s3 rhs
0 0 0 1/3 2/3 10
0 0 1 −7/6 1/6 0
1 0 0 −1/6 1/6 1
0 1 0 4/3 −1/3 4
And now we’re feasible and optimal again! (Notice that z decreased).
(e) If I add a new variable x3 so that:
max z = 6x1 + x2 + x3
st x1 + x2 + 2x3 ≤ 5
2x1 + x2 + x3 ≤ 6
x1 , x2 ≥ 0
Does the current basis stay optimal? Answer two ways- One using the optimal
tableau, and the second using the dual.
SOLUTION:
• Using the optimal tableau, we “price out” the new variable. The new column
will be B −1 a3 , or
1 −1/2 2 3/2
=
0 1/2 1 1/2
The new Row 0 value will be −c3 + cTB B −1 a3 . Notice that the order given in
the optimal tableau for the basic variables is {s1 , x1 }, so cTB = [0, 6]:
3/2
−1 + [0, 6] = −1 + 3 = 2 > 0
1/2
• Using the dual, the addition of the new variable adds a new constraint to the
dual:
2y1 + y2 ≥ 1
with the current dual being y1 = 0, y2 = 3. In this case, the new constraint is
satisfied, so the dual remains optimal (and so does the primal).
5
9. Solve the following “mixed constraint” problem using a combination of the simplex and
the dual simplex.
min z = −x1 +x2
st −x1 +x2 ≤ 3
x2 ≥ 6
2x1 +x2 ≤ 18
SOLUTION: Change to a max, then multiply the second row by −1 to get the tableau:
x1 x2 s1 e2 s3
−1 1 0 0 0 0
−1 1 1 0 0 3
0 −1 0 1 0 −6
2 1 0 0 1 18
We use the regular simplex method first- pivot on the “2” in the lower left:
x1 x2 s 1 e 2 s 3
0 3/2 0 0 1/2 9
0 3/2 1 0 1/2 12
0 −1 0 1 0 −6
1 1/2 0 0 1/2 9
Now we perform one iteration of the dual simplex method- We use Row 2, then column
x2 :
x1 x2 s1 e2 s3
0 0 0 3/2 1/2 0
0 0 1 3/2 1/2 3
0 1 0 −1 0 6
1 0 0 1/2 1/2 6
We are now optimal: x1 = x2 = 6, with z = 0.
Side Remark: What is the solution to the dual? On the one hand, it looks like y =
[0, 3/2, 1/2]T . We can verify that using w, but be careful- In order for our theory to
work out, the problem needed to be in “normal form”, so we would actually need to
multiply the first and last constraints by −1. In that case, w = −3y1 + 6y2 − 18y3 , and
our y values work.
On the other hand, if we use our shortcuts to build the dual from the mixed constraints,
then we get w = 3y1 + 6y2 + 18y3 , where y1 , y3 are negative. From the optimal Row 0,
we would then need to multiply y1 , y3 by −1 to get the solution to the dual.
10. The Complementary Slackness Theorem says, among other things, that sj yj = 0. If
sj > 0, why should yj = 0? (Explain in words)
SOLUTION: In the normal form, if sj > 0, then the j th constraint has unused resources
(the slack is what is still available). Therefore, it doesn’t matter if we add more resources,
since we’re not using what we have. The shadow price (and therefore also yj ) is then 0.
11. Be able to prove that each of our “shortcut formulas” for sensitivity analysis works.
6
• Change in a NBV
SOLUTION: We’ll only prove the formula that doesn’t use the dual. In that case,
the only change to the initial Row 0 is in c so that the new Row 0 is:
This means that the only thing that changes is in the ith position, and there we
take the old ith coefficient from Row 0 and subtract ∆.
• Change in a BV
SOLUTION: We’ll assume the BV has coordinate i in the initial Row 0, and has
coordinate j in cB . Then the change is given by:
Expanding this,
(−cT + cTB B −1 A) − ∆~eTi + ∆(B −1 A)j
where the first term is Row 0 from the final tableau, and the last term is the j th
row of the final tableau. The middle term only effects the BV in the ith position,
so if we say that the BVs sum to zero, we can drop the middle term and take the
sum for the NBVs.
• Change in RHS
SOLUTION: The RHS of the table changes from b to b + ∆~ei so that the RHS of
the final tableau becomes
B −1 (b + ∆~ei ) = B −1 b + ∆(B −1 )i
And we might notice that this last expression is the constraint from dual (except
for the “=”): yT ai ≥ ci
• Adding a new “activity” (column).
SOLUTION: Basically the exact same computations as in the previous problem.
7
(a) Write out the dual.
min w = y1 +y2 +3y3
st y1 +y3 ≥2
y2 +y3 ≥2
y1 +y2 +2y3 ≥0
y1 −y2 ≥0
y≥0
(b) Show that x∗ = [1, 1, 0, 0]T and y∗ = [1, 1, 1]T are feasible for the original and dual
problems, respectively.
SOLUTION: With the expectation of needing the values of the slacks, we put x∗
into the primal and y∗ into the constraints of the dual:
x1 x2 x3 x4 s 1 s 2 s 3
1 1 0 0 0 0 1
e1 e2 e3 e4 y1 y2 y3
0 0 4 0 1 1 1
(c) Show that for this pair of solutions, if x∗j > 0 then the corresponding slack in the
dual is 0.
SOLUTION: Yes- check the table from the previous answer.
(d) Show that y∗ is not an optimal solution to the dual.
SOLUTION: Notice if we compute z, w, we know that something is off, but we
don’t know if the problem is with the primal or the dual.
If we look at the solution to the first part, we see that the variables xi satisfy the
Complementary Slackness conditions (xi ei = 0), but that y does not- The problem
therefore, must be with the dual.
Given s3 > 0 from the primal, then y3 = 0. Keeping e1 = e2 = e4 = 0, we see that
y1 = y2 = 2, and that would given z = w = 4.
Therefore, y = [1, 1, 1]T was not optimal for the dual.
(e) Does this contradict the Complementary Slackness Theorem?
13. Prove or disprove using Complementary Slackness: The point x = [0, 3, 0, 0, 4]T is an
optimal solution to the LP:
SOLUTION: This is similar to the last one. We can fill in the values of the slack variables
as well:
x1 x2 x3 x4 x5 s 1 s 2
0 3 0 0 4 0 0
e1 e2 e3 e4 e5 y1 y2
8
We know that e2 , e5 both must be zero:
y1 − 2y2 = 4
⇒ y1 = 6, y2 = 1
2y1 + 3y2 = 15
e1 = 2 e2 = 0 e3 = 3 e4 = −1 e5 = 0
So this y (derived from the solution to the primal) is infeasible. Thus, x from the primal
is NOT the optimal solution.