Consider the quadratic function $\mathbf{\frac{1}{2}x^TGx+b^Tx}$ in four variables where $$\mathbf{G}=
\begin{bmatrix} 2 & -1 & 0 & 0 \\ -1 & 2 & -1 & 0 \\ 0 & -1 & 2 & -1 \\ 0 & 0 & -1 & 2 \end{bmatrix}$$
and $\mathbf{b}=(-1,0,2,\sqrt{5})^T$. Apply the conjugate gradient method to this problem from $\mathbf{x_0=0}$ and show that it converges in two iterations. Verify that there are just two independent vectors in the sequence $\mathbf{g_0,Gg_0,G^2g_0,\dots}$.