6.7. Matrix decomposition exercises#
Exercise 6.1
Using pen and paper, solve the following system of linear equations using LU decomposition.
Solution
Exercise 6.2
Using pen and paper, solve the following system of linear equations using LU decomposition with partial pivoting.
Solution
Exercise 6.3
Using pen and paper, solve the following systems of linear equations using Cholesky decomposition.
Solution
Exercise 6.4
Use Python or MATLAB to check your solutions to Exercise 6.1, Exercise 6.2 and Exercise 6.3.
Exercise 6.5
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}\);
Solution
(a) \(Q = \begin{pmatrix} \frac{\sqrt{2}}{2} & \frac{\sqrt{2}}{2} \\ - \frac{\sqrt{2}}{2} & \frac{\sqrt{2}}{2} \end{pmatrix}\), \(R = \begin{pmatrix} \sqrt{2} & \frac{\sqrt{2}}{2} \\ 0 & \frac{\sqrt{2}}{2} \end{pmatrix}\);
(b) \(\begin{pmatrix} 6 & 6 & 1 \\ 3 & 6 & 1 \\ 2 & 1 & 1 \end{pmatrix}\);
Solution
(b) \(Q = \begin{pmatrix} \frac{6}{7} & -\frac{2}{7} & -\frac{3}{7} \\ \frac{3}{7} & \frac{6}{7} & \frac{2}{7} \\ \frac{2}{7} & -\frac{3}{7} & \frac{6}{7} \end{pmatrix}\), \(R = \begin{pmatrix} 7 & 8 & \frac{11}{7} \\ 0 & 3 & \frac{1}{7} \\ 0 & 0 & \frac{5}{7} \end{pmatrix}\);
(c) \(\begin{pmatrix} 1 & 2 & 1 \\ 1 & 4 & 3 \\ 1 & -4 & 6 \\ 1 & 2 & 1 \end{pmatrix}\).
Solution
(c) \(Q = \begin{pmatrix} \frac{1}{2} & \frac{1}{6} & -\frac{\sqrt{18}}{9} \\ \frac{1}{2} & \frac{1}{2} & \frac{\sqrt{18}}{6} \\ \frac{1}{2} & -\frac{5}{6} & \frac{\sqrt{18}}{18} \\ \frac{1}{2} & \frac{1}{6} & -\frac{\sqrt{18}}{9} \end{pmatrix}\) and \(R = \begin{pmatrix} 2 & 2 & \frac{11}{2} \\ 0 & 6 & -\frac{19}{6} \\ 0 & 0 & \frac{11\sqrt{18}}{18} \end{pmatrix}\)
Exercise 6.6
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}\);
Solution
(a) \(Q = \begin{pmatrix} \frac{3}{5} & -\frac{4}{5} \\ \frac{4}{5} & \frac{3}{5} \end{pmatrix}\) and \(R = \begin{pmatrix} 5 & 4 \\ 0 & 3 \end{pmatrix}\)
(b) \(\begin{pmatrix} 1 & 2 & 4 \\ 0 & 0 & 5 \\ 0 & 3 & 6 \end{pmatrix}\);
Solution
(b) \(Q = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 0 & 1 \\ 0 & 1 & 0 \end{pmatrix}\) and \(R = \begin{pmatrix} 1 & 2 & 4 \\ 0 & 3 & 6 \\ 0 & 0 & 5 \end{pmatrix}\)
Exercise 6.7
Use Python or MATLAB to check your solutions to Exercise 6.5 and Exercise 6.6.
6.7.1. Solutions#
The solutions to these exercises downloaded below: