6.7. Matrix decomposition exercises#

Exercise 6.1

Using pen and paper, solve the following system of linear equations using LU decomposition.

\[\begin{split}\begin{align*} 2 x_1 + 3 x_2 - x_3 &= 4,\\ 4 x_1 + 9 x_2 - x_3 &= 18,\\ 3 x_2 + 2 x_3 &= 11. \end{align*} \end{split}\]
Solution
\[\begin{split} \begin{align*} L &= \begin{pmatrix} 1 & 0 & 0 \\ 2 & 1 & 0 \\ 0 & 1 & 1 \end{pmatrix}, & U &= \begin{pmatrix} 2 & 3 & -1 \\ 0 & 3 & 1 \\ 0 & 0 & 1 \end{pmatrix}, & \mathbf{x} &= \begin{pmatrix} -2 \\ 3 \\ 1 \end{pmatrix} \end{align*} \end{split}\]

Exercise 6.2

Using pen and paper, solve the following system of linear equations using LU decomposition with partial pivoting.

\[\begin{split} $ \begin{align*} 3 x_2 + 2 x_3 &= 11, \\ 4 x_1 + 9 x_2 - x_3 &= 18,\\ 2 x_1 + 3 x_2 - x_3 &= 4. \end{align*} \end{split}\]

Exercise 6.3

Using pen and paper, solve the following systems of linear equations using Cholesky decomposition.

(a)   \( \begin{align*} 16x_1 +16x_2 +4x_3 &=-8,\\ 16x_1 +25x_2 +10x_3 &=-47,\\ 4x_1 +10x_2 +6x_3 &=-30. \end{align*} \)

(b)   \( \begin{align*} 4x_1 +2x_2 +8x_3 &=36,\\ 2x_1 +17x_2 +20x_3 &=50,\\ 8x_1 +20x_2 +41x_3 &=122. \end{align*} \)


(c)   \( \begin{align*} 9x_1 -9x_2 -6x_4 &=12,\\ -9x_1 +25x_2 +8x_3 -10x_4 &=-116,\\ 8x_2 +8x_3 -2x_4 &=-58,\\ -6x_1 -10x_2 -2x_3 +33x_4 &=91. \end{align*} \)

Exercise 6.4

Using pen and paper, calculate the QR decomposition using the Gram-Schmidt process of the following matrices:

(a)   \( \begin{pmatrix} 1 & 1 \\ -1 & 0 \end{pmatrix}\);

(b)   \(\begin{pmatrix} 6 & 6 & 1 \\ 3 & 6 & 1 \\ 2 & 1 & 1 \end{pmatrix}\);

(c)   \(\begin{pmatrix} 1 & 2 & 1 \\ 1 & 4 & 3 \\ 1 & -4 & 6 \\ 1 & 2 & 1 \end{pmatrix}\).

Exercise 6.5

Using pen and paper, calculate the QR decomposition using the Householder transformations of the following matrices:

(a)   \( \begin{pmatrix} 3 & 0 \\ 4 & 5 \end{pmatrix}\);

(b)   \(\begin{pmatrix} 1 & 2 & 4 \\ 0 & 0 & 5 \\ 0 & 3 & 6 \end{pmatrix}\);

(c)   \(\begin{pmatrix} 2 & -2 & 18 \\ 2 & 1 & 0 \\ 1 & 2 & 0 \end{pmatrix}\).