Consider the linear system with , given. The scaling coefficients are sought and are said to be a solution of the linear system when the equation is satisfied. Orthogonal projectors and knowledge of the four fundamental matrix subspaces allows us to succintly express whether there exist no solutions, a single solution of an infinite number of solutions:
Consider the factorization , the orthogonal projector , and the complementary orthogonal projector
If , then has a component outside the column space of , and has no solution
If , then and the system has at least one solution
If (null space only contains the zero vector, i.e., null space of dimension 0) the system has a unique solution
If , then a vector in the null space is written as
and if is a solution of , so is , since
The linear system has an -parameter family of solutions
If a solution exists, it can be found by backsubstitution solution of . If multiple solutions exist, an orthonormal basis is found for the null space and the family of solutions is .
Suppose now that admits a unique solution. The factorization approach of reducing the problem to is one procedure to compute the solution. It has the benefit of working with the orthonormal matrix. Finding the orthonormal matrix is however a computational expense. Recall that orthogonality implied linear independence. Other approaches might exist that only impose linear independence, without orthogonality. Gaussian elimination is the main such approach. Consider the system
The idea is to combine equations such that we have one fewer unknown in each equation. Ask: with what number should the first equation be multiplied in order to eliminate from sum of equation 1 and equation 2? This number is called a Gaussian multiplier, and is in this case . Repeat the question for eliminating from third equation, with multiplier .
Now, ask: with what number should the second equation be multiplied to eliminate from sum of second and third equations. The multiplier is in this case .
Starting from the last equation we can now find , replace in the second to obtain , hence , and finally replace in the first equation to obtain .
The above operations only involve coefficients. A more compact notation is therefore to work with what is known as the "bordered matrix" and work with coefficients arising in rows
In Julia the above operations would be carried out as
∴ |
A=[1. 2 -1 2; 2 -1 1 2; 3 -1 -1 1]; A[2,:]=A[2,:]-2*A[1,:]; A[3,:]=A[3,:]-3*A[1,:]; |
∴ |
A |
(1)
∴ |
A[3,:]=A[3,:]-(7/5)*A[2,:]; A |
(2)
∴ |
Once the above triangular form has been obtained, the solution is found by back substitution, in which we seek to form the identity matrix in the first 3 columns, and the solution is obtained in the last column.
The operations arising in Gaussian elimination are successive linear combinations of rows that maintain the solution of the linear system. This idea is useful in identifying the fundamental subspaces associated with a matrix. The matrices arising at successive stages of the procedure are said to be similar to one another
and since is obtained by linear combination of the rows of , the row space is not changed
During the procedure a pivot element is identified in the diagonal position, as shown bordered above. If a zero value is encountered rows are permuted to bring a non-zero element to the pivot position. If a non-zero pivot value cannot be found by row permutation, one is sought by column permutations also. If a non-zero pivot cannot be found by either row or column permutations, the matrix is rank-deficient and has a non-trivial null space as in the following examples
The has an infinite number of solutions, while the system has no solutions. Note that has a row of zeros, hence the rows must be linearly dependent and . By the FTLA when an infinite number of solutions is obtained, and for no solutions are obtained.
The rows with non-zero pivot elements are linearly independent, and reduction to the above row-echelon form is useful to identify the rank of a matrix. The first non-zero entry on a row is called either a pivot or a leading entry. A matrix is said to be brought to reduced row-echelon form when:
all zero rows are below non-zero rows;
in each non-zero row, the leading entry is to the left of lower leading entries;
each leading entry equals 1 and is the only non-zero entry in its column.
In contrast to the Gram-Schmidt procedure, Gaussian elimination does not impose orthogonality between rows, nor that a row have unit norm. This leads to fewer computations, and is therefore well-suited to hand computation of small-dimensional matrices.
The steps in Gaussian elimination can be precisely specified in a format suitable for direct computer coding.
Algorithm Gauss elimination without pivoting
for to
for to
for to
for downto 1
for to
return
The variant of the above algorithm that accounts for possible zeros arising in a diagonal position is known as Gauss elimination with pivoting.
Algorithm Gauss elimination with partial pivoting
(initialize row permutation vector)
for to
piv =
for to
mag =
if then
if then break(“Singular matrix”)
for to
for downto 1
for to
return
The operations arising in Gaussian elimination correspond to a matrix factorization, analogous to how the Gram-Schmidt procedure can be stated as the factorization. Revisting the previous example
the idea is to express linear combinations of rows as a matrix multiplication. Recall that is a linear combination of columns, and expresses multiple column linear combinations. Linear combinations of columns are expressed as products in which the first factor contains the columns and the second contains the scaling coefficients. Analogously linear combinations of rows are expressed by products where now the left factor contains the scaling coefficients entering into a linear combination of the rows of . For example, the first stage of Gaussian elimination for the above system can be expressed as
The next stage is also expressed as a matrix multiplication, after which an upper triangular matrix is obtained
For a general matrix the sequence of operations is
with , and the matrix obtained after step of row echelon reduction (or, equivalently, Gaussian elimination) is called a Gaussian multiplier matrix.
The inverse of a Gaussian multiplier is
From obtain
The above is known as an factorization, short for lower-upper factorization. Solving a linear system by -factorization consists of the steps:
Find the factorization
Insert the factorization into to obtain , where the notation has been introduced. The system
is easy to solve by forward substitution to find for given
Finally find by backward substitution solution of
The various procedures encountered so far to solve a linear system are described in the following table.
Given
Singular value decomposition |
Gram-Schmidt |
Lower-upper |
Transformation of coordinates |
|
|
|
|
|
|
, |
y |
|
) |
(back sub to find ) |
|
|
|
For the pseudo-inverse has been introduced based on the , as
When is square and of full rank the system has a solution that can be stated as , where is the inverse of . The matrix is said to be invertible such that
and in this case is the inverse of .
The inverse can be computed by extending Gauss elimination
a procedure known as the Gauss-Jordan algorithm.
A square matrix has an inverse only when it is of full rank. The following are equivalent statements:
invertible
has a unique solution for all
has a unique solution
The reduced row echelon form of is
can be written as product of elementary matrices