Solve a set of linear (variables with first power) equations.
If we have a system of equations that is of an upper- triangular form
Then, we have the solution as:
If NOT: Change the matrix of coefficientsupper-triangular. Consider this example of three equations:
Now we have a triangular system and the solution is readily obtained;
obviously from the third equation,
and back-substitution into the second equation gives .
We continue with back-substitution by substituting both , and into the first equation to get .
Notice to the values in this example. They are getting bigger!
The essence of any elimination method is to reducethe coefficient matrixto a triangular matrix and then use back-substitution to get the solution.
We now present the same problem, solved in exactly the same way, in matrix notation;
So we work with the matrix of coefficients augmented with the right-hand-side vector.
We perform elementary row transformations to convert A to upper-triangular form:
The back-substitution step can be performed quite mechanically by solving the equations in reverse order. That is,
. Same solution with the non-matrix notation.
During the triangularization step, if a zero is encountered on the diagonal, we cannot use that row to eliminate coefficients below that zero element.
However, in that case, we can continue by interchanging rows and eventually achieve an upper-triangular matrix of coefficients.
The real trouble is finding a zero on the diagonal after we have triangularized.
If that occurs, the back-substitution fails, for we cannot divide by zero.
It also means that the determinant is zero. There is no solution.
Possible approaches for the solution of the following system of equations with coefficient matrix .
1
Cramer's rule.
Let's denote the matrix by in which the right-hand-side vector are substituted to the column of matrix.
e.g., the solution for is expressed as:
Similarly, the solutions and can be written.
This method is very convenient when the number of unknowns is as few as 3-5.
However, it is not feasible for systems with a large number of unknowns since determinant calculation requires many multiplication operations.
For example, calculating a
determinant with Cramer's rule requires
multiplications!
2
Inverse matrix. Another solution is to use the matrix, which is the inverse of the A matrix.
Multiplying both sides of the equation
by and considering that ,
However, this approach is also not reasonable since calculating matrix inverses requires a large number of operations.