CAUTION: Cramer's Rule is Computationally Expensive
Special Notes for MCS 471
Recursive Computational Formulae:
- Determinants: fln(det) =
n*(fln-1(det)+2)-1 flops
when computing nth order determinants (each nth order
determinant can be expanded as a sum of (n-1)st order determinants each
multiplied by the elements of the row or column expanded by.
- Cramer's Rule: fln(cr)
(n+1)*(fln(det)+1)-1 flops
for solving nth order algebraic systems of equations (A*x=b)
(there are n components of the solution and each component by Cramer's
rule is the quotient of the nth order determinant of the co-factor matrix
that is found by replace the ith column of the coefficient matrix by the
right hand side vector b then dividing the co-factor determinant by the
determinant of A).
Asymptotic Analysis:
- The main idea is assuming the fln(det) ~ cn*n! for some bounded factor cn
with c1 := 0,
using this relation in the determinant recursion relation, solving the
resulting recursion for cn and finding that it
is the first (n-1) terms of the exponential series of
e1 := e with the remainder going quickly to
zero as n ---> infinity by Taylor's theorem with remainder
and an exponential generalization of Stirling's approximation given below.
- Determinant Computational Work fln(det) ~ e*n! flops
as n ---> infinity when computing nth order
determinants.
- Cramer's Rule Computational Work fln(cr) ~ e*(n+1)! flops
as n ---> infinity when solving nth
order algebraic systems of equations.
Assumptions:
- MegaFlop Machine at 1µsec/flop or Tn(cr)
= fln(cr)*10(-6).
- Precision with chopping to the nearest 1 digit decimal.
Computational Estimate as Function of Problem Size n:
Problem Order n |
fln(cr) (flops) |
Tn(cr) (time units) |
Comments |
1 | 1F | 1µs |
F = flops, microseconds = µs = 10(-6)s |
2 | 10F | 10µs | " |
3 | 60F | 60µs | " |
4 | 300F | 300µs | " |
5 | 2KF | 2ms |
KF = KiloFlops = 103flops, milliseconds = ms = 10(-3)s |
6 | 10KF | 10ms | " |
7 | 100KF | 100ms | " |
8 | 1MF | 1s |
MF = MegaFlops = 106flops, seconds = s |
9 | 10MF | 10s | " |
10 | 100MF | 2min | " |
11 | 1GF | 20min |
GF = GigaFlops = 109flops |
12 | 20GF | 5hours | " |
13 | 200GF | 3days | " |
14 | 4TF | 6weeks |
TF = TeraFlops = 1012flops |
15 | 60TF | 2years | " |
16 | 1PF | 30decades |
PF = PetaFlops = 1015flops |
17 | 20PF | 6centuries | " |
18 | 300PF | 10Kyears |
1Kyear = 103years = 1 Millenium |
19 | 7EF | 200Kyears |
EF = ExaFlops = 1018flops |
20 | 100EF | 4Myears | Myears = Million years |
flops := Floating point operations (i.e., +, -, *, /)
Computational Estimate as Function of Machine Performance:
Order Machine Performance |
Problem 10×10 |
Problem 20×20 |
Comments |
100KFLOPS | 20min | 40Myrs |
old PC;M = Mega := 106, K = Kilo := 103 |
MegaFLOPS | 2min | 4Myrs | typical workstation; M = Mega := 106 |
GigaFLOPS | 0.1sec | 4Kyrs | typical supercomputer; G = Giga := 109 |
TeraFLOPS | 0.1msec | 4yrs | ultracomputer for ca. 1995; Tera := 1012 |
Mileage will vary with computers, but do not even think about computing with
Cramer's rule for n>4, say.
flops := FLoating point operations (i.e., +, -, *, /)
FLOPS := FLoating point OPerations per Second (i.e., +, -, *, /
per sec)
Gaussian Elimination with Back Substitution
~ (2/3)*n3 FLOPS,
n ---> infinity, so a 20×20 can be solved in time ~ 5msec.,
on a MFLOPS workstation.
100×100 case data: J. J. Dongarra, LINPACK Benchmark: Performance
of Various Computers Using Standard Linear Equations Software,
Supercomputing Review, vol. 5, pp. 54-63, March 1992.
Compare with Hanson-Stirling's exponential-formula:
n! ~ sqrt{2*Pi*n}e-nnn as n ---> infinity.
F. B. Hanson
MCS 471 Coordinator
Web Source: http://www.math.uic.edu/~hanson/cramers.html
Email Comments or Questions to
hanson@uic.edu