USTHLinear Algebra · MAT1.002

Modules › Matrices

Matrices

Operations, the algebra of matrices, transposes, inverses and how to compute them.

Lecture 2 · Exercise Sheet 2 · Matrices
Textbook sections: Elementary Linear Algebra ch. 2 §2.1–2.4 · Strang §2.4–2.7
USTHDSES

Matrices

Linear Algebra · Module 2
Lecture 2 · Exercise Sheet 2
Chapter: Matrices
Books: Elementary Linear Algebra ch. 2 §2.1–2.4 · Strang §2.4–2.7
USTHDSES

After this module you can

  • Add, scale, multiply and transpose matrices and know when each operation is defined.
  • Use the rules ($AB\ne BA$, $(AB)^T=B^TA^T$, $(AB)^{-1}=B^{-1}A^{-1}$).
  • Find $A^{-1}$ by Gauss–Jordan, by the adjugate formula and for $2\times2$ matrices by the formula.
USTHDSES

Operations and sizes

  • $A$ is $m\times n$, $B$ is $n\times p$ $\Rightarrow$ $AB$ is $m\times p$; entry $(AB)_{ij}=\text{row}_i(A)\cdot\text{col}_j(B)$. Sums need equal sizes.
  • $\operatorname{Tr}(A)=\sum a_{ii}$; $\operatorname{Tr}(AB)=\operatorname{Tr}(BA)$; $\operatorname{Tr}(DD^T)=\sum d_{ij}^2$.
  • Powers: $A^2=A$ (projection) gives $A^k=A$; $B=\operatorname{diag}(1,-1)$ gives $B^k=I$ or $B$; a nilpotent $C$ ($C^2=0$) gives $C^k=0$ for $k\ge2$.
  • Always check sizes before multiplying: with $A,B:4\times5$, $C:5\times2$, only $AC+D$ ($D:4\times2$) makes sense among the products on Sheet 2.
USTHDSES

Rules and traps

TrueFalse in general
$(A+B)^T=A^T+B^T$, $(AB)^T=B^TA^T$$AB=BA$
$(AB)^{-1}=B^{-1}A^{-1}$$(A+B)^2=A^2+2AB+B^2$
$A(B+C)=AB+AC$$AB=0\Rightarrow A=0$ or $B=0$
$A=A^T,B=B^T\Rightarrow ABA$ symmetric$AB$ symmetric
USTHDSES

Computing the inverse: three ways

MethodFormula / procedure
Gauss–Jordanrow-reduce $[A\mid I]\to[I\mid A^{-1}]$; a zero row means singular
Adjugate$A^{-1}=\frac{1}{\det A}\operatorname{adj}A$ (transpose of the cofactor matrix)
$2\times2$$\begin{bmatrix}a&b\\c&d\end{bmatrix}^{-1}=\frac1{ad-bc}\begin{bmatrix}d&-b\\-c&a\end{bmatrix}$
block / specialanti-diagonal $\to$ reciprocal anti-diagonal; diagonal $\to$ reciprocals

Check every inverse with $AA^{-1}=I$.

USTHDSES

Invertibility: equivalent statements

  • $A$ ($n\times n$) is invertible $\iff$ $\det A\ne0$ $\iff$ $A\mathbf x=\mathbf0$ has only $\mathbf x=\mathbf 0$ $\iff$ $\operatorname{rank}A=n$ $\iff$ rows (columns) independent.
  • For which $c$ is $\begin{bmatrix}2&c&c\\c&c&c\\8&7&c\end{bmatrix}$ singular? Solve $\det=0$.
  • If $A^2$ has the inverse $B$ then $A^{-1}=AB$ (so $A$ is invertible whenever $A^2$ is).
  • If $AB=BA$ for every $B$ then $A=cI$.
USTHDSES

Typical mistakes

Order$(AB)^{-1}=B^{-1}A^{-1}$ and $(AB)^T=B^TA^T$ reverse the order.
Sizes$BA$ may not exist even if $AB$ does.
SquareOnly square matrices can have inverses.
USTHDSES

Practice next

  • Chapter quizzes Ch. 2 (3 sets)
  • Practice bank, filtered to this chapter, then written mode
  • Lab: Inverse matrix
  • Then the mock exams (Exams page)

Worked examples from the course problems

Worked example 1 · Trace (Exercise Sheet 2, Ex. 2)
$A=\begin{bmatrix}3 & 0 \\ -1 & 2 \\ 1 & 1\end{bmatrix},\ B=\begin{bmatrix}4 & -1 \\ 0 & 2\end{bmatrix},\ C=\begin{bmatrix}1 & 4 & 2 \\ 3 & 1 & 5\end{bmatrix},\ D=\begin{bmatrix}1 & 5 & 2 \\ -1 & 0 & 1 \\ 3 & 2 & 4\end{bmatrix},\ E=\begin{bmatrix}6 & 1 & 3 \\ -1 & 1 & 2 \\ 4 & 1 & 3\end{bmatrix}$ Compute $\operatorname{Tr}\big((C^{T}B)A^{T}\big)$.
Show the answer and the solution

Answer: $8$

Add the diagonal of $(C^TB)A^T=\begin{bmatrix}12 & 6 & 9 \\ 48 & -20 & 14 \\ 24 & 8 & 16\end{bmatrix}$: $8$.
Worked example 2 · Powers (Exercise Sheet 2, Ex. 7)
For $C=AB$ with $A=\begin{bmatrix}\frac{1}{2} & \frac{1}{2} \\ \frac{1}{2} & \frac{1}{2}\end{bmatrix}$, $B=\begin{bmatrix}1 & 0 \\ 0 & -1\end{bmatrix}$, what is $C^{k}$ for $k\ge2$?
Show the answer and the solution

Answer: $C^k=0$ (the zero matrix)

$C=AB=\begin{bmatrix}\frac{1}{2} & - \frac{1}{2} \\ \frac{1}{2} & - \frac{1}{2}\end{bmatrix}$ and $C^2=\begin{bmatrix}0 & 0 \\ 0 & 0\end{bmatrix}=0$, so $C$ is nilpotent and $C^k=0$ for every $k\ge2$. (Do not confuse it with $A$, which satisfies $A^2=A$.)
Worked example 3 · Invertibility (Exercise Sheet 2, Ex. 10)
For which $c$ is $A=\begin{bmatrix}2 & c & c \\ c & c & c \\ 8 & 7 & c\end{bmatrix}$ NOT invertible?
Show the answer and the solution

Answer: $c\in\{0,2,7\}$

$\det A=- c \left(c - 7\right) \left(c - 2\right)$, which is $0$ exactly for $c=0,2,7$ (then two rows/columns become dependent).
Worked example 4 · Inverse (Gauss–Jordan) (Final 2024–25 Shift 1, Q2(b))
Exam: $A=\begin{bmatrix}4 & 1 & 3 \\ 1 & 2 & 1 \\ -1 & 0 & -1\end{bmatrix}$ with $k=2$. The entry $(A^{-1})_{23}$ is
Show the answer and the solution

Answer: $\frac{1}{2}$

$A^{-1}=\begin{bmatrix}1 & - \frac{1}{2} & \frac{5}{2} \\ 0 & \frac{1}{2} & \frac{1}{2} \\ -1 & \frac{1}{2} & - \frac{7}{2}\end{bmatrix}$, so the $(2,3)$ entry is $\frac{1}{2}$.

Practice

Quiz set A Quiz set B Quiz set C Practice bank (this chapter) Written mode Lab: Inverse matrix

◀ Systems of linear equationsDeterminants ▶