Finding the inverse of a matrix
In the evening class we started finding out the inverse of the coefficient matrix in problem 13(a) section 1.3. The matrix was:
| > | with(LinearAlgebra); |
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
| > | A:=Matrix([[2,-3,5],[9,-1,1],[1,5,4]]); |
| > |
We started the algorithm of finding the inverse by defining the augmented matrix:
| > | A1:=Matrix([[2,-3,5,1,0,0],[9,-1,1,0,1,0],[1,5,4,0,0,1]]); |
The algorithm says that if we can bring A to its reduced row echelon form with three ones, then in the augmented matrix from above we will get the inverse in the last three columns. We can do this directly by the command:
| > | ReducedRowEchelonForm(A1); |
But this is not the point. We want to "record" the row operations that need to be done in elementary matrices. So here are the steps. we first swap first and third row to get a pot in row 1.
| > | E1:=Matrix([[0,0,1],[0,1,0],[1,0,0]]); |
| > | A2:=Multiply(E1,A1); |
Next we do Row2- 9*Row1 and Row3-2*Row1:
| > | E2:=Matrix([[1,0,0],[-9,1,0],[0,0,1]]); |
| > | A3:=Multiply(E2,A2); |
| > | E3:=Matrix([[1,0,0],[0,1,0],[-2,0,1]]); |
| > | A4:=Multiply(E3,A3); |
Now, since Maple can handle computations much better than humans, we divide the second row by -46 and proceed to get zeros on the second column.
| > | E4:=Matrix([[1,0,0],[0,-1/46,0],[0,0,1]]); |
| > | A5:=Multiply(E4,A4); |
| > | E5:=Matrix([[1,0,0],[0,1,0],[0,13,1]]); |
| > | A6:=Multiply(E5,A5); |
| > | E6:=Matrix([[1,0,0],[0,1,0],[0,0,46/317]]); |
| > | A7:=Multiply(E6,A6); |
| > | E7:=Matrix([[1,0,0],[0,1,-35/46],[0,0,1]]); |
| > | A8:=Multiply(E7,A7); |
| > | E8:=Matrix([[1,0,-4],[0,1,0],[0,0,1]]); |
| > | A9:=Multiply(E8,A8); |
| > | E9:=Matrix([[1,-5,0],[0,1,0],[0,0,1]]); |
| > | A10:=Multiply(E9,A9); |
And as you can see we obtained the reduced-row-echelon form of the matrix. Moreover, the matrix on the right represents he product of all elementary matrices E1 through E9: E9*E8*E7*E6*E5*E4*E3*E2*E1.
| > |