Suppose we need to multiply these matrices…
\left[\begin{array}{llll} 1 & 2 & 0 & 0 \\ 3 & 4 & 0 & 0 \\ 0 & 0 & 1 & 0 \end{array}\right]\left[\begin{array}{llll} 0 & 0 & 2 & 1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{array}\right] .
pause
A \mathbf{x}=\left[\mathbf{a}_{1}, \mathbf{a}_{2}, \mathbf{a}_{3}\right]\left[\begin{array}{c} x_{1} \\ x_{2} \\ x_{3} \end{array}\right]=\mathbf{a}_{1} x_{1}+\mathbf{a}_{2} x_{2}+\mathbf{a}_{3} x_{3}
Let A=\left[a_{i j}\right] be an m \times n matrix with (possibly) complex entries.
The transpose of A is the n \times m matrix A^{T} obtained by interchanging the rows and columns of A
The conjugate of A is the matrix \bar{A}=\left[\overline{a_{i j}}\right]
Finally, the conjugate (Hermitian) transpose of A is the matrix A^{*}=\bar{A}^{T}.
Find the transpose and conjugate transpose of:
\left[\begin{array}{lll}1 & 0 & 2 \\ 0 & 1 & 1\end{array}\right]
\left[\begin{array}{lll} 1 & 0 & 2 \\ 0 & 1 & 1 \end{array}\right]^{*}=\left[\begin{array}{lll} 1 & 0 & 2 \\ 0 & 1 & 1 \end{array}\right]^{T}=\left[\begin{array}{ll} 1 & 0 \\ 0 & 1 \\ 2 & 1 \end{array}\right]
Find the transpose and conjugate transpose of:
\left[\begin{array}{rr}1 & 1+\mathrm{i} \\ 0 & 2 \mathrm{i}\end{array}\right]
\left[\begin{array}{rr} 1 & 1+\mathrm{i} \\ 0 & 2 \mathrm{i} \end{array}\right]^{*}=\left[\begin{array}{rr} 1 & 0 \\ 1-\mathrm{i} & -2 \mathrm{i} \end{array}\right], \quad\left[\begin{array}{rr} 1 & 1+\mathrm{i} \\ 0 & 2 \mathrm{i} \end{array}\right]^{T}=\left[\begin{array}{rr} 1 & 0 \\ 1+\mathrm{i} & 2 \mathrm{i} \end{array}\right]
Let A and B be matrices of the appropriate sizes so that the following operations make sense, and c a scalar.
(A+B)^{T}=A^{T}+B^{T}
(A B)^{T}=B^{T} A^{T}
(c A)^{T}=c A^{T}
\left(A^{T}\right)^{T}=A
The matrix A is said to be:
Is this matrix symmetric? Hermetian?
\left[\begin{array}{rr}1 & 1+\mathrm{i} \\ 1-\mathrm{i} & 2\end{array}\right]
It’s Hermetian, but not symmetric.
\left[\begin{array}{rr} 1 & 1+\mathrm{i} \\ 1-\mathrm{i} & 2 \end{array}\right]^{*}=\left[\begin{array}{rr} 1 & \overline{1+\mathrm{i}} \\ \overline{1-\mathrm{i}} & 2 \end{array}\right]^{T}=\left[\begin{array}{rr} 1 & 1+\mathrm{i} \\ 1-\mathrm{i} & 2 \end{array}\right]
Let \mathbf{u} and \mathbf{v} be column vectors of the same size, say n \times 1.
Then the inner product of \mathbf{u} and \mathbf{v} is the scalar quantity \mathbf{u}^{T} \mathbf{v}
Find the inner product of \mathbf{u}=\left[\begin{array}{r} 2 \\ -1 \\ 1 \end{array}\right] \text { and } \mathbf{v}=\left[\begin{array}{l} 3 \\ 4 \\ 1 \end{array}\right]
\mathbf{u}^{T} \mathbf{v}=[2,-1,1]\left[\begin{array}{l} 3 \\ 4 \\ 1 \end{array}\right]=2 \cdot 3+(-1) 4+1 \cdot 1=3
Find the outer product of
\mathbf{u}=\left[\begin{array}{r} 2 \\ -1 \\ 1 \end{array}\right] \text { and } \mathbf{v}=\left[\begin{array}{l} 3 \\ 4 \\ 1 \end{array}\right]
\mathbf{u v}^{T}=\left[\begin{array}{r} 2 \\ -1 \\ 1 \end{array}\right][3,4,1]=\left[\begin{array}{rrr} 2 \cdot 3 & 2 \cdot 4 & 2 \cdot 1 \\ -1 \cdot 3 & -1 \cdot 4 & -1 \cdot 1 \\ 1 \cdot 3 & 1 \cdot 4 & 1 \cdot 1 \end{array}\right]=\left[\begin{array}{rrr} 6 & 8 & 2 \\ -3 & -4 & -1 \\ 3 & 4 & 1 \end{array}\right]
The determinant of a square n \times n matrix A=\left[a_{i j}\right], \operatorname{det} A, is defined recursively:
If n=1 then \operatorname{det} A=a_{11};
otherwise,
then
\begin{aligned} \operatorname{det} A & =\sum_{k=1}^{n} a_{k 1}(-1)^{k+1} M_{k 1}(A) \\ & =a_{11} M_{11}(A)-a_{21} M_{21}(A)+\cdots+(-1)^{n+1} a_{n 1} M_{n 1}(A) \end{aligned}
Determinant of an upper-triangular matrix: \begin{aligned} \operatorname{det} A & =\left|\begin{array}{cccc} a_{11} & a_{12} & \cdots & a_{1 n} \\ 0 & a_{22} & \cdots & a_{2 n} \\ \vdots & \vdots & & \vdots \\ 0 & 0 & \cdots & a_{n n} \end{array}\right|=a_{11}\left|\begin{array}{cccc} a_{22} & a_{23} & \cdots & a_{2 n} \\ 0 & a_{33} & \cdots & a_{3 n} \\ \vdots & \vdots & & \vdots \\ 0 & 0 & \cdots & a_{n n} \end{array}\right| \\ & =\cdots=a_{11} \cdot a_{22} \cdots a_{n n} . \end{aligned}
D1: If A is an upper triangular matrix, then the determinant of A is the product of all the diagonal elements of A.
D2: If B is obtained from A by multiplying one row of A by the scalar c, then \operatorname{det} B=c \cdot \operatorname{det} A.
D3: If B is obtained from A by interchanging two rows of A, then \operatorname{det} B= -\operatorname{det} A.
D4: If B is obtained from A by adding a multiple of one row of A to another row of A, then \operatorname{det} B=\operatorname{det} A.
Let R be the reduced row echelon form of A, obtained through multiplication by elementary matrices:
R=E_{1} E_{2} \cdots E_{k} A .
Determinant of both sides:
\operatorname{det} R=\operatorname{det}\left(E_{1} E_{2} \cdots E_{k} A\right)= \pm(\text { nonzero constant }) \cdot \operatorname{det} A \text {. }
Therefore, \operatorname{det} A=0 precisely when \operatorname{det} R=0.
Therefore,
D5: The matrix A is invertible if and only if \operatorname{det} A \neq 0.
D6: Given matrices A, B of the same size,
\operatorname{det} A B=\operatorname{det} A \operatorname{det} B \text {. }
(but beware, \operatorname{det} A+\operatorname{det} B \neq \operatorname{det}(A+B))
D7: For all square matrices A, \operatorname{det} A^{T}=\operatorname{det} A
Just use the det function in Python! (That was copilot’s autocomplete…)
Use elementary row operations to get the matrix into upper triangular form, then multiply the diagonal entries.
A=\left[\begin{array}{rrr}1 & 2 & 0 \\ 0 & 0 & -1 \\ 0 & 2 & 1\end{array}\right]
Cofactor matrix and adjoint:
Overlay with the checkerboard \left[\begin{array}{l}+-+ \\ -+- \\ +-+\end{array}\right]. Take the transpose, to get
\operatorname{adj} A=\left[\begin{array}{rrr} 2 & -2 & -2 \\ 0 & 1 & 1 \\ 0 & -2 & 0 \end{array}\right]
\begin{equation*} \sum_{k=1}^{n} A_{k i} a_{k j}=\delta_{i j} \operatorname{det} A \end{equation*}
Remeber, we had A=\left[\begin{array}{rrr}1 & 2 & 0 \\ 0 & 0 & -1 \\ 0 & 2 & 1\end{array}\right]
We had computed the adjoint as A^{*}=\left[\begin{array}{rrr}2 & -2 & -2 \\ 0 & 1 & 1 \\ 0 & -2 & 0\end{array}\right]
Check:
A \operatorname{adj} A=\left[\begin{array}{rrr} 1 & 2 & 0 \\ 0 & 0 & -1 \\ 0 & 2 & 1 \end{array}\right]\left[\begin{array}{rrr} 2 & -2 & -2 \\ 0 & 1 & 1 \\ 0 & -2 & 0 \end{array}\right]=\left[\begin{array}{lll} 2 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 2 \end{array}\right]=(\operatorname{det} A) I_{3} .
So, A^{-1}=\frac{1}{\operatorname{det} A} A^{*}.
Explicit formula for solving linear systems with a nonsingular coefficient matrix.
Solve A \mathbf{x}=\mathbf{b}
Multiply both sides by A^{-1}: \mathbf{x}=A^{-1} \mathbf{b}
Use the formula for A^{-1}: \mathbf{x}=\frac{1}{\operatorname{det} A} A^{*} \mathbf{b}
The i th component of \mathbf{x} is
x_{i}=\frac{1}{\operatorname{det} A} \sum_{j=1}^{n} A_{j i} b_{j}
x_{i}=\frac{1}{\operatorname{det} A} \sum_{j=1}^{n} A_{j i} b_{j}
** pause **
Let A, B be n \times n matrices.
D1: If A is upper triangular, \operatorname{det} A is the product of all the diagonal elements of A.
D2: \operatorname{det}\left(E_{i}(c) A\right)=c \cdot \operatorname{det} A.
D3: \operatorname{det}\left(E_{i j} A\right)=-\operatorname{det} A.
D4: \operatorname{det}\left(E_{i j}(s) A\right)=\operatorname{det} A.
D5: The matrix A is invertible if and only if \operatorname{det} A \neq 0.
D6: \operatorname{det} A B=\operatorname{det} A \operatorname{det} B.
D7: \operatorname{det} A^{T}=\operatorname{det} A.
D8: A \operatorname{adj} A=(\operatorname{adj} A) A=(\operatorname{det} A) I.
D9: If \operatorname{det} A \neq 0, then A^{-1}=\frac{1}{\operatorname{det} A} \operatorname{adj} A.
A quadratic form is a homogeneous polynomial of degree 2 in n variables. For example,
Q(x, y, z)=x^{2}+2 y^{2}+z^{2}+2 x y+y z+3 x z .
We can express this in matrix form!
\begin{aligned} x(x+2 y+3 z)+y(2 y+z)+z^{2} & =\left[\begin{array}{lll} x & y & z \end{array}\right]\left[\begin{array}{c} x+2 y+3 z \\ 2 y+z \\ z \end{array}\right] \end{aligned}
\begin{aligned} =\left[\begin{array}{lll} x & y & z \end{array}\right]\left[\begin{array}{lll} 1 & 2 & 3 \\ 0 & 2 & 1 \\ 0 & 0 & 1 \end{array}\right]\left[\begin{array}{c} x \\ y \\ z \end{array}\right]=\mathbf{x}^{T} A \mathbf{x}, \end{aligned}