Lab X2: Supplementary Practice Problems
These are similar to programming problems you may encounter in the
mid-terms. They are not graded but we will review them in lab sessions.
For these questions, you should try to solve the problem manually first
(or at least detail out the steps if the algebra is too horrible), then
use scipy.linalg
package routine(s) to solve.
1. Write down the full-matrix, block matrix and outer product forms
of the SVD using \(\LaTeX\) in a markdown cell.
2. Let
\[ \begin{align}\begin{aligned}\begin{split} u = \begin{bmatrix}
1 \\
2 \\
3
\end{bmatrix}\end{split}\\Find a non-zero vector :math:`v` that is orthogonal to :math:`u`, and\end{aligned}\end{align} \]
another non-zero vector \(w\) that is orthogonal to both \(u\)
and \(v\). Construct an orthogonal matrix \(Q\) using the unit
versions of \(u, v, w\). What is the inverse of \(Q\)?
3. Find a basis for the 4 fundamental spaces of \(A\), where
\[ \begin{align}\begin{aligned}\begin{split} A = \begin{bmatrix}
1 & 2 & 3 & 3 \\
2 & 0 & 6 & 2 \\
3 & 4 & 9 & 7
\end{bmatrix}\end{split}\\State the dimension of each basis, and the dimension of the space of\end{aligned}\end{align} \]
the basis vectors.
4. Find the projection of
\[ \begin{align}\begin{aligned}\begin{split} b = \begin{bmatrix}
3 \\
2 \\
1
\end{bmatrix}\end{split}\\on the column space of :math:`A` by using the projection matrix, where\end{aligned}\end{align} \]
\[\begin{split}A = \begin{bmatrix}
1 & 2 & 3 & 3 \\
2 & 0 & 6 & 2 \\
3 & 4 & 9 & 7
\end{bmatrix}\end{split}\]
5. What is the inverse of
\[\begin{split}A = \begin{bmatrix}
0 & 0 & 0 & 1 \\
0 & 0 & 1 & 0 \\
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0
\end{bmatrix}\end{split}\]
6. Find the eigenvalues and eigenvectors of \(A^TA\), and find
an eigendecomposition of \(A^TA = V \Lambda V^T\). Finally,
construct the SVD of \(A\) and use it to generate \(A\)
\[\begin{split}A = \begin{bmatrix}
1 & 2 & 3 & 3 \\
2 & 0 & 6 & 11 \\
3 & 4 & 9 & 7 \\
4 & 4 & 4 & 4
\end{bmatrix}\end{split}\]
7. Find an orthogonal basis and the QR decomposition for
\[\begin{split}A = \begin{bmatrix}
1 & 2 & 0 \\
1 & 0 & 2 \\
0 & 1 & 2
\end{bmatrix}\end{split}\]
8. Solve the following problem
\[ \begin{align}\begin{aligned}\begin{split} \begin{bmatrix}
1 & 2 & 3 & 3 \\
2 & 0 & 6 & 11 \\
3 & 4 & 9 & 7 \\
4 & 4 & 4 & 4
\end{bmatrix} \begin{bmatrix}
x_1 \\
x_2 \\
x_3 \\
x_4
\end{bmatrix} = \begin{bmatrix}
4 \\
3 \\
2 \\
1
\end{bmatrix}\end{split}\\using the following factorizations - Gaussian elimination - LU - LDU -\end{aligned}\end{align} \]
QR - SVD
9. Let \(A\) be the plane spanned by the vectors
\[ \begin{align}\begin{aligned}\begin{split} v_1
\begin{bmatrix}
1 \\
0 \\
1 \\
0
\end{bmatrix}, v_2 = \begin{bmatrix}
1 \\
2 \\
3 \\
4
\end{bmatrix}\end{split}\\What is the point on the plane nearest to the vectors :math:`b_1` and\end{aligned}\end{align} \]
\(b_2\).
\[ \begin{align}\begin{aligned}\begin{split} b_1 = \begin{bmatrix}
3 \\
2 \\
5 \\
4
\end{bmatrix}, b_2 = \begin{bmatrix}
3 \\
2 \\
0 \\
4
\end{bmatrix}\end{split}\\Find the orthogonal distance from :math:`b_1` and :math:`b_2` to its\end{aligned}\end{align} \]
nearest point.
10. Let
\[ \begin{align}\begin{aligned}\begin{split} A = \begin{bmatrix}
1 & 2 & 3 & 3 \\
2 & 0 & 6 & 2 \\
3 & 4 & 9 & 7 \\
4 & 4 & 4 & 4
\end{bmatrix}\end{split}\\- What is the rank of :math:`A` - What is the condition number of\end{aligned}\end{align} \]
\(A\)? - What is the best rank-1 and rank-2 approximation of
\(A\)? - What is the distance between \(A\) and the best rank-1
and rank-2 approximation of \(A\) using the Frobenius norm?