Professional Documents
Culture Documents
Cramer’s Rule
Introduction
Example
Advantages and Disadvantages
Gauss Elimination
Introduction and Rules
Example
Matrix Version and Example
Advantages and Disadvantages
Homework
Graphical interpretation
Solvable and unsolvable problems
Linear dependence and independence
Ill-conditioning
Part II
x1 − x2 + x3 = 3
2x1 + x2 − x3 = 0
3x1 + 2x2 + 2x3 = 15
|[A]| = 12
|[A1 ]| = 12
|[A2 ]| = 24
|[A3 ]| = 48
x1 − x2 + x3 = 1 − 2 + 4 = 3
2x1 + x2 − x3 = 2 + 2 − 4 = 0
3x1 + 2x2 + 2x3 = 3 + 4 + 8 = 15
Advantages
Easy to remember steps
Disadvantages
Computationally intensive compared to other methods: the
most efficient ways of calculating the determinant of an n × n
matrix require (n − 1)(n!) operations. So Cramer’s rule would
require (n − 1)((n + 1)!) total operations. For 8 equations,
that works out to 7(9!) = 2540160 operations, or around 700
hours if you can perform one operation per second.
Roundoff error may become significant on large problems with
non-integer coefficients.
Gauss Elimination
Notice that we can solve for TF using only the sixth equation in
the system. That is, TF = P43 . After solving for TF , we can solve
for TE using only the fifth equation. The pattern continues,
back-substituting through the system of equations until finally we
solve for TA using the first equation.
2x1 − x2 + x3 = 4 (1)
4x1 + 3x2 − x3 = 6 (2)
3x1 + 2x2 + 2x3 = 15 (3)
To eliminate the 4x1 term in Equation 2, multiply Equation 1 by 2
and subtract it from Equation 2. To eliminate the 3x1 term in
Equation 3, multiply Equation 1 by 23 and subtract it from
Equation 3. This gives a system of equations
2x1 − x2 + x3 = 4 (4)
5x2 − 3x3 = −2 (5)
7 1
x 2 + x3 = 9 (6)
2 2
2x1 − x2 + x3 = 4 (7)
5x2 − 3x3 = −2 (8)
13 52
x3 = (9)
5 5
where the first n columns are the elements of the original [A]
matrix, and the last column is the elements of the original {b}
matrix.
Example
Example (continued)
Example (continued)
Example (continued)
Example (continued)
Example (continued)
2x1 − x2 + x3 = 4 (10)
5x2 − 3x3 = −2 (11)
2.6x3 = 10.4 (12)
Example (continued)
2x1 − x2 + x3 = 2(1) − 2 + 4 =4
4x1 − 3x2 − x3 = 4(1) + 3(2) − 4 =6
3x1 + 2x2 + 2x3 = 3(1) + 2(2) + 2(4) = 15
Advantages
Much less computation required for larger problems. Gauss
3
elimination requires n3 multiplications to solve a system of n
equations. For 8 equations, this works out to around 170
operations, versus the roughly 2.5 million operations for
Cramer’s rule.
Disadvantages
Not quite as easy to remember the procedure for hand
solutions.
Roundoff error may become significant, but can be partially
mitigated by using more advanced techniques such as pivoting
or scaling.
Homework