Linear Algebra: II Matrices

Matrices


An $m$ by $n$ matrix is an ordered collection of $n$ $m$th dimension column vectors as well as $m$ $n$ dimensional row vectors written as:


$$ A= \begin{bmatrix} a_{11} & \cdots & a_{1n} \\ \vdots & & \vdots \\ a_{m1} & \cdots & a_{mn} \end{bmatrix} = \begin{bmatrix} \vec{c}_1 & \cdots & \vec{c}_n \end{bmatrix} \quad \text{where} \quad \vec{c}_j = \begin{bmatrix} a_{1j} \\ \vdots \\ a_{mj} \end{bmatrix} $$
$$ A= \begin{bmatrix} a_{11} & \cdots & a_{1n} \\ \vdots & & \vdots \\ a_{m1} & \cdots & a_{mn} \end{bmatrix} = \begin{bmatrix} \vec{r}_1^\top \\ \vdots \\ \vec{r}_m^\top \end{bmatrix} \quad \text{where} \quad \vec{r}_i^\top = \begin{bmatrix} a_{i1} & \cdots & a_{in} \end{bmatrix} $$

A column vector is a $n$ by $1$ matrix, a row vector is a $1$ by $n$ matrix, and a scalar is a $1$ by $1$ matrix. If $A$ is a matrix with $m$ rows and $n$ columns, then its transpose $A^\top$ is a matrix with $n$ rows and $m$ columns, switching the columns and rows so that:


$$ a^\top_{ij} = a_{ji} $$

Note that $(A^\top)^\top = A$.


Matrix addition is defined using column vectors as:


$$ A+B = \begin{bmatrix} \vec{a}_1 +\vec{b}_1 & \ldots & \vec{a}_n +\vec{b}_n \end{bmatrix} $$

Which is associative and commutative


$$ (A+B)+C=A+(B+C) $$

And commutative.


$$ A + B = B + A $$

Scalar multiplication for matrices is defined using column vectors as:


$$ cA = \begin{bmatrix} c\vec{a}_1 & \ldots & c\vec{a}_n \end{bmatrix} $$

Which is associative,


$$ c_1(c_2A) = (c_1c_2)A $$

Commutative,


$$ c_1c_2A = c_2c_1A $$

And distributive.


$$ c(A+B)=cA+cB $$

Let $A$ be an $m$ by $n$ matrix and $\vec{x}$ be an $n$ dimensional column vector or $n$ by $1$ matrix. Then matrix-vector multiplication is defined as the inner product / dot product of the rows of $A$ and $\vec{x}$:


$$ A\vec{x} = \begin{bmatrix} a_{11} & \cdots & a_{1n} \\ \vdots & & \vdots \\ a_{m1} & \cdots & a_{mn} \end{bmatrix} \begin{bmatrix} x_1 \\ \vdots \\ x_n \end{bmatrix} = \begin{bmatrix} \sum_{i=1}^n a_{1i} x_i \\ \vdots \\ \sum_{i=1}^n a_{mi} x_i \end{bmatrix} $$

This defines a linear transformation:


$$ T : \mathbb{R}^n \to \mathbb{R}^m, \quad T(\vec{x}) = A\vec{x} $$

Where for any linear combination of vectors $\vec{v}_1,\ldots,\vec{v}_k \in \mathbb{R}^n$:


$$ T(a_1 \vec{v}_1 + \ldots + a_k \vec{v}_k) = a_1 T(\vec{v}_1) + \ldots + a_k T(\vec{v}_k) \in \mathbb{R}^m $$

Matrix multiplication is defined as:


$$ AB = \begin{bmatrix} a_{11} & \cdots & a_{1n} \\ \vdots & & \vdots \\ a_{m1} & \cdots & a_{mn} \end{bmatrix} \begin{bmatrix} b_{11} & \cdots & b_{1p} \\ \vdots & & \vdots \\ b_{n1} & \cdots & b_{np} \end{bmatrix} = \begin{bmatrix} \sum_{i=1}^n a_{1i} b_{i1} & \cdots & \sum_{i=1}^n a_{1i} b_{ip} \\ \vdots & & \vdots \\ \sum_{i=1}^n a_{mi} b_{i1} & \cdots & \sum_{i=1}^n a_{mi} b_{ip} \end{bmatrix} $$

Which is associative,


$$(AB)C=A(BC)$$

Distributive,


$$A(B+C) = AB + AC$$

But not commutative.


$$AB \neq BA$$

Transpose of a matrix sum:


$$ (A + B)^\top = A^\top + B^\top $$

Transpose of a matrix product:


$$ (AB)^\top = B^\top A^\top $$

Comments

Popular posts from this blog

Linear Algebra: III Square and Inverse Matrices

Linear Algebra: VII Orthonormal Matrices

Linear Algebra: VI Triangular Matrices and LU Decomposition