Skip to main content

MATH 345: Linear Algebra and Optimization

Section 1.7 Unit 1 highlights

Subsection Mathematical quick reference

Vectors and linear combinations.

Vector. An ordered list of scalars, \(\mathbf v=(v_1,\ldots,v_n)\in\mathbb R^n\text{.}\) Vectors are equal when their dimensions and corresponding entries agree. The zero vector has every entry zero.
Operations. For \(\mathbf u,\mathbf v\in\mathbb R^n\) and \(c\in\mathbb R\text{,}\)
\begin{equation*} \mathbf u+\mathbf v=(u_1+v_1,\ldots,u_n+v_n),\qquad c\mathbf v=(cv_1,\ldots,cv_n). \end{equation*}
Displacement. From a point \(P\) to a point \(Q\text{,}\) the displacement vector is \(\overrightarrow{PQ}=Q-P\text{.}\)
Linear combination. \(c_1\mathbf v_1+\cdots+c_k\mathbf v_k\text{.}\) It is a convex combination when every \(c_i\geq0\) and \(\sum_i c_i=1\text{.}\)

Norm, dot product, and angle.

Norm and dot product. For vectors of the same dimension,
\begin{equation*} \mathbf u\cdot\mathbf v=\sum_{i=1}^n u_iv_i,\qquad \|\mathbf v\|=\sqrt{\mathbf v\cdot\mathbf v},\qquad \operatorname{dist}(\mathbf u,\mathbf v)=\|\mathbf u-\mathbf v\|. \end{equation*}
Unit vector. A vector of norm \(1\text{.}\) Normalize a nonzero vector by \(\mathbf v/\|\mathbf v\|\text{.}\)
Angle and cosine similarity. For nonzero \(\mathbf u,\mathbf v\) and their angle \(\theta\in[0,\pi]\text{,}\)
\begin{equation*} \operatorname{cosim}(\mathbf u,\mathbf v)=\frac{\mathbf u\cdot\mathbf v}{\|\mathbf u\|\|\mathbf v\|}=\cos\theta\in[-1,1]. \end{equation*}
Angle and cosine similarity are undefined if either vector is zero.
Orthogonality. \(\mathbf u\perp\mathbf v\) means \(\mathbf u\cdot\mathbf v=0\text{;}\) for nonzero vectors, this is equivalent to a right angle.

Matrix operations and dimensions.

Matrix. \(A=[a_{ij}]\in\mathbb R^{m\times n}\) has \(m\) rows and \(n\) columns. Addition requires equal sizes and is entrywise, as is scalar multiplication. A square matrix has \(m=n\text{.}\)
Transpose. \(A^T\in\mathbb R^{n\times m}\) has entries \((A^T)_{ij}=a_{ji}\text{.}\) A square matrix is symmetric when \(A^T=A\text{.}\)
Product. If \(A\in\mathbb R^{m\times n}\) and \(B\in\mathbb R^{n\times p}\text{,}\) then
\begin{equation*} AB\in\mathbb R^{m\times p},\qquad (AB)_{ij}=\sum_{k=1}^n a_{ik}b_{kj}. \end{equation*}
Identities. Whenever dimensions permit,
\begin{equation*} A(BC)=(AB)C,\qquad A(B+C)=AB+AC,\qquad (A+B)C=AC+BC, \end{equation*}
\begin{equation*} (AB)^T=B^TA^T,\qquad (A^T)^T=A,\qquad AI_n=I_mA=A. \end{equation*}
In general \(AB\neq BA\text{;}\) matrices commute when both products exist and \(AB=BA\text{.}\)

Matrix-vector products and linear maps.

Two descriptions of a product. If \(A=[\mathbf a_1\ \cdots\ \mathbf a_n]\) and \(\mathbf x\in\mathbb R^n\text{,}\) then
\begin{equation*} A\mathbf x=x_1\mathbf a_1+\cdots+x_n\mathbf a_n,\qquad (A\mathbf x)_i=\sum_{j=1}^n a_{ij}x_j. \end{equation*}
Columns contribute scaled vectors; each output entry is a row dot product.
Linear map. \(T:\mathbb R^n\to\mathbb R^m\) is linear when
\begin{equation*} T(\mathbf u+\mathbf v)=T(\mathbf u)+T(\mathbf v),\qquad T(c\mathbf v)=cT(\mathbf v). \end{equation*}
In particular, \(T(\mathbf0)=\mathbf0\text{.}\) Its matrix is
\begin{equation*} A=[T(\mathbf e_1)\ \cdots\ T(\mathbf e_n)],\qquad T(\mathbf x)=A\mathbf x. \end{equation*}
Affine map. \(F(\mathbf x)=A\mathbf x+\mathbf b\) is linear exactly when \(\mathbf b=\mathbf0\text{.}\)
Composition. Applying \(B\) first and \(A\) second gives \(\mathbf x\mapsto AB\mathbf x\text{.}\) Check the inner dimensions before multiplying.

Geometric matrix actions.

Read the columns. In the plane, the columns of \(A\) are the images of \(\mathbf e_1\) and \(\mathbf e_2\text{;}\) they determine the image of the unit square.
Scaling and counterclockwise rotation.
\begin{equation*} D=\begin{bmatrix}a\amp0\\0\amp b\end{bmatrix},\qquad R_\theta=\begin{bmatrix}\cos\theta\amp-\sin\theta\\\sin\theta\amp\cos\theta\end{bmatrix}. \end{equation*}
Reflections and horizontal shear. Reflection across the \(y\)-axis, reflection across \(y=x\text{,}\) and the shear \((x,y)\mapsto(x+ky,y)\) have matrices
\begin{equation*} \begin{bmatrix}-1\amp0\\0\amp1\end{bmatrix},\qquad \begin{bmatrix}0\amp1\\1\amp0\end{bmatrix},\qquad \begin{bmatrix}1\amp k\\0\amp1\end{bmatrix}. \end{equation*}

Subsection Common mistakes

Confusing a dot product with a distance; using cosine similarity with a zero vector; omitting normalization; mixing up rows and columns; ignoring product dimensions; reversing composition order; assuming \(AB=BA\text{;}\) assuming that non-diagonal matrices cannot commute; or calling an affine map linear when its constant term is nonzero.

Subsection Connections

Unit 2 uses matrix equations to describe solution sets, column spaces, and null spaces. Unit 3 uses affine maps for local approximation and dot products for directional derivatives. Unit 4 develops dot products into orthogonality and projection. Unit 5 studies eigenvectors and quadratic forms of matrix maps.