All 10 questions UPSC has asked on duality in linear programming in the Mathematics Optional (Paper II, Linear Programming) from 2008 to 2026, solved step by step – latest first.
Try them yourself first: the same questions, without solutions, are on our Linear Programming topic-wise PYQs page.
How we check these solutions
These are our own solutions, prepared with AI help. UPSC does not publish official answers. Every solution is checked a second way before it goes up, and says how:
- ✓ Checked by computer the answer was worked out again independently with a linear-programming solver (SciPy/HiGHS), with the simplex tables recomputed in exact fractions.
- ✓ Proof checked step by step for “prove that” questions, every step was checked against the definitions.
Spotted a mistake or a neater method? Tell us in the comments below or through Report an error.
Jump to a question (year · question number):
2026 · 1e 2025 · 3c 2024 · 3c 2022 · 3c 2021 · 3c 2019 · 4d 2015 · 4c 2011 · 4c 2010 · 1f 2008 · 1f
Solve the dual problem of the following linear programming problem by the graphical method : Minimize subject to the constraints :
Solution
The problem has 4 variables but only 2 constraints, so its dual has 2 variables and can be drawn.
Dual. With dual variables for the two constraints: subject to
Graphical solution. Draw the four lines , , , . The feasible region is the polygon on the origin side of all four lines, in the first quadrant. Its corner points come from intersecting neighbouring lines:
| Corner | Lines meeting | |
|---|---|---|
| axes | ||
| , | ||
| , | ||
| , | ||
| , | ||
| , |
So the dual optimum is at .
Back to the original problem. By the duality theorem, . Complementary slackness gives the primal solution:
- At , and , so and .
- , so both primal constraints hold with equality: and .
Hence and
✓ Checked by computer We checked by computer: an LP solver gives at for the dual and for the original problem.
Apply the principle of duality to solve the following linear programming problem : Maximize subject to the constraints
Solution
Primal in standard (≤) form. Write as :
Dual. With dual variables :
The dual is infeasible. For the left side is , so it can never be . The dual has no feasible solution.
Consequence for the primal. By the duality theorem, if the dual is infeasible, the primal is either infeasible or unbounded. The primal is feasible: e.g. satisfies , , . Hence the primal has an unbounded solution: has no finite maximum.
(Directly: along , , all constraints hold and .)
✓ Checked by computer We checked by computer: an LP solver reports the primal unbounded, and the dual has no feasible point.
Using duality principle, solve the following linear programming problem : Minimize subject to
Solution
Dual. The primal is a minimisation with constraints, so its dual (variables ) is This has only constraints, so the simplex method starts directly with slacks .
Initial table — enters (most negative ), leaves (least ratio); pivot in bold.
| Basis | cB | xB | y1 | y2 | s1 | s2 | s3 | Ratio |
|---|---|---|---|---|---|---|---|---|
| cj | 12 | 8 | 0 | 0 | 0 | |||
| s1 | 0 | 4 | 1 | 3 | 1 | 0 | 0 | 4 |
| s2 | 0 | 3 | 2 | 2 | 0 | 1 | 0 | 3/2 |
| s3 | 0 | 1 | 4 | 1 | 0 | 0 | 1 | 1/4 |
| Δj | 0 | −12 | −8 | 0 | 0 | 0 |
Table 2 — enters (most negative ), leaves (least ratio); pivot in bold.
| Basis | cB | xB | y1 | y2 | s1 | s2 | s3 | Ratio |
|---|---|---|---|---|---|---|---|---|
| cj | 12 | 8 | 0 | 0 | 0 | |||
| s1 | 0 | 15/4 | 0 | 11/4 | 1 | 0 | −1/4 | 15/11 |
| s2 | 0 | 5/2 | 0 | 3/2 | 0 | 1 | −1/2 | 5/3 |
| y1 | 12 | 1/4 | 1 | 1/4 | 0 | 0 | 1/4 | 1 |
| Δj | 3 | 0 | −5 | 0 | 0 | 3 |
Table 3 — all , so this table is optimal.
| Basis | cB | xB | y1 | y2 | s1 | s2 | s3 |
|---|---|---|---|---|---|---|---|
| cj | 12 | 8 | 0 | 0 | 0 | ||
| s1 | 0 | 1 | −11 | 0 | 1 | 0 | −3 |
| s2 | 0 | 1 | −6 | 0 | 0 | 1 | −2 |
| y2 | 8 | 1 | 4 | 1 | 0 | 0 | 1 |
| Δj | 8 | 20 | 0 | 0 | 0 | 8 |
Dual optimum: , .
Primal solution from the final table. The optimal primal values are the in the slack columns of the dual’s optimal table: So , at . (Check: , , .)
✓ Checked by computer We checked by computer: an LP solver gives at , and at for the dual.
Solve the following linear programming problem by the simplex method. Write its dual. Also, write the optimal solution of the dual from the optimal table of the given problem : Maximize subject to
Solution
Add slacks : . When several tie, we take the first.
Initial table — enters (most negative ), leaves (least ratio); pivot in bold.
| Basis | cB | xB | x1 | x2 | x3 | s1 | s2 | Ratio |
|---|---|---|---|---|---|---|---|---|
| cj | 1 | 1 | 1 | 0 | 0 | |||
| s1 | 0 | 2 | 2 | 1 | 1 | 1 | 0 | 1 |
| s2 | 0 | 2 | 4 | 2 | 1 | 0 | 1 | 1/2 |
| Δj | 0 | −1 | −1 | −1 | 0 | 0 |
Table 2 — enters (most negative ), leaves (least ratio); pivot in bold.
| Basis | cB | xB | x1 | x2 | x3 | s1 | s2 | Ratio |
|---|---|---|---|---|---|---|---|---|
| cj | 1 | 1 | 1 | 0 | 0 | |||
| s1 | 0 | 1 | 0 | 0 | 1/2 | 1 | −1/2 | 2 |
| x1 | 1 | 1/2 | 1 | 1/2 | 1/4 | 0 | 1/4 | 2 |
| Δj | 1/2 | 0 | −1/2 | −3/4 | 0 | 1/4 |
Table 3 — enters (most negative ), leaves (least ratio); pivot in bold.
| Basis | cB | xB | x1 | x2 | x3 | s1 | s2 | Ratio |
|---|---|---|---|---|---|---|---|---|
| cj | 1 | 1 | 1 | 0 | 0 | |||
| x3 | 1 | 2 | 0 | 0 | 1 | 2 | −1 | – |
| x1 | 1 | 0 | 1 | 1/2 | 0 | −1/2 | 1/2 | 0 |
| Δj | 2 | 0 | −1/2 | 0 | 3/2 | −1/2 |
Table 4 — all , so this table is optimal.
| Basis | cB | xB | x1 | x2 | x3 | s1 | s2 |
|---|---|---|---|---|---|---|---|
| cj | 1 | 1 | 1 | 0 | 0 | ||
| x3 | 1 | 2 | 0 | 0 | 1 | 2 | −1 |
| x2 | 1 | 0 | 2 | 1 | 0 | −1 | 1 |
| Δj | 2 | 1 | 0 | 0 | 1 | 0 |
Optimal solution: , . (The basic variable is zero, so this solution is degenerate. It is still the only optimum: from the second constraint, , with equality only at .)
Dual. With dual variables : subject to
Dual solution from the optimal table. The optimal dual values are the of the starting slack columns: , . Then , as the duality theorem requires.
✓ Checked by computer We checked by computer: an LP solver gives at and for the dual.
Convert the following LPP into dual LPP : Minimize subject to where , and is unrestricted in sign.
Solution
Put the primal in canonical form. For a minimisation, write every inequality as . Multiply the first constraint by :
Rules.
- One dual variable per constraint: for the two constraints, and unrestricted for the equation.
- One dual constraint per primal variable: “” for , and “” for the unrestricted .
- The dual maximises, with the right-hand sides as costs.
Dual LPP. (The third constraint has no term because does not appear in the second primal constraint.)
✓ Proof checked step by step Formulation checked line by line against the primal–dual rules.
Consider the following LPP, Maximize subject to and Use the dual problem to verify that the basic solution is not optimal.
Solution
The basic solution. With basic and :
Dual. Both primal constraints are equations, so the dual variables are unrestricted:
Dual solution matching the basis. For a basis to be optimal, the corresponding dual solution must be dual feasible. Since are basic, their dual constraints hold with equality: Check the other dual constraints:
- : ? No — this constraint is violated.
- : , which holds.
The dual solution is not feasible: its -constraint fails, i.e. . So the basic solution is not optimal; bringing into the basis increases .
(Indeed the optimum is , with . Its dual is feasible, and .)
✓ Checked by computer We checked by computer: the dual values violate , and an LP solver gives the true optimum at .
Solve the following linear programming problem by the simplex method. Write its dual. Also, write the optimal solution of the dual from the optimal table of the given problem :
Solution
Add slacks : .
Initial table — enters (most negative ), leaves (least ratio); pivot in bold.
| Basis | cB | xB | x1 | x2 | x3 | s1 | s2 | Ratio |
|---|---|---|---|---|---|---|---|---|
| cj | 2 | −4 | 5 | 0 | 0 | |||
| s1 | 0 | 2 | 1 | 4 | −2 | 1 | 0 | – |
| s2 | 0 | 1 | −1 | 2 | 3 | 0 | 1 | 1/3 |
| Δj | 0 | −2 | 4 | −5 | 0 | 0 |
Table 2 — enters (most negative ), leaves (least ratio); pivot in bold.
| Basis | cB | xB | x1 | x2 | x3 | s1 | s2 | Ratio |
|---|---|---|---|---|---|---|---|---|
| cj | 2 | −4 | 5 | 0 | 0 | |||
| s1 | 0 | 8/3 | 1/3 | 16/3 | 0 | 1 | 2/3 | 8 |
| x3 | 5 | 1/3 | −1/3 | 2/3 | 1 | 0 | 1/3 | – |
| Δj | 5/3 | −11/3 | 22/3 | 0 | 0 | 5/3 |
Table 3 — all , so this table is optimal.
| Basis | cB | xB | x1 | x2 | x3 | s1 | s2 |
|---|---|---|---|---|---|---|---|
| cj | 2 | −4 | 5 | 0 | 0 | ||
| x1 | 2 | 8 | 1 | 16 | 0 | 3 | 2 |
| x3 | 5 | 3 | 0 | 6 | 1 | 1 | 1 |
| Δj | 31 | 0 | 66 | 0 | 11 | 9 |
Optimal solution: , .
Dual. With dual variables : subject to
Dual solution from the optimal table. The dual values are the under the starting slack columns: , . Then (Check: , , .)
✓ Checked by computer We checked by computer: an LP solver gives at and at for the dual.
Write down the dual of the following LP problem and hence solve it by graphical method : Minimize, Constraints,
Solution
Dual. With dual variables :
Graphical solution of the dual. Draw (intercepts , ) and (intercepts , ). The feasible region is the quadrilateral with corners:
| Corner | Lines meeting | |
|---|---|---|
| axes | ||
| , | ||
| , | ||
| , |
, attained at both and , and along the edge joining them (the objective is parallel to ).
Primal solution. By duality, . Use complementary slackness at the dual optimum :
- , so both primal constraints are tight: and .
- Solving gives .
- The second dual constraint is tight there, but at it is slack (), which also forces .
So , at .
✓ Checked by computer We checked by computer: an LP solver gives for the dual and at for the primal.
Construct the dual of the primal problem : Maximize , subject to the constraints , , , and .
Solution
Canonical form. For a maximisation, write each inequality as . Multiply the first constraint by :
Dual. Take for the inequality, and unrestricted for the two equations. Each gives a “” dual constraint:
✓ Proof checked step by step Formulation checked line by line against the primal–dual rules.
Find the dual of the following linear programming problem: Max. such that
Solution
Canonical form. For a maximisation, write inequalities as . Multiply the third constraint by :
Dual. Take for the inequalities and unrestricted for the equation:
✓ Proof checked step by step Formulation checked line by line against the primal–dual rules.
More on Linear Programming
- Linear Programming topic-wise PYQs (questions only, for practice)
- Mathematics PYQ analysis: which units carry the marks year by year
- Year-wise question papers
- Mathematics booklist
Questions: UPSC Civil Services (Main) Examination, Mathematics Paper II, 2008–2026. Solutions: Optional Province. Found an error? Tell us.

