University math example — dual linear program solved step by step with AI

Example chat · university-level math · read-onlyDeutschBack

Solve this problem!

GPT-5.6 Sol

Note on the problem statement

In the second constraint, the last term appears to be written as 2y2-2y_2 by mistake. Since that coefficient sits in the y4y_4 column, it is very likely that

y1y2y32y43-y_1-y_2-y_3-2y_4\geq -3

was intended. We first solve this intended version. The literal reading with 2y2-2y_2 is given at the end.


1. Conversion to a maximization problem

Multiplying the objective and the constraints by 1-1 yields the equivalent problem

max10y1+6y2+12y3+8y4s.t.2y1+y2+3y3+y44,y1+y2+y3+2y43,y1,y2,y3,y40.\begin{aligned} \max\quad &10y_1+6y_2+12y_3+8y_4\\ \text{s.t.}\quad &2y_1+y_2+3y_3+y_4\leq4,\\ &y_1+y_2+y_3+2y_4\leq3,\\ &y_1,y_2,y_3,y_4\geq0. \end{aligned}

The optimal value of the original minimization problem is the negative of the optimal value of this maximization problem.


2. The dual problem

Each of the two constraints gets a dual variable x1x_1 and x2x_2, respectively. The dual reads

min4x1+3x2s.t.2x1+x210,x1+x26,3x1+x212,x1+2x28,x1,x20.\begin{aligned} \min\quad &4x_1+3x_2\\ \text{s.t.}\quad &2x_1+x_2\geq10,\\ &x_1+x_2\geq6,\\ &3x_1+x_2\geq12,\\ &x_1+2x_2\geq8,\\ &x_1,x_2\geq0. \end{aligned}

The feasible region lies above the drawn lines.

Graphical solution of the dual

The relevant corner points and objective values are

(x1,x2)4x1+3x2(0,12)36(2,6)26(4,2)22(8,0)32\begin{array}{c|c} (x_1,x_2)&4x_1+3x_2\\ \hline (0,12)&36\\ (2,6)&26\\ (4,2)&22\\ (8,0)&32 \end{array}

Hence the optimal dual solution is

x=(4,2)\boxed{x^*=(4,2)}

with optimal value

4x1+3x2=22.\boxed{4x_1^*+3x_2^*=22}.


3. Complementary slackness

Since

x1=4>0,x2=2>0,x_1^*=4>0,\qquad x_2^*=2>0,

both primal constraints must be active:

2y1+y2+3y3+y4=4,y1+y2+y3+2y4=3.\begin{aligned} 2y_1+y_2+3y_3+y_4&=4,\\ y_1+y_2+y_3+2y_4&=3. \end{aligned}

Now consider the slacks of the dual constraints:

2x1+x210=0,x1+x26=0,3x1+x212=2,x1+2x28=0.\begin{aligned} 2x_1^*+x_2^*-10&=0,\\ x_1^*+x_2^*-6&=0,\\ 3x_1^*+x_2^*-12&=2,\\ x_1^*+2x_2^*-8&=0. \end{aligned}

The third dual constraint has positive slack. Complementary slackness therefore implies

y3=0.\boxed{y_3^*=0}.

This leaves the equations

2y1+y2+y4=4,y1+y2+2y4=3.\begin{aligned} 2y_1+y_2+y_4&=4,\\ y_1+y_2+2y_4&=3. \end{aligned}

Setting y4=ty_4=t yields

y1=1+t,y2=23t,y3=0.y_1=1+t,\qquad y_2=2-3t,\qquad y_3=0.

Nonnegativity gives

0t23.0\leq t\leq\frac23.

So there is not just one optimal solution, but a whole line segment of optimal solutions:

y(t)=(1+t,  23t,  0,  t),0t23.\boxed{ y^*(t)= \left(1+t,\;2-3t,\;0,\;t\right), \qquad 0\leq t\leq\frac23 }.
Set of optimal primal solutions in the (y₄,y₂)-plane

For example, one particularly simple solution is

y=(1,2,0,0)\boxed{y^*=(1,2,0,0)}

Its original objective value is

1016212080=22.-10\cdot1-6\cdot2-12\cdot0-8\cdot0=-22.

So for the intended problem statement the result is

min=22.\boxed{\min=-22}.


If 2y2-2y_2 is taken literally

Then the second rewritten constraint becomes

y1+3y2+y33.y_1+3y_2+y_3\leq3.

In particular, the dual then includes

x18.x_1\geq8.

Its optimal solution is

x=(8,0),4x1+3x2=32.x^*=(8,0),\qquad 4x_1^*+3x_2^*=32.

Complementary slackness yields

y=(0,0,0,4),\boxed{y^*=(0,0,0,4)},

and the original minimal objective value under this literal reading would be

min=32.\boxed{\min=-32}.

Alternative under the literal reading with −2y₂
Input disabled in this example. Start your own chat to try it yourself.