Skip to main content
Contents
Dark Mode Prev Up Next
\(\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\dimens}{\operatorname{dim}}
\DeclareMathOperator{\row}{\operatorname{row}}
\DeclareMathOperator{\col}{\operatorname{col}}
\newcommand{\im}{\operatorname{im}}
\newcommand{\nulls}{\operatorname{null}}
\newcommand{\minor}{\operatorname{minor}}
\newcommand{\spans}{\operatorname{span}}
\newcommand{\nullity}{\operatorname{nullity}}
\newcommand{\kers}{\operatorname{ker}}
\newcommand{\proj}{\operatorname{proj}}
\newcommand{\diag}{\operatorname{diag}}
\newcommand{\Tr}{\operatorname{Tr}}
\newcommand{\rank}{\operatorname{rank}}
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\definecolor{fillinmathshade}{gray}{0.9}
\newcommand{\fillinmath}[1]{\mathchoice{\colorbox{fillinmathshade}{$\displaystyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\textstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptstyle \phantom{\,#1\,}$}}{\colorbox{fillinmathshade}{$\scriptscriptstyle\phantom{\,#1\,}$}}}
\)
Section 5.8 Exercises
Learning outcomes. The labels below identify the learning outcomes for each exercise group. Individual problems may also involve earlier outcomes.
Subsection Symmetric matrices and orthogonal diagonalization
Learning outcomes. U5-LO3.
Subsection Hessians and critical-point classification
Learning outcomes. U3-LO9, U5-LO5.
OpenStax 4.7 #319 openstax.org/books/calculus-volume-3/pages/4-7-maxima-minima-problems
OpenStax 4.7 #323 openstax.org/books/calculus-volume-3/pages/4-7-maxima-minima-problems
Subsection Additional exercises
These exercises connect eigenvectors, quadratic forms, Hessian eigenvalues, least squares, residual checks, fixed nonlinear features, and code interpretation. Solutions are collected in Appendix
C.5 .
Additional exercise 5.8.1 . Eigenvectors as special directions.
Let
\begin{equation*}
A=
\begin{bmatrix}
3\amp1\\
0\amp2
\end{bmatrix},
\qquad
\mathbf{v}_1=
\begin{bmatrix}
1\\
0
\end{bmatrix},
\qquad
\mathbf{v}_2=
\begin{bmatrix}
-1\\
1
\end{bmatrix}.
\end{equation*}
Compute
\(A\mathbf{v}_1\text{.}\)
Compute
\(A\mathbf{v}_2\text{.}\)
Identify the eigenvalue for each eigenvector.
Explain what the matrix map does to these two special directions.
Learning outcomes. U5-LO1.
Additional exercise 5.8.2 . Diagonalization and matrix powers.
Let
\begin{equation*}
A=
\begin{bmatrix}
2\amp1\\
0\amp3
\end{bmatrix},
\qquad
P=
\begin{bmatrix}
1\amp1\\
0\amp1
\end{bmatrix},
\qquad
D=
\begin{bmatrix}
2\amp0\\
0\amp3
\end{bmatrix}.
\end{equation*}
Verify that the columns of
\(P\) are eigenvectors of
\(A\text{,}\) and identify their eigenvalues.
Compute
\(P^{-1}\) and verify that
\(A=PDP^{-1}\text{.}\)
Use
\(A^k=PD^kP^{-1}\) to derive a formula for
\(A^k\text{.}\)
Explain why diagonalization makes repeated matrix actions easier to compute.
Learning outcomes. U5-LO1, U5-LO2.
Additional exercise 5.8.3 . Quadratic form and definiteness.
Additional exercise 5.8.4 . Hessian eigenvalue classification.
Suppose
\(\mathbf{a}\) is a critical point of a scalar-valued function
\(f\text{.}\) For each possible list of Hessian eigenvalues, classify the critical point as a local minimum, local maximum, saddle point, or inconclusive.
Explain why the zero eigenvalue case is different.
Learning outcomes. U5-LO5.
Additional exercise 5.8.5 . Least squares from gradients.
Let
\begin{equation*}
A=
\begin{bmatrix}
1\amp0\\
1\amp1\\
1\amp2
\end{bmatrix},
\qquad
\mathbf{b}=
\begin{bmatrix}
1\\
2\\
2
\end{bmatrix}.
\end{equation*}
Define
\begin{equation*}
h(\mathbf{x})=\|A\mathbf{x}-\mathbf{b}\|^2.
\end{equation*}
Compute
\(A^T A\) and
\(A^T\mathbf{b}\text{.}\)
Use
\(\nabla h(\mathbf{x})=2A^T(A\mathbf{x}-\mathbf{b})\) to write the normal equations.
Solve the normal equations.
Compute the residual
\(\mathbf{r}=\mathbf{b}-A\hat{\mathbf{x}}\text{.}\)
Check that
\(A^T\mathbf{r}=\mathbf{0}\text{.}\)
Learning outcomes. U5-LO6, U4-LO4.
Additional exercise 5.8.6 . Residual orthogonality in code.
xhat = np.linalg.lstsq(A, b, rcond=None)[0]
r = b - A @ xhat
A.T @ r
What condition is checked by
A.T @ r?
Does
A.T @ r being close to zero mean that
r is close to zero?
Which earlier unit used this same condition?
Learning outcomes. U5-LO6, U4-LO4.
Additional exercise 5.8.7 . Fixed-feature design matrix.
Let \(\sigma(t)=\tanh(t)\text{,}\) and define
\begin{equation*}
N_{\mathbf{c}}(t)=c_0+c_1\sigma(t)+c_2\sigma(t-1)+c_3\sigma(t+1).
\end{equation*}
Use the input values \(t=-1,0,1\text{.}\)
Write the design matrix
\(A\) for the model
\(A\mathbf{c}\approx \mathbf{y}\text{.}\)
Why is this a least-squares problem?
Is the model linear as a function of
\(t\text{?}\)
Is the model linear as a function of
\(\mathbf{c}\text{?}\)
Learning outcomes. U5-LO6, U5-LO7.