← 2026 Paper 2

UPSC 2026 Maths Optional Paper 2 Q1e — Step-by-Step Solution

10 marks · Section A

Duality · Linear Programming · asked 5× in 14 yrs · Read the full method →

Question

Solve the dual problem of the following linear programming problem by the graphical method:

Minimize Y=10y1+6y2+2y3+y4Y = 10y_1 + 6y_2 + 2y_3 + y_4

subject to the constraints:

y1+y2+y3+y4≥2y_1 + y_2 + y_3 + y_4 \geq 2 2y1+y2−y3−2y4≥12y_1 + y_2 - y_3 - 2y_4 \geq 1 y1, y2, y3, y4≥0y_1,\, y_2,\, y_3,\, y_4 \geq 0

Technique

The printed problem has four variables, so it cannot be drawn; but it has only two constraints, so its dual has two variables and can be drawn. That asymmetry is the entire point of the question — the examiner is testing whether the candidate sees that dualising is a device for reducing dimension, not a formality. The printed problem is already in canonical minimisation form (min⁡cTy\min c^{T}y, Ay≥bAy\ge b, y≥0y\ge0), whose dual is the maximisation max⁡bTx\max b^{T}x, ATx≤cA^{T}x\le c, x≥0x\ge0: four ≤\le constraints in two non-negative variables, solved by the corner-point method. Finally, since the question is posed about the printed primal, a complete answer returns from the dual to the primal by strong duality (Y∗=Z∗Y^{*}=Z^{*}) and complementary slackness (which recovers y∗y^{*} itself).

Solution

Step 1 — Put the printed problem in canonical form and name the data.

The printed (primal) problem is

(P)min⁡ Y=cTys.t.Ay ≥ b,y≥0,\text{(P)}\qquad \min\ Y=c^{T}y \quad\text{s.t.}\quad Ay\ \ge\ b,\qquad y\ge 0,

with

c=(10621),A=(111121−1−2),b=(21),y=(y1y2y3y4).c=\begin{pmatrix}10\\6\\2\\1\end{pmatrix},\qquad A=\begin{pmatrix}1&1&1&1\\[2pt]2&1&-1&-2\end{pmatrix},\qquad b=\begin{pmatrix}2\\1\end{pmatrix},\qquad y=\begin{pmatrix}y_1\\y_2\\y_3\\y_4\end{pmatrix}.

It is a minimisation with all constraints ≥\ge and all variables ≥0\ge0 — i.e. already in the canonical form for which the duality rules apply directly, with no need to reverse any inequality or split any variable.

Step 2 — Construct the dual, and derive it rather than merely quote it.

Assign a dual variable x1≥0x_1\ge0 to the first constraint and x2≥0x_2\ge0 to the second. Multiplying the constraints by these non-negative numbers preserves the inequalities; adding,

x1(y1+y2+y3+y4)+x2(2y1+y2−y3−2y4) ≥ 2x1+x2.x_1\big(y_1+y_2+y_3+y_4\big)+x_2\big(2y_1+y_2-y_3-2y_4\big)\ \ge\ 2x_1+x_2 .

Regroup the left side by columns of AA, i.e. by the yjy_j:

y1(x1+2x2)+y2(x1+x2)+y3(x1−x2)+y4(x1−2x2) ≥ 2x1+x2.y_1(x_1+2x_2)+y_2(x_1+x_2)+y_3(x_1-x_2)+y_4(x_1-2x_2)\ \ge\ 2x_1+x_2 .

Now if the coefficient of each yjy_j is held below the corresponding cost cjc_j, then since every yj≥0y_j\ge0 the left side is at most 10y1+6y2+2y3+y4=Y10y_1+6y_2+2y_3+y_4=Y, and we obtain the bound Y≥2x1+x2Y\ge 2x_1+x_2. This forces exactly the following requirements, and gives weak duality for free:

(D)max⁡ Z=2x1+x2\text{(D)}\qquad \max\ Z=2x_1+x_2 subject toL1:x1+2x2 ≤ 10(from the y1 column)L2:x1+  x2 ≤ 6(from the y2 column)L3:x1−  x2 ≤ 2(from the y3 column)L4:x1−2x2 ≤ 1(from the y4 column)x1, x2 ≥ 0.\text{subject to}\qquad \begin{aligned} L_1:&\quad x_1+2x_2\ \le\ 10 &&(\text{from the } y_1\text{ column})\\ L_2:&\quad x_1+\ \ x_2\ \le\ 6 &&(\text{from the } y_2\text{ column})\\ L_3:&\quad x_1-\ \ x_2\ \le\ 2 &&(\text{from the } y_3\text{ column})\\ L_4:&\quad x_1-2x_2\ \le\ 1 &&(\text{from the } y_4\text{ column})\\ &\quad x_1,\ x_2\ \ge\ 0 . \end{aligned}

Equivalently, in matrix form, max⁡bTx\max b^{T}x subject to ATx≤cA^{T}x\le c, x≥0x\ge0 — the rows of ATA^{T} being the columns of AA, and the cost vector of the dual being the right-hand side bb of the primal.

(Recorded for Step 7: the derivation above proves Z≤YZ\le Y for every feasible pair (x,y)(x,y) — weak duality — so any feasible xx with Z=YZ=Y for some feasible yy certifies optimality of both.)

(D) has two variables and is what the question asks us to solve graphically.

Step 3 — The graph: what to draw.

Work in the first quadrant of the (x1,x2)(x_1,x_2)-plane, 0≤x1≤110\le x_1\le 11, 0≤x2≤60\le x_2\le 6. Draw each constraint as its boundary line and shade the side containing the origin (the origin satisfies all four, since 0≤10, 0≤6, 0≤2, 0≤10\le10,\,0\le6,\,0\le2,\,0\le1):

LineEquationTwo convenient points to joinHalf-plane retained
L1L_1x1+2x2=10x_1+2x_2=10(10,0)(10,0) and (0,5)(0,5)below/left (origin side)
L2L_2x1+x2=6x_1+x_2=6(6,0)(6,0) and (0,6)(0,6)below/left (origin side)
L3L_3x1−x2=2x_1-x_2=2(2,0)(2,0) and (4,2)(4,2)above/left (origin side)
L4L_4x1−2x2=1x_1-2x_2=1(1,0)(1,0) and (3,1)(3,1)above/left (origin side)

(L3L_3 and L4L_4 meet the x2x_2-axis at (0,−2)(0,-2) and (0,−12)(0,-\tfrac12), outside the quadrant, so plot each through the two first-quadrant points listed.)

The feasible region is the convex polygon

O(0,0) → E(1,0) → D(3,1) → C(4,2) → B(2,4) → A(0,5) → O,O(0,0)\ \to\ E(1,0)\ \to\ D(3,1)\ \to\ C(4,2)\ \to\ B(2,4)\ \to\ A(0,5)\ \to\ O,

traversed anticlockwise, whose six edges lie on x2=0x_2=0 (from OO to EE), L4L_4 (EE to DD), L3L_3 (DD to CC), L2L_2 (CC to BB), L1L_1 (BB to AA) and x1=0x_1=0 (AA to OO). Every constraint supports an edge, so no constraint is redundant. The region is non-empty (it contains OO) and bounded (it lies in 0≤x1≤60\le x_1\le6, 0≤x2≤50\le x_2\le5), so by the fundamental theorem of linear programming an optimal solution exists and is attained at a vertex.

Finally superimpose one iso-profit line 2x1+x2=k2x_1+x_2=k, e.g. k=6k=6 through (3,0)(3,0) and (0,6)(0,6), of slope −2-2, and translate it parallel to itself away from the origin; label the last vertex it touches.

Graphical solution of the dual in the (x_1,x_2)-plane, window 0\le x_1\le 10.5, 0\le x_2\le 6.5. The four constraint boundaries are drawn right across the window and labelled: L_1: x_1+2x_2=10 (blue, through (10,0) and (0,5)); L_2: x_1+x_2=6 (red, through (6,0) and (0,6)); L_3: x_1-x_2=2 (green, through (2,0) and (4,2)); and L_4: x_1-2x_2=1 (orange, through (1,0) and (3,1)) — the last two have negative x_2-intercepts and are plotted through their first-quadrant points. The feasible region is the shaded convex hexagon O(0,0)\to E(1,0)\to D(3,1)\to C(4,2)\to B(2,4)\to A(0,5)\to O, whose six edges lie on x_2=0, L_4, L_3, L_2, L_1 and x_1=0 respectively, so every constraint supports exactly one edge and none is redundant. Each vertex carries a dot and its coordinates with the objective value: O(0,0), Z=0; E(1,0), Z=2; D(3,1), Z=7; C(4,2), Z^*=10 (max); B(2,4), Z=8; A(0,5), Z=5. Two iso-profit lines of slope -2 are superimposed: the dashed line 2x_1+x_2=6 through (3,0) and (0,6), with an arrow normal to it pointing away from the origin in the direction of increasing Z; and the bold line 2x_1+x_2=10 drawn from (5,0) to (2,6), which meets the region at the single point C(4,2) and nowhere else. No edge of the hexagon has slope -2, which is why that contact is a single point and the optimum is unique.

Step 4 — Corner points: intersect the boundary lines in pairs and test feasibility.

With the two axes written as L5:x1=0L_5:x_1=0 and L6:x2=0L_6:x_2=0, there are (62)=15\binom{6}{2}=15 pairs. No two of the six lines are parallel, so each pair meets in exactly one point.

LinesPoint (x1,x2)(x_1,x_2)Feasible? (reason if not)Z=2x1+x2Z=2x_1+x_2
L1∩L2L_1\cap L_2(2, 4)(2,\,4)yes88
L1∩L3L_1\cap L_3(143, 83)\left(\tfrac{14}{3},\,\tfrac{8}{3}\right)no — L2L_2: 223>6\tfrac{22}{3}>6—
L1∩L4L_1\cap L_4(112, 94)\left(\tfrac{11}{2},\,\tfrac94\right)no — L2L_2: 314>6\tfrac{31}{4}>6—
L1∩L5L_1\cap L_5(0, 5)(0,\,5)yes55
L1∩L6L_1\cap L_6(10, 0)(10,\,0)no — L4L_4: 10>110>1—
L2∩L3L_2\cap L_3(4, 2)(4,\,2)yes10\mathbf{10}
L2∩L4L_2\cap L_4(133, 53)\left(\tfrac{13}{3},\,\tfrac53\right)no — L3L_3: 83>2\tfrac83>2—
L2∩L5L_2\cap L_5(0, 6)(0,\,6)no — L1L_1: 12>1012>10—
L2∩L6L_2\cap L_6(6, 0)(6,\,0)no — L4L_4: 6>16>1—
L3∩L4L_3\cap L_4(3, 1)(3,\,1)yes77
L3∩L5L_3\cap L_5(0, −2)(0,\,-2)no — x2<0x_2<0—
L3∩L6L_3\cap L_6(2, 0)(2,\,0)no — L4L_4: 2>12>1—
L4∩L5L_4\cap L_5(0, −12)\left(0,\,-\tfrac12\right)no — x2<0x_2<0—
L4∩L6L_4\cap L_6(1, 0)(1,\,0)yes22
L5∩L6L_5\cap L_6(0, 0)(0,\,0)yes00

Sample verification of the two decisive rows:

Step 5 — Read off the optimum.

Vertex(x1,x2)(x_1,x_2)Z=2x1+x2Z=2x_1+x_2
OO(0,0)(0,0)00
EE(1,0)(1,0)22
DD(3,1)(3,1)77
CC(4,2)(4,2)10 ← max⁡\mathbf{10}\ \leftarrow\ \max
BB(2,4)(2,4)88
AA(0,5)(0,5)55
 Dual optimum: x1∗=4,x2∗=2,Z∗=10. \boxed{\ \text{Dual optimum: } x_1^{*}=4,\quad x_2^{*}=2,\quad Z^{*}=10 .\ }

Uniqueness. At C=(4,2)C=(4,2) the binding constraints are L2L_2 (outward normal (1,1)(1,1)) and L3L_3 (outward normal (1,−1)(1,-1)). Solving

(2,1)=α(1,1)+β(1,−1) ⟹ α+β=2,  α−β=1 ⟹ α=32,  β=12,(2,1)=\alpha(1,1)+\beta(1,-1)\ \Longrightarrow\ \alpha+\beta=2,\ \ \alpha-\beta=1\ \Longrightarrow\ \alpha=\tfrac32,\ \ \beta=\tfrac12,

the objective gradient (2,1)(2,1) lies strictly inside the cone spanned by the two normals (α,β>0\alpha,\beta>0), i.e. the iso-profit line of slope −2-2 is parallel to neither edge CBCB (slope −1-1) nor edge DCDC (slope +1+1). Hence the maximum is attained at the single point CC: the dual optimum is unique, and there is no alternate optimal solution.

Step 6 — What solving the dual buys us about the printed problem: strong duality.

First check that the printed problem is feasible: y=(2,0,0,0)y=(2,0,0,0) gives 2≥22\ge2 ✓ and 4≥14\ge1 ✓. Both (P) and (D) are feasible, so by the strong duality theorem both have finite optima and

Y∗=Z∗=10.Y^{*}=Z^{*}=10 .

Step 7 — Recover the optimal yy by complementary slackness.

The complementary slackness conditions for the pair (P)–(D) are:

  1. xi∗>0 ⟹x_i^{*}>0\ \Longrightarrow the ii-th primal constraint is tight at y∗y^{*};
  2. the jj-th dual constraint slack at x∗ ⟹ yj∗=0x^{*}\ \Longrightarrow\ y_j^{*}=0.

Evaluate the dual slacks at x∗=(4,2)x^{*}=(4,2):

jjdual constraintvalue at (4,2)(4,2)RHS cjc_jslack cj−(ATx∗)jc_j-(A^{T}x^{*})_jconclusion
11x1+2x2x_1+2x_28810102>02>0 (slack)y1∗=0y_1^{*}=0
22x1+x2x_1+x_2666600 (tight)y2∗y_2^{*} unrestricted by CS
33x1−x2x_1-x_2222200 (tight)y3∗y_3^{*} unrestricted by CS
44x1−2x2x_1-2x_200111>01>0 (slack)y4∗=0y_4^{*}=0

And since x1∗=4>0x_1^{*}=4>0 and x2∗=2>0x_2^{*}=2>0, both primal constraints are tight:

y1+y2+y3+y4=2,2y1+y2−y3−2y4=1.y_1+y_2+y_3+y_4=2,\qquad 2y_1+y_2-y_3-2y_4=1 .

Substituting y1=y4=0y_1=y_4=0:

y2+y3=2,y2−y3=1⟹y2=32,  y3=12,y_2+y_3=2,\qquad y_2-y_3=1\quad\Longrightarrow\quad y_2=\frac32,\ \ y_3=\frac12 ,

both non-negative, hence feasible. Therefore

y∗=(0, 32, 12, 0),Y∗=10(0)+6 ⁣(32)+2 ⁣(12)+1(0)=9+1=10.y^{*}=\left(0,\ \tfrac32,\ \tfrac12,\ 0\right),\qquad Y^{*}=10(0)+6\!\left(\tfrac32\right)+2\!\left(\tfrac12\right)+1(0)=9+1=10 .

Y∗=10=Z∗Y^{*}=10=Z^{*}, which by the weak-duality bound of Step 2 certifies that y∗y^{*} is optimal for (P) and x∗x^{*} optimal for (D) — no further argument is needed.

Uniqueness of y∗y^{*}. Since x∗x^{*} is the unique dual optimum (Step 5), every primal optimal yy must satisfy complementary slackness against this x∗x^{*}; that forces y1=y4=0y_1=y_4=0 and both primal equalities, a system with the unique solution above. Hence the printed problem also has a unique optimal solution.

Cross-check on the multipliers. The numbers α=32\alpha=\tfrac32, β=12\beta=\tfrac12 found in the uniqueness argument of Step 5 are the multipliers of the binding dual constraints L2,L3L_2,L_3 — and they are exactly y2∗=32y_2^{*}=\tfrac32, y3∗=12y_3^{*}=\tfrac12. The graphical picture therefore already contained the primal solution: the shadow prices of the binding lines at the optimal corner are the optimal primal variables. ■\qquad\blacksquare

Answer

  Dual:  max⁡Z=2x1+x2  s.t. x1+2x2≤10, x1+x2≤6, x1−x2≤2, x1−2x2≤1, x1,x2≥0.  \boxed{\;\textbf{Dual: }\ \max Z=2x_1+x_2 \ \text{ s.t. } x_1+2x_2\le10,\ x_1+x_2\le6,\ x_1-x_2\le2,\ x_1-2x_2\le1,\ x_1,x_2\ge0.\;}   Graphical solution of the dual: x∗=(x1∗,x2∗)=(4, 2),Z∗=10(unique, at L2∩L3).  \boxed{\;\textbf{Graphical solution of the dual: } x^{*}=(x_1^{*},x_2^{*})=(4,\,2),\qquad Z^{*}=10\quad(\text{unique, at } L_2\cap L_3).\;}   Hence for the printed primal: Y∗=Z∗=10  at  y∗=(0, 32, 12, 0) (unique), by strong duality and complementary slackness.  \boxed{\;\textbf{Hence for the printed primal: } Y^{*}=Z^{*}=10\ \text{ at }\ y^{*}=\left(0,\ \tfrac32,\ \tfrac12,\ 0\right)\ \text{(unique), by strong duality and complementary slackness.}\;}
We post more of this — worked solutions, CSAT trap breakdowns, guide chapters — a few times a week on Telegram. Free, no sign-in. Join

This solution is part of the Maths Coverage Map — 14 years, mapped. Get the take-away PDF free.