I am not sure if Cramer's rule is used for computation purposes. Your help would mean a lot. Thanks!
Asked
Active
Viewed 4,878 times
9
-
no. check some linear analisys book. like burden or Kincaid – L F Oct 06 '15 at 11:56
-
1It has rather theoretical importance. It is used to prove some theorems in linear algebra. – Oct 06 '15 at 12:00
-
See this as well. – J. M. ain't a mathematician Oct 06 '15 at 14:43
-
Cramer's rule is often handy for small, fixed-size matrices like 3x3. I use it in computer graphics work occasionally. – Tavian Barnes Oct 06 '15 at 17:41
-
1Actually I would go a step further than "don't use Cramer's rule". If you are calculating the determinant or the inverse of a matrix as part of a bigger algorithm, that is almost always a bad thing to do. Mathematical formulas using matrix inverses often look neat, but that doesn't mean they are the best way to calculate something. – alephzero Oct 06 '15 at 18:16
-
Certainly, if you are solving a system of two equations ;) – Carsten S Oct 06 '15 at 19:08
2 Answers
15
Cramer is highly inefficient, of time complexity $O(n! \times n)$ with a naive determinant-finding algorithm, and $O(n^4)$ with e.g. LU decomposition. Gaussian elimination has cubic complexity.

Patrick Stevens
- 36,135
-
3That's only if the deteminant is computer by definition. It may be computed by LU decomposition as well, in which case the complexity would be $O(n^4)$. – Sasha Oct 06 '15 at 11:56
-
-
On a tangent: is there a difference between $O(n! \times n)$ and $O(n!)$? I'm thinking $O(n! \times n) \approx O((n+1)!) \approx O(n!)$? – Nick T Oct 06 '15 at 21:06
-
2$O((n+1)!)$ is not $O(n!)$ any more than $O(n^{k+1})$ is $O(n^k)$. – R.. GitHub STOP HELPING ICE Oct 06 '15 at 21:22
4
Reducing the matrix to triangular form and multiplying the elements on the diagonal is usually quicker. I am pretty sure that is the algorithm most computer algebra systems use, unless it is known in advance that the matrix has some special properties. Sometimes Laplace expansion can be quicker if the matrix has many zeros along some rows/columns.

GFR
- 5,401