Minimise f(x)=12x⊤Ax−b⊤x with A=(4113), b=(1,2)⊤ and x0=0 using the conjugate gradient method. How do you show that it reaches the exact minimiser in two steps, and why does this happen?

Linear algebra and optimisation, Iterative solvers
Level L4 Advanced. Length Long. Nature Mat Mathematical.

What's being asked

Whether you can run the conjugate gradient recurrences by hand and explain finite termination using A-conjugate directions.

Key idea

Conjugate gradient uses search directions with di⊤Adj=0 (i≠j), so each step fully removes the error along one direction. In n dimensions it terminates in at most n steps (exact arithmetic).

Steps

  1. Start: the residual is r0=b−Ax0=(1,2), the same as the negative gradient, and the first direction is d0=r0=(1,2).
  2. Step 1: Ad0=(4+2, 1+6)=(6,7), d0⊤Ad0=6+14=20, r0⊤r0=5. The step size is α0=r0⊤r0d0⊤Ad0=520=14. Then x1=14(1,2)=(0.25,0.5) and r1=r0−α0Ad0=(1−1.5, 2−1.75)=(−0.5,0.25).
  3. Make the next direction conjugate: β0=r1⊤r1r0⊤r0=0.31255=0.0625, so d1=r1+β0d0=(−0.4375, 0.375)=(−716,38).
  4. Check conjugacy: d1⊤Ad0=(−716)(6)+38(7)=−4216+4216=0.
  5. Step 2: d1⊤Ad1=5564 and r1⊤r1=516, so α1=5/1655/64=411. Then x2=(0.25,0.5)+411(−716,38)=(111,711).
  6. Check: Ax2=(411+711, 111+2111)=(1,2)=b. So r2=0 and x2 is the exact minimiser. Steepest descent with exact line search would zig-zag and not finish in two steps.
  7. Why: the n conjugate directions form a basis, so x⋆−x0=∑icidi. Each step fixes one coefficient exactly, and later steps do not undo it. For large problems we stop early, and the error falls like (κ−1κ+1)k, where κ is the condition number.

Common mistakes

How long your answer should be

One page; 6–8 minutes.

Last checked on 4 December 2026.

Read this

Previous in Linear algebra and optimisation: For least-squares linear regression f(w)=12n∥Xw−y∥22, how does the condition number of X⊤X govern the convergence speed of gradient descent, and why does standardising features speed up gradient descent even though it leaves the closed-form predictions unchanged?
Next in Linear algebra and optimisation: Let f be convex and L-smooth, with minimiser x∗. How do you prove that gradient descent with step size 1/L satisfies f(xT)−f(x∗)≤L∥x0−x∗∥22T?