3. Computing the Inverse of a Matrix
Definition of Inverse
By definition, the inverse matrix A(-1) undoes the effects of the matrix A. The cumulative effect of applying A(-1) after A is the identity matrix 1:
A(-1)*A=1≡[[1,,0],[,⋯,],[0,,1]]
The identity matrix ones on the diagonal and zeros everywhere else corresponds to the identity transformation: (T_1)(x)=1*x=x, for all x
Using row operations
One approach for computing the inverse is to use the Gauss-Jordan elimination procedure. Start by creating an array containing the entries of the matrix A on the left side and the identity matrix on the right side:
[[1,2,1,0],[3,9,0,1]]
Now we perform the Gauss-Jordan elimination procedure on this array.
The first row operation is to subtract three times the first row from the second row: (R_2)←(R_2)-3*(R_1). We obtain:
[[1,2,1,0],[0,3,-3,1]]
The second row operation is divide the second row by 3: (R_2)←1/3*(R_2)
[[1,2,1,0],[0,1,-1,1/3]]
The third row operation is (R_1)←(R_1)-2*(R_2)
[[1,0,3,-2/3],[0,1,-1,1/3]]
The array is now in reduced row echelon form RREF. The inverse matrix appears on the right side of the array.
Observe that the sequence of row operations we used to solve the specific system of equations in A*x=b in the previous section are the same as the row operations we used in this section to find the inverse matrix. Indeed, in both cases the combined effect of the three row operations is to "undo" the effects of A. The right side of the 2×4 array is simply a convenient way to record this sequence of operations and thus obtain A(-1).
Using elementary matrices
Every row operation we perform on a matrix is equivalent to a left-multiplication by an elementary matrix. There are three types of elementary matrices in correspondence with the three types of row operations:
(R_α):(R_1)←(R_1)+m*(R_2)⇔(E_α)=[[1,m],[0,1]]
(R_β):(R_1)↔(R_2)⇔(E_β)=[[1,0],[0,1]]
(R_γ):(R_1)←m*(R_1)⇔(E_γ)=[[m,0],[0,1]]
Let's revisit the row operations we used to find A(-1) in the above section representing each row operation as an elementary matrix multiplication.
The first row operation (R_2)←(R_2)-3*(R_1) corresponds to a multiplication by the elementary matrix (E_1):
(E_1)*A=[[1,0],[-3,1]]*[[1,2],[3,9]]=[[1,2],[0,3]]
The second row operation (R_2)←1/3*(R_2) corresponds to a matrix (E_2):
(E_2)*((E_1)*A)=[[1,0],[0,1/3]]*[[1,2],[0,3]]=[[1,2],[0,1]]
The final step, (R_1)←(R_1)-2*(R_2), corresponds to the matrix (E_3):
(E_3)*((E_2)*(E_1)*A)=[[1,-2],[0,1]]*[[1,2],[0,1]]=[[1,0],[0,1]]
Note that (E_3)*(E_2)*(E_1)*A=1, so the product (E_3)*(E_2)*(E_1) must be equal to A(-1):
A(-1)=(E_3)*(E_2)*(E_1)=[[1,-2],[0,1]]*[[1,0],[0,1/3]]*[[1,0],[-3,1]]=[[3,-2/3],[-1,1/3]]
The elementary matrix approach teaches us that every invertible matrix can be decomposed as the product of elementary matrices. Since we know A(-1)=(E_3)*(E_2)*(E_1) then A=(A(-1))(-1)=((E_3)*(E_2)*(E_1))(-1)=(E_1)(-1)*(E_2)(-1)*(E_3)(-1)
More Cheat Sheets ->