0

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?

cmk
  • 12,303
Johan C
  • 35

1 Answers1

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