# Calculation of the inverse matrix - Number of operations

• MHB
• mathmari
In summary, the conversation discusses the different methods for calculating the inverse of a regular matrix. The Gauss algorithm is possible for such matrices and choosing the unit vectors as the right side allows for the calculation of the inverse matrix. It can be calculated with $n^3+O(n^2)$ operations using Gaussian elimination with back-substitution. However, using LU-decomposition or QR-decomposition with Householder reflections can require more operations. Older references may neglect addition in their operation counts, but for Gauss-Jordan, the count is the same as Gaussian elimination with back-substitution.
mathmari
Gold Member
MHB
Hey!

Let A be a regular ($n\times n$)-Matrix, for which the Gauss algorithm is possible.

If we choose as the right side $b$ the unit vectors $$e^{(1)}=(1, 0, \ldots , 0)^T, \ldots , e^{(n)}=(0, \ldots , 0, 1 )^T$$ and calculate the corresponding solutions $x^{(1)}, \ldots , x^{(n)}$ then the inverse matrix is $A^{-1}=[x^{(1)}, \ldots , x^{(n)}]$.

We can calculate the inverse with $n^3+O(n^2)$ operations. (1 operation = 1 multiplication or division)
If we calculate the solutions $x^{(1)}, \ldots , x^{(n)}$ with the using the LU-decomposition we get $\frac{4}{3}n^3+O(n^2)$ operations, or not?

It is because we apply the the Gauss algorithm which requires $\frac{1}{3}n^3+O(n^2)$ operations, right?

How do we get $n^3+O(n^2)$ ?

Do we have to use an other algorithm here?

mathmari said:
Hey!

Let A be a regular ($n\times n$)-Matrix, for which the Gauss algorithm is possible.

If we choose as the right side $b$ the unit vectors $$e^{(1)}=(1, 0, \ldots , 0)^T, \ldots , e^{(n)}=(0, \ldots , 0, 1 )^T$$ and calculate the corresponding solutions $x^{(1)}, \ldots , x^{(n)}$ then the inverse matrix is $A^{-1}=[x^{(1)}, \ldots , x^{(n)}]$.

We can calculate the inverse with $n^3+O(n^2)$ operations. (1 operation = 1 multiplication or division)
If we calculate the solutions $x^{(1)}, \ldots , x^{(n)}$ with the using the LU-decomposition we get $\frac{4}{3}n^3+O(n^2)$ operations, or not?

Hey mathmari! (Smile)

LU-decomposition is listed here as $\frac 23 n^3 +O(n^2)$, while QR-decomposition with Householder reflections (for numerical stability) is $\frac 43n^3+O(n^2)$. (Nerd)

mathmari said:
It is because we apply the the Gauss algorithm which requires $\frac{1}{3}n^3+O(n^2)$ operations, right?

How do we get $n^3+O(n^2)$ ?

Do we have to use an other algorithm here?

That's indeed to get the matrix in row echelon form.
Afterwards we still need to solve it for each of the n unit vectors, which takes $\frac 12 n^3 + O(n^2)$ extra if I'm no mistaken. (Thinking)

mathmari said:
We can calculate the inverse with $n^3+O(n^2)$ operations. (1 operation = 1 multiplication or division)

When comparing operation counts for different methods and from different references, it is perhaps useful (but maybe already known to all participating, in which case I apologize for stating the obvious) that older references sometimes neglect addition (which includes subtraction) because multiplication (which includes division) used to be the determining factor, as it was much slower.

I learned that inversion using Gaussian elimination with back-substitution costs $n^3$ multiplications (exactly) and $n^3 + O(n^2)$ additions. Interestingly, for Gauss-Jordan the count is precisely the same.

(Elimination with back-substitution for one system costs $\frac{n^3}{2} + O(n^2)$ multiplications and $\frac{n^3}{2} + O(n)$ (no typo) additions.)

## 1. How do you calculate the inverse matrix?

To calculate the inverse matrix, you can use the Gauss-Jordan elimination method. This involves row operations on the original matrix until it is transformed into an identity matrix. The resulting matrix will be the inverse of the original matrix.

## 2. What is the purpose of finding the inverse matrix?

The inverse matrix is used to solve systems of linear equations, as it allows us to find the values of the variables in the equations. It is also useful in applications such as computer graphics and cryptography.

## 3. How do you determine the number of operations required to calculate the inverse matrix?

The number of operations required to calculate the inverse matrix depends on the size of the original matrix. For an n x n matrix, it typically requires n^3 operations using the Gauss-Jordan elimination method.

## 4. Can the inverse matrix always be calculated?

No, not all matrices have an inverse. A matrix must be square and have a nonzero determinant in order to have an inverse.

## 5. Are there any shortcuts or alternative methods for calculating the inverse matrix?

Yes, there are other methods such as the LU decomposition method and the adjugate matrix method. These methods may require fewer operations for certain types of matrices, but they are more complex and may not always be applicable.

Replies
4
Views
2K
Replies
1
Views
884
Replies
22
Views
3K
Replies
14
Views
2K
Replies
4
Views
2K
Replies
10
Views
1K
Replies
2
Views
1K
Replies
2
Views
864
Replies
2
Views
1K
Replies
36
Views
7K