The math optional, made finite. Daily Practice

Simplex method (basic)

At a Glance

Why This Chapter Matters

The simplex method appears in 8 of the last 10 years and almost always carries 15 or 20 marks — the second-highest average mark of any T1 Paper 2 atom. More importantly, the algorithm is completely mechanical: every question follows the same four-step sequence (standard form → tableau → pivot until optimal → read the answer). The hard parts are handling special cases — equality constraints, lower-bound shifts, resonance with alternative optima, and reading the dual from the optimal tableau — but each has a fixed rule. Learning those rules is sufficient to score full marks.

Minimum Theory

Standard form and initial basis. A linear programming problem with all \le constraints and non-negative RHS is converted to standard form by adding non-negative slack variables sis_i. The slacks form the initial basis with z=0z=0. If a constraint is ==, add a (non-negative) artificial variable aia_i and use Big-M or Phase-I to drive it to zero. If a variable has a non-zero lower bound xikx_i\ge k, substitute yi=xik0y_i=x_i-k\ge0 before running the simplex.

Pivot rules. At each iteration: the entering variable is the one with the largest positive cjzjc_j-z_j (for maximisation); for minimisation use the largest positive zjcjz_j-c_j. The leaving variable is found by the minimum-ratio test: compute min{RHSi/aij:aij>0}\min\{\text{RHS}_i/a_{ij}:a_{ij}>0\}; the row achieving the minimum exits the basis. Pivot by row-reducing to make the entering column a unit vector.

Termination and special cases. The tableau is optimal when all cjzj0c_j-z_j\le0 (max). If a non-basic variable has cjzj=0c_j-z_j=0 at the optimal tableau, alternative optima exist; do one more pivot on that variable to find the second extreme optimal vertex, then the complete optimal set is their convex combination. The dual optimum yiy_i^* is read directly from the optimal tableau: it equals the cjzjc_j-z_j entry in the column of the ii-th slack variable.

Simplex tableau structure: entering variable (largest c_j-z_j), leaving variable (min-ratio test), dual optimum from slack columns

Question Archetypes

Three patterns cover every simplex question in the corpus.

ArchetypeYou are seeing this when…
simplex-methodstraightforward maximise/minimise with \le constraints; iterate to optimality
simplex-alternative-optima”find all optimal solutions” or “is the optimum unique?“
simplex-with-dual”write the dual” and “read the dual optimum from the optimal table”

simplex-method (5 question(s); 2013×2, 2017, 2019, 2020)

Recognition Cues

Solution Template

  1. Pre-process. For \ge constraints: subtract a surplus variable and add an artificial. For equality constraints: add an artificial. For lower bounds xikx_i\ge k: substitute yi=xiky_i=x_i-k.
  2. Standard form. For \le constraints add slacks si0s_i\ge0. Write the initial tableau with (s1,,sm)(s_1,\ldots,s_m) as the basis.
  3. Compute cjzjc_j-z_j. For the initial tableau (with all-slack basis) cjzj=cjc_j-z_j=-c_j (max) or +cj+c_j (min).
  4. Pivot. Enter: largest positive cjzjc_j-z_j. Leave: min-ratio test (skip non-positive column entries). Update the tableau by row operations.
  5. Repeat until no positive cjzjc_j-z_j remains.
  6. Read the solution. Basic variables = RHS values; non-basic = 0. Compute objective.

Worked Example(s)

2013 Paper 2, 2013-P2-Q1e (10 marks)

Maximize z=2x1+3x25x3z=2x_1+3x_2-5x_3 s.t. x1+x2+x3=7x_1+x_2+x_3=7, 2x15x2+x3102x_1-5x_2+x_3\ge10, xi0x_i\ge0.

Pre-process. The equality x1+x2+x3=7x_1+x_2+x_3=7 eliminates x3=7x1x2x_3=7-x_1-x_2. The \ge constraint becomes x16x23x_1-6x_2\ge3, and x30x_3\ge0 gives x1+x27x_1+x_2\le7. Substituting into the objective yields z=7x1+8x235z'=7x_1+8x_2-35.

Maximise zz'. Both constraints x1+x27x_1+x_2\le7 and x13+6x2x_1\ge3+6x_2 fix x24/7x_2\le4/7; optimum at x2=4/7x_2=4/7, x1=74/7=45/7x_1=7-4/7=45/7, x3=0x_3=0:   zmax=102714.57at(x1,x2,x3)= ⁣(457,47,0).  \boxed{\;z_{\max}=\frac{102}{7}\approx14.57\quad\text{at}\quad(x_1,x_2,x_3)=\!\left(\tfrac{45}{7},\tfrac{4}{7},0\right).\;}


2013 Paper 2, 2013-P2-Q4c (20 marks)

Minimize z=5x14x2+6x38x4z=5x_1-4x_2+6x_3-8x_4 s.t. x1+2x22x3+4x440x_1+2x_2-2x_3+4x_4\le40, 2x1x2+x3+2x482x_1-x_2+x_3+2x_4\le8, 4x12x2+x3x4104x_1-2x_2+x_3-x_4\le10, xi0x_i\ge0.

Standard form. Add slacks s1,s2,s3s_1,s_2,s_3. For minimisation enter the variable with the largest positive zjcj=cjz_j-c_j=-c_j (initial): x4x_4 has zjcj=8z_j-c_j=8.

Iteration 1. x4x_4 enters, min-ratio 8/2=48/2=4 at s2s_2. Pivot.

Iteration 2. x2x_2 enters (next largest zjcjz_j-c_j), min-ratio 24/4=624/4=6 at s1s_1. Pivot.

Check. All zjcj0z_j-c_j\le0: optimal. Note zs2cs2=0z_{s_2}-c_{s_2}=0 (alternative optima along the s2s_2 edge).

  x2=6,  x4=7,  zmin=80.  \boxed{\;x_2=6,\;x_4=7,\;z_{\min}=-80.\;}


2017 Paper 2, 2017-P2-Q3c (20 marks)

Maximize z=3x1+5x2+4x3z=3x_1+5x_2+4x_3 s.t. 2x1+3x282x_1+3x_2\le8, 2x2+5x3102x_2+5x_3\le10, 3x1+2x2+4x3153x_1+2x_2+4x_3\le15, x0x\ge0.

Three iterations. Enter x2x_2 (coeff 5) → s1s_1 leaves (8/38/3 min-ratio). Enter x3x_3s2s_2 leaves (14/1514/15). Enter x1x_1s3s_3 leaves (89/4189/41). All three structural constraints become binding at the optimum.

  x1=8941,  x2=5041,  x3=6241,  zmax=7654118.66.  \boxed{\;x_1=\tfrac{89}{41},\;x_2=\tfrac{50}{41},\;x_3=\tfrac{62}{41},\;z_{\max}=\tfrac{765}{41}\approx18.66.\;}

Keep exact fractions. The denominator 41 arises from the pivot on 41/1541/15 in iteration 2 — the most error-prone step.


2019 Paper 2, 2019-P2-Q3b (15 marks)

Minimize Z=x1+2x23x32x4Z=x_1+2x_2-3x_3-2x_4 s.t. x1+2x23x3+x4=4x_1+2x_2-3x_3+x_4=4, x1+2x2+x3+2x4=4x_1+2x_2+x_3+2x_4=4, xi0x_i\ge0.

Key observation. Subtract the two equations: 4x3+x4=04x_3+x_4=0. Since x3,x40x_3,x_4\ge0, this forces x3=x4=0x_3=x_4=0. The feasible set reduces to x1+2x2=4x_1+2x_2=4 where Z=x1+2x2=4Z=x_1+2x_2=4 (constant). The minimum is 44, achieved at every feasible point, e.g. (0,2,0,0)(0,2,0,0).

  Zmin=4,  e.g. at (0,2,0,0).  \boxed{\;Z_{\min}=4,\;\text{e.g. at }(0,2,0,0).\;}

Do not be lured by the negative cost coefficients 3x3,2x4-3x_3,-2x_4 — those variables are pinned at zero.


2020 Paper 2, 2020-P2-Q3b (15 marks)

Minimize z=6x12x25x3z=-6x_1-2x_2-5x_3 s.t. 2x13x2+x3142x_1-3x_2+x_3\le14, 4x1+4x2+10x346-4x_1+4x_2+10x_3\le46, 2x1+2x24x3372x_1+2x_2-4x_3\le37, x12x_1\ge2, x21x_2\ge1, x33x_3\ge3.

Shift. yi=xikiy_i=x_i-k_i: y1=x12y_1=x_1-2, y2=x21y_2=x_2-1, y3=x33y_3=x_3-3. New constraints: 2y13y2+y3102y_1-3y_2+y_3\le10, 4y1+4y2+10y320-4y_1+4y_2+10y_3\le20, 2y1+2y24y3432y_1+2y_2-4y_3\le43. New objective: maximize z=6y1+2y2+5y3z'=6y_1+2y_2+5y_3 (constant 29-29 absorbed).

Three simplex iterations drive all slacks to zero. Solve the 3×33\times3 binding system: y1=101150,  y2=29825,  y3=13325.y_1=\tfrac{1011}{50},\;y_2=\tfrac{298}{25},\;y_3=\tfrac{133}{25}.

Back-substitute:   x1=11115022.22,  x2=3232512.92,  x3=208258.32,  zmin=501925200.76.  \boxed{\;x_1=\tfrac{1111}{50}\approx22.22,\;x_2=\tfrac{323}{25}\approx12.92,\;x_3=\tfrac{208}{25}\approx8.32,\;z_{\min}=-\tfrac{5019}{25}\approx-200.76.\;}

Common Traps


simplex-alternative-optima (2 question(s); 2014, 2016)

Recognition Cues

Solution Template

  1. Run the simplex to the first optimal tableau.
  2. Check non-basic reduced costs. If any non-basic variable has cjzj=0c_j-z_j=0, alternative optima exist; state this.
  3. Find the second vertex: pivot that non-basic variable into the basis (using the min-ratio test on its column).
  4. Report the segment: all optimal solutions are the convex combination (1t)x(1)+tx(2)(1-t)\mathbf x^{(1)}+t\mathbf x^{(2)} for t[0,1]t\in[0,1].
  5. Uniqueness: if all non-basic reduced costs are strictly negative at optimality, the solution is unique.

Worked Example(s)

2014 Paper 2, 2014-P2-Q4c (20 marks)

Maximize Z=30x1+24x2Z=30x_1+24x_2 s.t. 5x1+4x22005x_1+4x_2\le200, x132x_1\le32, x240x_2\le40, x1,x20x_1,x_2\ge0. Find all optimal solutions.

Iteration 1 (x1x_1 enters, s2s_2 leaves): basis {s1,x1,s3}\{s_1,x_1,s_3\}, Z=960Z=960.

Iteration 2 (x2x_2 enters, s1s_1 leaves): basis {x2,x1,s3}\{x_2,x_1,s_3\}, Z=1200Z=1200.

Optimal tableau reduced costs. s1:6<0s_1: -6<0; s2:0s_2: 0 ← alternative optima!

Pivot s2s_2 in. Min-ratio on s2s_2 column: s3s_3 leaves. New vertex: (x1,x2)=(8,40)(x_1,x_2)=(8,40), Z=1200Z=1200 ✓.

  All optimal solutions: (3224t,  10+30t) for t[0,1];  Zmax=1200.  \boxed{\;\text{All optimal solutions: }(32-24t,\;10+30t)\text{ for }t\in[0,1];\;Z_{\max}=1200.\;}

The entire edge joining (32,10)(32,10) and (8,40)(8,40) is optimal because the objective gradient (30,24)=6(5,4)(30,24)=6(5,4) is parallel to the binding constraint 5x1+4x2=2005x_1+4x_2=200.


2016 Paper 2, 2016-P2-Q2c (20 marks)

Maximize z=2x1+3x2+6x3z=2x_1+3x_2+6x_3 s.t. 2x1+x2+x352x_1+x_2+x_3\le5, 3x2+2x363x_2+2x_3\le6, x0x\ge0. Is the solution unique?

Iteration 1 (x3x_3 enters, s2s_2 leaves). Iteration 2 (x1x_1 enters, s1s_1 leaves).

Optimal. (x1,x2,x3)=(1,0,3)(x_1,x_2,x_3)=(1,0,3), z=20z=20. Non-basic reduced costs: cx2zx2=5.5c_{x_2}-z_{x_2}=-5.5, cs1zs1=1c_{s_1}-z_{s_1}=-1, cs2zs2=2.5c_{s_2}-z_{s_2}=-2.5all strictly negative.

  The optimal solution is unique:  x1=1,  x3=3,  zmax=20.  \boxed{\;\text{The optimal solution is }\textbf{unique}:\;x_1=1,\;x_3=3,\;z_{\max}=20.\;}

Common Traps


simplex-with-dual (2 question(s); 2015, 2022)

Recognition Cues

Solution Template

  1. Solve the primal by simplex to optimality.
  2. Write the dual. For a primal max  cTx\max\;c^Tx s.t. AxbAx\le b, x0x\ge0: dual is min  bTy\min\;b^Ty s.t. ATycA^Ty\ge c, y0y\ge0.
  3. Read dual optimum. In the optimal primal tableau, yi=y_i^*= entry in the cjzjc_j-z_j row at the column of slack sis_i.
  4. Verify strong duality: Zmax=WminZ_{\max}=W_{\min}.
  5. Verify dual feasibility: substitute yy^* into each dual constraint.

Worked Example(s)

2015 Paper 2, 2015-P2-Q4c (20 marks)

Max Z=2x14x2+5x3Z=2x_1-4x_2+5x_3 s.t. x1+4x22x32x_1+4x_2-2x_3\le2, x1+2x2+3x31-x_1+2x_2+3x_3\le1; write dual; read dual optimum.

Simplex (two iterations: x3x_3 enters then x1x_1 enters):

Basisx1x_1x2x_2x3x_3s1s_1s2s_2RHS
x1x_11160328
x3x_3061113
cjzjc_j-z_j066011931

  Zmax=31 at x1=8,  x3=3,  x2=0.  \boxed{\;Z_{\max}=31\text{ at }x_1=8,\;x_3=3,\;x_2=0.\;}

Dual. Min W=2y1+y2W=2y_1+y_2 s.t. y1y22y_1-y_2\ge2, 4y1+2y244y_1+2y_2\ge-4, 2y1+3y25-2y_1+3y_2\ge5, y1,y20y_1,y_2\ge0.

Dual optimum from cjzjc_j-z_j row at slack columns. y1=11y_1^*=11 (at s1s_1), y2=9y_2^*=9 (at s2s_2). W=2(11)+9=31=ZmaxW=2(11)+9=31=Z_{\max} ✓.


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

Max Z=x1+x2+x3Z=x_1+x_2+x_3 s.t. 2x1+x2+x322x_1+x_2+x_3\le2, 4x1+2x2+x324x_1+2x_2+x_3\le2, x0x\ge0; write dual; read dual optimum.

Simplex (three degenerate pivots ending with x3=2x_3=2 basic):

  Zmax=2 at x3=2,  x1=x2=0.  \boxed{\;Z_{\max}=2\text{ at }x_3=2,\;x_1=x_2=0.\;}

Dual. Min W=2y1+2y2W=2y_1+2y_2 s.t. 2y1+4y212y_1+4y_2\ge1, y1+2y21y_1+2y_2\ge1, y1+y21y_1+y_2\ge1, y0y\ge0.

Dual optimum. From optimal cjzjc_j-z_j row: y1=1y_1^*=1, y2=0y_2^*=0. W=2(1)+2(0)=2=ZmaxW=2(1)+2(0)=2=Z_{\max} ✓.

Common Traps


Marks-Aware Writing

10-mark questions (2013-Q1e): One to two sentences of strategy, then eliminate the equality and solve the 2-variable LPP. Box the answer and verify all constraints.

15-mark questions (2019, 2020, 2022): Full tableau with three iterations shown. Each iteration: entering variable (with justification), min-ratio test (table), pivot result. Final answer in a box. One verification row.

20-mark questions (2013-Q4c, 2014, 2015, 2016, 2017): Show every pivot in a labelled tableau. For the dual: write the dual formulation explicitly (objective + all constraints), then read yiy_i^* and state the strong-duality verification. For alternative optima: find both vertices, state the segment.

Practice Set

YearPaper/QMarksArchetypeOne-line hint
2022P2-Q3c15simplex-with-dualTwo pivots; degenerate (RHS=0) at one step; dual y1=1,y2=0y_1^*=1,y_2^*=0 from slack columns
2020P2-Q3b15simplex-methodShift xikx_i\ge k first; three binding constraints at optimum; exact fractions
2019P2-Q3b15simplex-methodSubtract equations to get 4x3+x4=04x_3+x_4=0; Z4Z\equiv4 on entire feasible set
2017P2-Q3c20simplex-methodThree iterations; denominator-41 fractions at optimum; all constraints binding
2016P2-Q2c20simplex-alternative-optimaAll non-basic cjzj<0c_j-z_j<0 at optimum; unique; verify by computing all three
2015P2-Q4c20simplex-with-dualTwo iterations; dual y1=11,y2=9y_1=11, y_2=9 from cjzjc_j-z_j at s1,s2s_1,s_2 columns
2014P2-Q4c20simplex-alternative-optimacs2zs2=0c_{s_2}-z_{s_2}=0 at optimum; one more pivot gives second vertex (8,40)(8,40); segment
2013P2-Q4c20simplex-methodTwo pivots: x4x_4 in/s2s_2 out, then x2x_2 in/s1s_1 out; min not max
2013P2-Q1e10simplex-methodEquality eliminates x3x_3; reduced 2-var LPP; corner at x2=4/7x_2=4/7

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