PAGE 1

2.1 Matrix Operations

Suppose \(A\) is an \(n \times m\) matrix

\[ A = \begin{bmatrix} a_{11} & a_{12} & \dots & a_{1m} \\ a_{21} & a_{22} & \dots & a_{2m} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n1} & a_{n2} & \dots & a_{nm} \end{bmatrix} = \begin{bmatrix} \vec{a}_1 & \vec{a}_2 & \dots & \vec{a}_m \end{bmatrix} \]

Notation Note:

Lower case of matrix name is used to denote individual elements.

\(a_{11} = 1\) (where 1 is row, 1 is column)

\(a_{23} = 6\)

Diagonal Matrix

A diagonal matrix (is a square matrix) has zeros everywhere except possibly on the main diagonal.

e.g.

\[ \begin{bmatrix} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 3 \end{bmatrix} \]
PAGE 2

Zero Matrix

A zero matrix has zeros everywhere.

\[ \begin{bmatrix} 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \end{bmatrix} \]

\(0 \rightarrow\) big zero

Identity Matrix

An identity matrix has 1's on the main diagonal square

\[ \begin{bmatrix} 1 & 0 & \dots & 0 \\ 0 & 1 & \dots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \dots & 1 \end{bmatrix} \]

\(I\) or e.g. \(I_5 =\)

\[ \begin{bmatrix} 1 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 \end{bmatrix} \]

Matrix Equality

Two matrices are equal if they have the same size and the corresponding elements are the same.

\[ \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \neq \begin{bmatrix} 1 & 3 \\ 2 & 4 \end{bmatrix} \neq \begin{bmatrix} 1 \\ 2 \\ 3 \\ 4 \end{bmatrix} \]
PAGE 3

Matrix Addition and Subtraction

Addition and subtraction are done with matrices of the same size.

\[ \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} + \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix} = \begin{bmatrix} 1+5 & 2+6 \\ 3+7 & 4+8 \end{bmatrix} = \begin{bmatrix} 6 & 8 \\ 10 & 12 \end{bmatrix} \]
\[ \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} + \begin{bmatrix} 1 \\ 0 \end{bmatrix} \text{ is not defined} \]
\[ \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} - \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix} = \begin{bmatrix} -4 & -4 \\ -4 & -4 \end{bmatrix} \]
\[ = (-4) \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix} \]

Scalar multiple of matrix \( \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix} \)

\[ (2) \begin{bmatrix} 1 \\ 2 \end{bmatrix} + (3) \begin{bmatrix} -1 \\ 4 \end{bmatrix} = \begin{bmatrix} 2 \\ 4 \end{bmatrix} + \begin{bmatrix} -3 \\ 12 \end{bmatrix} = \begin{bmatrix} -1 \\ 16 \end{bmatrix} \]
PAGE 4

Matrix Multiplication

We already know how to do:

\[ \begin{bmatrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \end{bmatrix} \begin{bmatrix} -1 \\ -2 \end{bmatrix} = \begin{bmatrix} -5 \\ -11 \\ -17 \end{bmatrix} \]

\( 3 \times \underline{2} \) and \( \underline{2} \times 1 \) (inner dimensions must match). Result is \( 3 \times 1 \).

Multiplying by a Matrix

Very similar if multiplying by a matrix:

\[ \begin{bmatrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \end{bmatrix} \begin{bmatrix} -1 & -2 \\ 0 & 4 \end{bmatrix} = \begin{bmatrix} -1 & 6 \\ -3 & 10 \\ -5 & 14 \end{bmatrix} \]

\( 3 \times \underline{2} \) and \( \underline{2} \times 2 \) (inner dimensions must match).

First Column Result:

Rows of first matrix multiplying each row of first column of second matrix.

Second Column Result:

Same thing but with 2nd column of 2nd matrix.

"row-column rule"

PAGE 5

Matrix Multiplication as Linear Combinations

\[ \begin{bmatrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \end{bmatrix} \begin{bmatrix} -1 & -2 \\ 0 & 4 \end{bmatrix} \text{ is also} \]
\[ = \begin{bmatrix} \vec{b_1} & \vec{b_2} \end{bmatrix} \]

where \( \vec{b_1} \) is a linear combo of columns of first matrix using elements of first of second matrix as weights.

similar idea for \( \vec{b_2} \) (2nd col. of 2nd matrix as weights)

General Definition

So, \( AB \), if defined, and if \( B = [\vec{b_1} \ \vec{b_2} \ \vec{b_3} \dots] \)

\[ \text{then } AB = [A\vec{b_1} \ A\vec{b_2} \ A\vec{b_3} \dots] \]

Composition of Linear Mappings

\( AB \) is also two linear mappings consecutively.

\[ AB\vec{x} = A(B\vec{x}) \]

order is VERY important

Mapping diagram showing vector x in domain mapped by B to Bx, then mapped by A to A(Bx).
PAGE 6

NOTE: in general, \( AB \neq BA \)

even if both are defined

\[ A = \begin{bmatrix} 1 & 2 \\ -2 & -1 \end{bmatrix} \quad B = \begin{bmatrix} 3 & 4 \\ 4 & 3 \end{bmatrix} \]
\[ AB = \begin{bmatrix} 11 & 10 \\ -10 & -11 \end{bmatrix} \quad BA = \begin{bmatrix} -5 & -2 \\ -2 & 5 \end{bmatrix} \]

Cancellation Property

also, we cannot "cancel" like with numbers

\[ (3)(x) = (x)(2) \rightarrow x=3 \]
\[ AB\vec{x} = BC \quad \text{NO!} \]

Note: The cancellation of B in the matrix equation is crossed out to indicate it is invalid.

PAGE 7

Matrix Power

Given a matrix:

\[ A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \]

Note that the power is not applied element-wise:

\[ A^2 \neq \begin{bmatrix} 1^2 & 2^2 \\ 3^2 & 4^2 \end{bmatrix} \]

Instead, matrix power is defined as repeated multiplication:

\[ A^2 = AA \]

(so A must be square)

Example of non-square matrix:

e.g. \( B = \begin{bmatrix} 1 \\ 0 \end{bmatrix} \)

\( B^2 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}_{2 \times 1} \begin{bmatrix} 1 \\ 0 \end{bmatrix}_{2 \times 1} \) is NOT defined

Calculation Example

\[ A^2 = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \]\[ = \begin{bmatrix} 7 & 10 \\ 15 & 22 \end{bmatrix} \]

Higher Powers

\[ A^3 = AAA \]\[ A^4 = AAAA \]

and so on

PAGE 8

Matrix Transpose

\( A^T \) means the transpose of \( A \)

→ Swap rows and columns

\( A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \)

\( A^T = \begin{bmatrix} 1 & 3 \\ 2 & 4 \end{bmatrix} \)

\( B = \begin{bmatrix} 1 & 2 & 3 & 4 \\ 5 & 6 & 7 & 8 \end{bmatrix} \)

\( B^T = \begin{bmatrix} 1 & 5 \\ 2 & 6 \\ 3 & 7 \\ 4 & 8 \end{bmatrix} \)

Properties

\[ (A^T)^T = A \]\[ (A+B)^T = A^T + B^T \]\[ (cA)^T = cA^T \]\[ (AB)^T = B^T A^T \]
PAGE 9

Why \((AB)^T = B^T A^T\)?

Let \(A\) be \(2 \times 3\) and \(B\) be \(3 \times 5\).

\(AB\) is \(2 \times 5\)

\(2 \times 3 \quad 3 \times 5\)

\(A^T B^T\) is not defined

\(3 \times 2\)

\(\uparrow\)

\(A^T\)

\(5 \times 3\)

\(\uparrow\)

\(B^T\)

But \(B^T A^T\) is defined \((5 \times 2)\)

\(B^T\)

\(\downarrow\)

\(5 \times 3\)

\(A^T\)

\(\downarrow\)

\(3 \times 2\)