I was reading this question which says that to solve the cramer method $(n + 1)$ operations are used.Then I thought that the complexity of using the equal method would be given by $ (n + 1) $, but apparently it is not. In this question they say that it is $ O (n! × n) $, but I don't know if I'm fine anymore. How can you get the value of the complexity of using the method?
Asked
Active
Viewed 260 times
0
-
they forgot an ! – Jun 07 '20 at 18:15
-
sorry, who forgot the !? and which part? – Johan C Jun 07 '20 at 18:21
1 Answers
2
That depends on how you compute the determinants. There are $(n+1)$ determinants in play. There are algorithms to compute determinants algebraically in $O(n^4)$, so you would get a total of $O(n^5)$ for Cramer.
But these algorithms compute at the same time as the determinant also the adjoint matrix, which means that all determinants for Cramer can be computed in $O(n^4)$.
Numerically, the best way to compute a determinant is via a LU or QR decomposition. As that also leads to an easy solver for the linear system, you could solve the task in $O(n^3)$

Lutz Lehmann
- 126,666
-
Im trying whit this method: $x_k= \frac{|A_k|}{|A|}$, used in $Ax=b$ systems – Johan C Jun 07 '20 at 19:30
-
-Yes, that is Mr. Cramer's method. Using $n+1$ determinants, etc. – Lutz Lehmann Jun 07 '20 at 19:38
-
but wouldn't it be something like that?: finding the determinant of a n×n matrix, you need to find n! products. And since you need to find the determinants of n matrices, you need to do on the order of n!n multiplications. – Johan C Jun 07 '20 at 19:42
-
-
-
I agree, but would it be nice to say that the complexity of the method is n!n, or is this not true? – Johan C Jun 07 '20 at 19:52