We study the algorithm for finding the inverse matrix by two basic methods: the Gauss method and with the help of the union matrix.
You will need
- - mindfulness
- - knowledge of the methodology
Suppose that we are given a matrix A of a certain size.
The inverse matrix of the matrix A isMatrix B, multiplying which by the original matrix A, we obtain the unit matrix E. The inverse matrix can be found only for a square matrix whose determinant is not equal to zero. The matrix B is calculated as follows:
1. Starting from the very first element, we go along the line from left to right, for each element we mentally delete the row and column into which it enters, calculate the determinant of the remaining matrix (the value of the minor) and write it into the new matrix. BUT! If we take the current element from the original matrix, passing successively along the lines, then we write them into the new matrix in the new column. That's not all.
2. The signs of the elements obtained, beginning with the first, will alternate through one - this is a crude formulation. Exactly, the sign is determined by the expression -1 to the power of the sums of the indices of the given element, that is, the sum of the row and column number in which it is located. In other words, the opposite sign must be changed for elements that have an odd sum of indices.
3. Before the resulting matrix B is obtained, the coefficient 1 / (determinant of the original matrix A).
This is only one of the possible methods. You can also use the Gauss method. It consists in taking the original matrix A and the unit matrix E. Applying the transformations of rows or columns (we can subtract or add the corresponding columns or rows or multiply them by a number) to both of them simultaneously we bring A to E. Then the second resulting matrix will be Reverse, that is, B.
To check the correctness of your calculations is very simple: multiply the original matrix A and the inverse matrix B. If the unit matrix E is obtained, then all the actions are done correctly.