3⁻¹ = 1/3. What is A⁻¹?

LinAlg

Notes from Gilbert Strang’s lecture series 3

1. Multiplication and Inverse Matrices

1.1. AB=CAB = C

C34=(3rd row of A)(4th column of B)=a31b14+a32b24+a33b34+...=k=1na3kbk4\begin{align*} C_{34} &= (\text{3rd row of A}) * (\text{4th column of B}) \\ &= a_{31} b_{14} + a_{32} b_{24} + a_{33} b_{34} + ... \\ &= \sum_{k=1}^n a_{3k} b_{k4} \end{align*}

We can generalize this to the whole matrix:

Cij=k=1nAikBkjC_{ij} = \sum_{k=1}^n A_{ik} B_{kj}

If AA is m×nm \times n and BB is n×pn \times p, then the resulting matrix CC will be m×pm \times p. If this is confusing at first, think about a simple example. A row of AA will be multiplied by pp columns of BB, and this will be repeated for all mm rows of AA.

1.1.1. Column at A Time

Now, let's look at it as a product of matrix AA and column jj of BB.

(A)(B1B2Bp)=(C1C2Cp)\begin{pmatrix} A \end{pmatrix} \begin{pmatrix} | & | & & | \\ B_1 & B_2 & \cdots & B_p \\ | & | & & | \end{pmatrix} = \begin{pmatrix} | & | & & | \\ C_1 & C_2 & \cdots & C_p \\ | & | & & | \end{pmatrix}

Each row of AA is multiplied by each column of BB to produce the corresponding entry in CC. We've already seen this in 2.2:

matrix×vector=vector\text{matrix} \times \text{vector} = \text{vector}

The columns of CC are linear combinations of the columns of AA. (See Super Important! in the last post.)

1.1.2. Row at A Time

(A1A2Am)(B1B2Bn)=(C1C2Cm)\begin{pmatrix} - & A_1 & - \\ - & A_2 & - \\ & \vdots & \\ - & A_m & - \end{pmatrix} \begin{pmatrix} - & B_1 & - \\ - & B_2 & - \\ & \vdots & \\ - & B_n & - \end{pmatrix} = \begin{pmatrix} - & C_1 & - \\ - & C_2 & - \\ & \vdots & \\ - & C_m & - \end{pmatrix}

The rows of CC are linear combinations of the rows of BB.

Cij=k=1nAikBkjC_{ij} = \sum_{k=1}^n A_{ik} B_{kj} Ci=k=1nAik(Bk1,,Bkp)=Ai1B1+Ai2B2++AinBn\begin{align*} C_i &= \sum_{k=1}^n A_{ik} (B_{k1}, \dots, B_{kp}) \\ &= A_{i1} B_1 + A_{i2} B_2 + \cdots + A_{in} B_n \end{align*}

Tip


The columns of CC are linear combinations of the columns of AA, and the rows of CC are linear combinations of the rows of BB.

1.1.3. Column Times Row

column of A×row of B=matrix\text{column of A} \times \text{row of B} = \text{matrix} (234)(16)=(212318424)\begin{pmatrix} 2 \\ 3 \\ 4 \end{pmatrix} \begin{pmatrix} 1 & 6 \end{pmatrix} = \begin{pmatrix} 2 & 12 \\ 3 & 18 \\ 4 & 24 \end{pmatrix}

It's a very special matrix! The columns are multiples of (2,3,4)(2, 3, 4) and the rows are multiples of [1,6][1, 6].

AB=columns of A×rows of BAB = \sum \text{columns of A} \times \text{rows of B} (273849)(1600)=(234)(16)+(789)(00)\begin{pmatrix} 2 & 7\\ 3 & 8\\ 4 & 9 \end{pmatrix} \begin{pmatrix} 1 & 6 \\ 0 & 0 \end{pmatrix} = \begin{pmatrix} 2 \\ 3 \\ 4 \end{pmatrix} \begin{pmatrix} 1 & 6 \end{pmatrix} + \begin{pmatrix} 7 \\ 8 \\ 9 \end{pmatrix} \begin{pmatrix} 0 & 0 \end{pmatrix}

1.2. Block Multiplication

Suppose we have two square matrices AA and BB of size n×nn \times n. Guess whay? We can multiply them block by block!

A=[A1A2A3A4],B=[B1B2B3B4]A = \begin{bmatrix} A_1 & A_2 \\ A_3 & A_4 \end{bmatrix}, \quad B = \begin{bmatrix} B_1 & B_2 \\ B_3 & B_4 \end{bmatrix} AB=[A1B1+A2B3A1B2+A2B4A3B1+A4B3A3B2+A4B4]AB = \begin{bmatrix} A_1B_1 + A_2B_3 & A_1B_2 + A_2B_4 \\ A_3B_1 + A_4B_3 & A_3B_2 + A_4B_4 \end{bmatrix}

It may not be very straightforward to see why this works, but you can see it works by hand. I think it's enough here to know that we can do this.

1.3. Inverses (Square Matrix)

1.3.1. Existence of Inverse

Not all matrices have inverses. If A1A^{-1} exists (= invertible, non-singular), ..

AA1=A1A=IAA^{-1} = A^{-1}A = I

Why a matrix wouldn't have an inverse (singular) ?

(1326)\begin{pmatrix} 1 & 3 \\ 2 & 6 \end{pmatrix}
  1. Determinant of this matrix is zero.

  2. Suppose there is an inverse matrix A1A^{-1}, then when we multiply AA by A1A^{-1}, the result should be combination of the columns of AA. But they lie on the same line, so we can never get the identity matrix II.

  3. If we can find a vector xx such that Ax=0Ax = 0, then AA is singular. In this case, x=(3,1)x = (3, -1).

(1326)(31)=(00)\begin{pmatrix} 1 & 3 \\ 2 & 6 \end{pmatrix} \begin{pmatrix} 3 \\ -1 \end{pmatrix} = \begin{pmatrix}0 \\ 0 \end{pmatrix}

Why this is an issue for an inverse?

Ax=0Ax = 0 A1Ax=x=0\begin{align*} A^{-1} A x &= x = 0 \end{align*}

But xx was not zero!

Important!


If a combination of the columns of AA can give you the zero vector, then AA is singular and does not have an inverse. In other words, if there is a non-zero vector xx such that Ax=0Ax = 0, then AA is singular.

1.3.2. Gauss-Jordan

(1327)(acbd)=(1001)\begin{pmatrix} 1 & 3 \\ 2 & 7 \end{pmatrix} \begin{pmatrix} a & c \\ b & d \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}

Finding the inverse is like solving the system.

A×column j of A1=column j of IA \times \text{column } j \text{ of } A^{-1} = \text{column } j \text{ of } I

Gauss-Jordan can solve two equations at once.

(1327)(ab)=(10)\begin{pmatrix} 1 & 3 \\ 2 & 7 \end{pmatrix} \begin{pmatrix} a \\ b \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \end{pmatrix} (1327)(cd)=(01)\begin{pmatrix} 1 & 3 \\ 2 & 7 \end{pmatrix} \begin{pmatrix} c \\ d \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \end{pmatrix}

Jordan once said, we can..

(13102701)\begin{pmatrix} 1 & 3 & | & 1 & 0 \\ 2 & 7 & | & 0 & 1 \end{pmatrix} (13100121)\rightarrow \begin{pmatrix} 1 & 3 & | & 1 & 0 \\ 0 & 1 & | & -2 & 1 \end{pmatrix}

Now that we have the upper triangular, Gauss would have said to quit, but Jordan said keep going!

(10730121)\rightarrow \begin{pmatrix} 1 & 0 & | & 7 & -3 \\ 0 & 1 & | & -2 & 1 \end{pmatrix}

We have found the inverse matrix.

A1=(7321)A^{-1} = \begin{pmatrix} 7 & -3 \\ -2 & 1 \end{pmatrix}

Again, what was confusing for me in the beginning is that it is not clear why we can do this. Well, you can check A×A1=IA \times A^{-1} = I, but why does it work?

As we are doing elimination steps, we are multiplying AA by some matrice EE's.

E(AI)=IEE(AI) = IE

Wait, we have EA=IEA = I? Then what is EE?

E=A1E = A^{-1} E(AI)=IA1E(AI) = IA^{-1}

Comments