The math optional, made finite. Daily Practice

Duality

At a Glance

Why This Chapter Matters

Every linear program has a paired “dual” problem, and UPSC has tested three distinct uses of that pairing: forming the dual from scratch (2021), solving a problem by working through the dual (2024, 2025), and using complementary slackness to certify that a given basis is not optimal (2019). The questions carry 10–15 marks and are entirely algorithmic — there is no heavy computation, only careful bookkeeping of signs and direction. Mastering the four conversion rules (constraint type → dual variable sign, variable type → dual constraint type) and the two complementary-slackness conditions is sufficient to score full marks.

Minimum Theory

Primal–Dual Correspondence. Given a primal minimisation min  cx\min\; c^\top x subject to AxbAx \ge b, x0x \ge 0, the dual is max  bw\max\; b^\top w subject to AwcA^\top w \le c, w0w \ge 0. The number of dual variables equals the number of primal constraints; the number of dual constraints equals the number of primal variables. The conversion rule for mixed-constraint problems: a \ge-constraint in a Min primal gives a dual variable wi0w_i \ge 0; a \le-constraint gives wi0w_i \le 0; an equality constraint gives wiw_i unrestricted. Symmetrically, a non-negative primal variable xj0x_j \ge 0 gives a cj\le c_j dual constraint, while an unrestricted xjx_j gives a =cj= c_j equality constraint.

Weak and Strong Duality. For any primal-feasible xx and dual-feasible ww, the weak duality inequality cxbwc^\top x \ge b^\top w always holds. At optimality, the strong duality theorem guarantees equality: cx=bwc^\top x^* = b^\top w^*. Consequence: if the dual is infeasible while the primal is feasible, the primal objective is unbounded (no finite optimum).

Complementary Slackness. At optimality, two conditions must hold simultaneously: (i) for each primal variable xjx_j, either xj=0x_j = 0 or the jj-th dual constraint is binding (cjajw=0c_j - a_j^\top w = 0); (ii) for each dual variable wiw_i, either wi=0w_i = 0 or the ii-th primal constraint is binding (aixbi=0a_i^\top x - b_i = 0). These conditions provide an optimality test: given a candidate primal basis, read off the implied ww by setting binding dual constraints to equality; if any remaining dual constraint is violated, the basis is not optimal.

Primal–Dual correspondence, weak/strong duality, and complementary slackness conditions.

Question Archetypes

ArchetypeRecognition
solve-via-dual”solve using duality principle” — dual has two variables, solved graphically
duality-optimality-check”use the dual to verify a basic solution is not optimal”
form-dual”convert to dual” / “write the dual” of a given LPP

solve-via-dual (2 question(s); 2024, 2025)

Recognition Cues — The question phrase is “using the duality principle, solve…” or “apply the principle of duality to solve…”. The primal usually has three or more variables (hard to solve graphically) but only two constraints, so the dual has only two variables and can be solved graphically. Be alert for the case where the dual is infeasible — that signals the primal is unbounded, which is itself the answer.

Solution Template

  1. Write the primal in standard form for duality. For a Min problem with \ge constraints, keep as-is. For a Max problem with \le constraints, keep as-is. For mixed constraints, convert \le to \ge by multiplying by 1-1.
  2. Pair each primal constraint with a dual variable yi0y_i \ge 0, each primal variable with a dual constraint. Write the dual objective and constraints.
  3. Solve the dual (typically a 2-variable LP) graphically: find all vertices of the dual feasible region, evaluate the objective at each, identify the optimum.
  4. If the dual is infeasible, invoke the duality theorem: primal is unbounded. Stop.
  5. Otherwise, at the dual optimum (y1,y2)(y_1^*, y_2^*), apply complementary slackness to recover the primal optimum: a slack dual constraint forces the corresponding primal variable to zero; a positive dual variable forces the corresponding primal constraint to be binding. Solve the resulting system.
  6. Verify: primal objective == dual objective at the recovered solution.

Worked Example(s)

2024 Paper 2, 2024-P2-Q3c (15 marks)

Using the duality principle, solve: minz=4x1+3x2+x3\min z = 4x_1 + 3x_2 + x_3 subject to x1+2x2+4x312x_1 + 2x_2 + 4x_3 \ge 12, 3x1+2x2+x383x_1 + 2x_2 + x_3 \ge 8, x1,x2,x30x_1, x_2, x_3 \ge 0.

Step 1 — Form the dual. Primal is Min with \ge constraints; dual is Max with \le constraints. With dual variables y1,y20y_1, y_2 \ge 0:

max  w=12y1+8y2\max\; w = 12y_1 + 8y_2

subject to:

y1+3y24,2y1+2y23,4y1+y21,y1,y20.y_1 + 3y_2 \le 4, \quad 2y_1 + 2y_2 \le 3, \quad 4y_1 + y_2 \le 1, \quad y_1, y_2 \ge 0.

Step 2 — Solve the dual graphically. The third constraint 4y1+y214y_1 + y_2 \le 1 is the most restrictive. Enumerate vertices of the feasible region:

Maximum of ww is 8 at (y1,y2)=(0,1)(y_1, y_2) = (0, 1).

Step 3 — Recover primal via complementary slackness. By strong duality, minz=maxw=8\min z = \max w = 8.

At (y1,y2)=(0,1)(y_1, y_2) = (0, 1):

x1=0,  x2=0,  x3=8,  zmin=8.\boxed{x_1 = 0,\; x_2 = 0,\; x_3 = 8,\; z_{\min} = 8.}

2025 Paper 2, 2025-P2-Q3c (15 marks)

Apply the principle of duality to solve: Maximize Z=3x1+4x2Z = 3x_1 + 4x_2 subject to x1x21x_1 - x_2 \le 1, x1+x24x_1 + x_2 \ge 4, x13x23x_1 - 3x_2 \le 3, x1,x20x_1, x_2 \ge 0.

Step 1 — Standard form. Multiply the \ge constraint by 1-1:

maxZ=3x1+4x2s.t.x1x21,x1x24,x13x23,x1,x20.\max Z = 3x_1 + 4x_2 \quad\text{s.t.}\quad x_1 - x_2 \le 1,\quad -x_1 - x_2 \le -4,\quad x_1 - 3x_2 \le 3,\quad x_1, x_2 \ge 0.

Step 2 — Write the dual. Dual variables y1,y2,y30y_1, y_2, y_3 \ge 0; dual of a max-\le primal is min-\ge:

min  W=y14y2+3y3\min\; W = y_1 - 4y_2 + 3y_3

subject to:

y1y2+y33,y1y23y34,y1,y2,y30.y_1 - y_2 + y_3 \ge 3, \quad -y_1 - y_2 - 3y_3 \ge 4, \quad y_1, y_2, y_3 \ge 0.

Step 3 — Dual is infeasible. The second dual constraint requires y1y23y34-y_1 - y_2 - 3y_3 \ge 4. Since y1,y2,y30y_1, y_2, y_3 \ge 0, the left side is 0<4\le 0 < 4. No feasible point exists — the dual is infeasible.

Step 4 — Apply duality theorem. The primal is feasible (e.g., (x1,x2)=(0,4)(x_1, x_2) = (0, 4) satisfies all constraints). A feasible primal with an infeasible dual is unbounded.

Confirmation. Take x1=0x_1 = 0, x2=t4x_2 = t \ge 4: constraints t1-t \le 1 ✓, t4-t \le -4 ✓, 3t3-3t \le 3 ✓; objective Z=4tZ = 4t \to \infty.

The primal LP is UNBOUNDED — no finite optimum exists.\boxed{\text{The primal LP is UNBOUNDED — no finite optimum exists.}}

Common Traps

duality-optimality-check (1 question(s); 2019)

Recognition Cues — The question provides a specific basic solution (naming which variables are basic) and asks you to “use the dual” or “verify using the dual” that it is or is not optimal. The primal typically has equality constraints (so dual variables are unrestricted in sign).

Solution Template

  1. Identify the candidate basic variables. Set nonbasic variables to zero and solve for the basic values. Confirm feasibility.
  2. Write the dual. Equality primal constraints → unrestricted dual variables. Inequality constraints → sign-restricted dual variables.
  3. Use complementary slackness: since basic variables >0> 0, their corresponding dual constraints must be binding. Solve this system for the implied dual point ww^*.
  4. Check dual feasibility: verify all remaining dual constraints (for the nonbasic variables) are satisfied at ww^*.
  5. If any dual constraint is violated, the basis is not optimal. State the certificate: which constraint is violated, and what the positive reduced cost is.

Worked Example(s)

2019 Paper 2, 2019-P2-Q4d (10 marks)

Use the dual problem to verify that the basic solution (x1,x2)(x_1, x_2) is not optimal for: maxZ=2x1+4x2+4x33x4\max Z = 2x_1 + 4x_2 + 4x_3 - 3x_4 subject to x1+x2+x3=4x_1 + x_2 + x_3 = 4, x1+4x2+x4=8x_1 + 4x_2 + x_4 = 8, x1,x2,x3,x40x_1, x_2, x_3, x_4 \ge 0.

Step 1 — The candidate basic solution. With x3=x4=0x_3 = x_4 = 0: x1+x2=4x_1 + x_2 = 4, x1+4x2=8x_1 + 4x_2 = 8. Subtract: 3x2=4x2=4/33x_2 = 4 \Rightarrow x_2 = 4/3, x1=8/3x_1 = 8/3. Both positive, so this is a feasible basis with Z=2(8/3)+4(4/3)=32/3Z = 2(8/3) + 4(4/3) = 32/3.

Step 2 — Form the dual. Equality constraints → dual variables w1,w2w_1, w_2 are unrestricted. Dual of a max-equality primal is min-\ge (unrestricted ww):

min  W=4w1+8w2subject to:w1+w22,w1+4w24,w14,w23,w1,w2  free.\min\; W = 4w_1 + 8w_2 \quad \text{subject to:} \quad w_1 + w_2 \ge 2,\quad w_1 + 4w_2 \ge 4,\quad w_1 \ge 4,\quad w_2 \ge -3,\quad w_1, w_2\;\text{free.}

Step 3 — Implied dual point. Basic variables x1>0x_1 > 0 and x2>0x_2 > 0 force their dual constraints to be binding:

w1+w2=2,w1+4w2=4.w_1 + w_2 = 2, \quad w_1 + 4w_2 = 4.

Subtract: 3w2=2w2=2/33w_2 = 2 \Rightarrow w_2 = 2/3, w1=4/3w_1 = 4/3.

Step 4 — Test dual feasibility. Check the nonbasic-variable constraints:

Step 5 — Certificate. The dual solution induced by basis (x1,x2)(x_1, x_2) violates w14w_1 \ge 4. Equivalently, the reduced cost of x3x_3 is cˉ3=c3wa3=44/3=8/3>0\bar{c}_3 = c_3 - w^\top a_3 = 4 - 4/3 = 8/3 > 0 — a positive reduced cost in maximisation means x3x_3 should enter the basis.

The dual solution (w1,w2)=(4/3,2/3) violates w14, so basis (x1,x2) is NOT optimal.\boxed{\text{The dual solution }(w_1, w_2) = (4/3, 2/3)\text{ violates }w_1 \ge 4,\text{ so basis }(x_1, x_2)\text{ is NOT optimal.}}

Common Traps

form-dual (1 question(s); 2021)

Recognition Cues — The question asks to “convert to dual” or “write the dual” of a given LPP. The primal has a mix of \le, \ge, and/or == constraints; some primal variables may be unrestricted. The core task is to apply the conversion table without error.

Solution Template

  1. Identify the primal direction (Min or Max) and list each constraint type (\le, \ge, ==) and each variable type (0\ge 0 or unrestricted).
  2. Apply the conversion table:
Primal (Min)Dual (Max)
bi\ge b_i constraintyi0y_i \ge 0
bi\le b_i constraintyi0y_i \le 0
=bi= b_i constraintyiy_i unrestricted
xj0x_j \ge 0dual constraint cj\le c_j
xjx_j unrestricteddual constraint =cj= c_j
  1. Write the dual objective: max  W=by\max\; W = b^\top y (for a Min primal).
  2. Write one dual constraint per primal variable using the transposed coefficient matrix AA^\top.
  3. State the sign restrictions on each dual variable from step 2.

Worked Example(s)

2021 Paper 2, 2021-P2-Q3c (15 marks)

Convert to dual: min  Z=x13x22x3\min\; Z = x_1 - 3x_2 - 2x_3 subject to 3x1x2+2x373x_1 - x_2 + 2x_3 \le 7, 2x14x2122x_1 - 4x_2 \ge 12, 4x1+3x2+8x3=10-4x_1 + 3x_2 + 8x_3 = 10; x1,x20x_1, x_2 \ge 0, x3x_3 unrestricted.

Step 1 — Constraint types. Constraint 1 is 7\le 7y10y_1 \le 0. Constraint 2 is 12\ge 12y20y_2 \ge 0. Constraint 3 is =10= 10y3y_3 unrestricted.

Step 2 — Variable types. x1,x20x_1, x_2 \ge 0 → dual constraints of the cj\le c_j form. x3x_3 unrestricted → dual constraint of the =cj= c_j form.

Step 3 — Dual objective.

max  W=7y1+12y2+10y3\max\; W = 7y_1 + 12y_2 + 10y_3

Step 4 — Dual constraints (transpose the coefficient columns of AA):

max  W=7y1+12y2+10y3;y10,  y20,  y3  unrestricted;3 constraints as above.\boxed{\max\; W = 7y_1 + 12y_2 + 10y_3;\quad y_1 \le 0,\; y_2 \ge 0,\; y_3\;\text{unrestricted;}\quad \text{3 constraints as above.}}

Common Traps

Marks-Aware Writing

10-mark answer (2019-style duality-optimality-check): (1) Find the basic solution values and state ZZ. (2) Write out the complete dual problem with all constraints and sign conditions. (3) Solve for the implied dual point from the two binding equations. (4) Test every remaining dual constraint; identify the violated one. (5) State the certificate: the dual constraint violated, or equivalently the positive reduced cost. Five clearly labelled steps; no prose needed beyond the conclusion sentence.

15-mark answer (form-dual or solve-via-dual): For form-dual: show the conversion table or state the rules applied; write the dual objective; list all dual constraints with workings for each transposed column; state all sign restrictions on dual variables. For solve-via-dual: form the dual with full justification; enumerate all vertices of the dual feasible region (show feasibility checks); identify the optimum; apply complementary slackness step-by-step to recover each primal variable; verify with the primal objective. Either type needs six to eight lines of algebra clearly laid out.

Practice Set

We've mapped all 13 years of this exam. Get new chapters, tools, and solutions as we release them — free.