- Calculating the inverse of a matrix
- Method 1: Using Gaussian Elimination
- System solution
- Method 2: using attached matrix
- Inverse matrix formula
- Exercise resolved
- References
The inverse matrix of a given matrix is the matrix that multiplied by the original gives the identity matrix. The inverse matrix is useful for solving systems of linear equations, hence the importance of knowing how to calculate it.
Matrices are very useful in physics, engineering, and mathematics, as they are a compact tool for solving complex problems. The utility of matrices is enhanced when they are invertible and their inverse is also known.
Figure 1. A generic 2 × 2 matrix and its inverse matrix are shown. (Prepared by Ricardo Pérez)
In the fields of graphic processing, Big Data, Data Mining, Machine Learning and others, efficient and fast algorithms are used to evaluate the inverse matrix of nxn matrices with very large n, in the order of thousands or millions.
To illustrate the use of the inverse matrix in handling a system of linear equations, we will start with the simplest case of all: 1 × 1 matrices.
The simplest case: a linear equation of a single variable is considered: 2 x = 10.
The idea is to find the value of x, but it will be done "matrix".
The matrix M = (2) that multiplies the vector (x) is a 1 × 1 matrix that results in the vector (10):
M (x) = (10)
The inverse of the matrix M is denoted by M -1.
The general way to write this "linear system" is:
MX = B, where X is the vector (x) and B is the vector (10).
By definition, the inverse matrix is the one that multiplied by the original matrix results in the identity matrix I:
M -1 M = I
In the case considered, the matrix M -1 is the matrix (½), that is, M -1 = (½) since M -1 M = (½) (2) = (1) = I
To find the unknown vector X = (x), in the proposed equation, both members are multiplied by the inverse matrix:
M -1 M (x) = M -1 (10)
(½) (2) (x) = (½) (10)
(½ 2) (x) = (½ 10)
(1) (x) = (5)
(x) = (5)
An equality of two vectors has been reached, which are equal only when their corresponding elements are equal, that is, x = 5.
Calculating the inverse of a matrix
What motivates the calculation of the inverse matrix is to find a universal method for the solution of linear systems such as the following 2 × 2 system:
x - 2 y = 3
-x + y = -2
Following the steps of the 1 × 1 case, studied in the previous section, we write the system of equations in matrix form:
Figure 2. Linear system in matrix form.
Note that this system is written in compact vector notation as follows:
MX = B
where
The next step is to find the inverse of M.
Method 1: Using Gaussian Elimination
The Gaussian elimination method will be applied. Which consists of doing elementary operations on the rows of the matrix, these operations are:
- Multiply a row by a non-zero number.
- Add or subtract another row from a row, or the multiple of another row.
- Swap the rows.
The objective is, through these operations, to convert the original matrix into the identity matrix.
As this is done, in matrix M exactly the same operations are applied to the identity matrix. When, after several operations on the rows, M is transformed to the unit matrix, then the one that was originally the unit will become the inverse matrix of M, that is, M -1.
1- We begin the process by writing the matrix M and next to it the unit matrix:
2- We add the two rows and we put the result in the second row, in this way we obtain a zero in the first element of the second row:
3- We multiply the second row by -1 to obtain 0 and 1 in the second row:
4- The first row is multiplied by ½:
5- The second and the first are added and the result is placed in the first row:
6- Now to finish the process, the first row is multiplied by 2 to obtain the identity matrix in the first row and the inverse matrix of the original matrix M in the second:
That is to say:
System solution
Once the inverse matrix is obtained, the system of equations is solved by applying the inverse matrix to both members of the compact vector equation:
M -1 M X = M -1 B
X = M -1 B
Which explicitly looks like this:
Then matrix multiplication is carried out to obtain vector X:
Method 2: using attached matrix
In this second method the inverse matrix is calculated from the adjoint matrix of the original matrix A.
Suppose a matrix A given by:
where i, j is the element in row i and column j of the matrix A.
The adjoint of matrix A will be called Adj (A) and its elements are:
ad i, j = (-1) (i + j) ¦Ai, j¦
where Ai, j is the complementary lower matrix obtained by eliminating the row i and column j of the original matrix A. The bars ¦ ¦ indicate that the determinant is calculated, that is , ¦Ai, j¦ is the determinant of the minor complementary matrix.
Inverse matrix formula
The formula to find the inverse matrix starting from the adjoining matrix of the original matrix is as follows:
Is, the inverse matrix of A, A -1, is the transpose of the adjoint of A divided by the determinant of A.
The transpose A T of a matrix A is obtained by exchanging rows for columns, that is, the first row becomes the first column and the second row becomes the second column and so on until the n rows of the original matrix are completed.
Exercise resolved
Let the matrix A be the following:
Each and every element of the adjoint matrix of A is calculated: Adj (A)
Resulting in that the adjoint matrix of A, Adj (A) is the following:
Then the determinant of matrix A, det (A) is calculated:
Finally the inverse matrix of A is obtained:
References
- Anthony Nicolaides (1994) Determinants & Matrices. Pass Publication.
- Awol Assen (2013) A Study on the Computation of the Determinants of a 3 × 3
- Casteleiro Villalba M. (2004) Introduction to linear algebra. ESIC Editorial.
- Dave Kirkby (2004) Maths Connect. Heinemann.
- Jenny Olive (1998) Maths: A Student's Survival Guide. Cambridge University Press.
- Richard J. Brown (2012) 30-Second Maths: The 50 Most Mind-Expanding Theories in Mathematics. Ivy Press Limited.
- Matrix. Lap Lambert Academic Publishing.