(Optional: if you wish to download this notebook as an .ipynb file, use the download button in the upper right and OPTION-click (MAC) or ALT-Click (Linux and Windows ) then "Save Link as.." or "Download Linked File As.." or something similar on your browser.)
Problem 1. Parameter Counting. In this question you are asked to count the number of parameters needed to represent a matrix. Examples we have already seen is that an n x n diagonal requires n parameters, an upper triangular requires n(n+1)/2 parameters, and the identity requires one parameter, the number "n" itself.
a. A unit lower triangular matrix, is lower triangular with ones on the diagonal. How many parameters are needed to represent an n x n unit lower triangular matrix?
b. A vector that shows up in machine learning is the "one hot" vector. It is defined as a vector of length n, which has the kth entry 1, and all other entries 0. (The kth entry is considered "hot".) How many parameters are needed for the "one hot" vector? It is equivalently defined as the kth column of the n x n identity.
c. An n x n matrix whose rows add up to 1, and also the columns add up to 1 is called doubly stochastic. How many parameters are required?
d. How many parameters in a 2x2 rotation matrix $Q=\begin{pmatrix} \cos \theta & -\sin \theta \\ \sin \theta &\cos \theta \end{pmatrix}$?
Problem 2. Suppose $A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}$ is factored into a 2x2 rotation $Q=\begin{pmatrix} \cos \theta & -\sin \theta \\ \sin \theta &\cos \theta \end{pmatrix}$ times a 2x2 lower triangular matrix $L=\begin{pmatrix} x & 0\\ y & z \end{pmatrix}$. Write $x,y,z$ and $\theta$ in terms of $a,b,c$ and $d$.
Problem 3. (Inspired by GS 2.1 15-22)
a. What 3x3 matrix turns $\begin{pmatrix} a \\ b \\ c \end{pmatrix}$ into $\begin{pmatrix} b \\ c \\ a \end{pmatrix}$?
b. What 3x3 matrix E turns $\begin{pmatrix} a \\ b \\ c \end{pmatrix}$ into $\begin{pmatrix} a \\ b \\ c-2a \end{pmatrix}$?
c. Think about undoing the transformation in 3b above and write down the inverse of $E$ without going through lengthy calculations.
d. Write the dot product of $\begin{pmatrix} 1 \\ 4 \\ 5 \end{pmatrix}$ and $\begin{pmatrix} x \\ y \\ z \end{pmatrix}$ as a matrix multiplication $Av$. The matrix $A$ has one row. Describe geometrically the solutions to $Av=0$. Thse solutions are perpendicular to which vector?
Problem 4. (GS 2.2 8)
For which three numbers $k$ does elimination break down? Which $k$ no longer breaks down by a row exchange? For each $k$ is the number of solutions $0$, $1$ or $\infty$? Breakdown is defined as the algorithm producing a 0 pivot.
$\begin{eqnarray} kx+3y & = & \ \ 6 \\ 3x+ky & = & -6 \end{eqnarray}$
Problem 5. (GS 2.3 3) With Julia or by hand
Which three matrices $E_{21},E_{31}, E_{32}$ put $A$ into triangular form $U$
A = [ 1 1 0; 4 6 1; -2 2 0]
3×3 Array{Int64,2}: 1 1 0 4 6 1 -2 2 0
and $E_{32}E_{31}E_{21}A=U$.
Problem 6. (GS 2.3 17) The parabola $y=a+bx+cx^2$ goes through the points $(x,y)=(1,4)$ and $(2,8)$ and $(3,14)$. Set up a matrix equations for the unknowns $(a,b,c)$ and solve by hand or with Julia.
Problem 7 (GS 2.4 15). True or False.
a. If $A^2$ is defined then $A$ is necessarily square.
b. If $AB$ and $BA$ are defined then $A$ and $B$ are square.
c. If $AB$ and $BA$ are defined then $AB$ and $BA$ are square.
d. If $AB=B$ then $A=I$.
Problem 8 (GS 2.4 24) By experiment by hand or with Julia and guessing (not proof) predict $A^n$ as a function of $n$ for matrices A₁,A₂,A₃:
A₁ = [ 2 1;0 1]
2×2 Array{Int64,2}: 2 1 0 1
#Hint using Julia
[A₁^n for n=1:5]
5-element Array{Array{Int64,2},1}: [2 1; 0 1] [4 3; 0 1] [8 7; 0 1] [16 15; 0 1] [32 31; 0 1]
A₂ = [ 1 1;1 1]
2×2 Array{Int64,2}: 1 1 1 1
[A₂^n for n=1:5]
5-element Array{Array{Int64,2},1}: [1 1; 1 1] [2 2; 2 2] [4 4; 4 4] [8 8; 8 8] [16 16; 16 16]
#A₃ requires a symbolic package
import Pkg; Pkg.add("SymPy")
using SymPy
Resolving package versions... Updating `~/.julia/environments/v1.3/Project.toml` [no changes] Updating `~/.julia/environments/v1.3/Manifest.toml` [no changes]
a,b = Sym("a"),Sym("b")
(a, b)
A₃ = [a b ;0 0]
[A₃^n for n=1:5]
5-element Array{Array{Sym,2},1}: [a b; 0 0] [a^2 a*b; 0 0] [a^3 a^2*b; 0 0] [a^4 a^3*b; 0 0] [a^5 a^4*b; 0 0]
Problem 9. Why can't a matrix with a column of zeros have an inverse?
Problem 10. Suppose v and w are perpendicular in $R^n$. What is ‖v+w‖² in terms of ‖v‖² and ‖w‖²?