Professional Documents
Culture Documents
is an nth order linear equation, where x1 , x2 , x3 , · · · xn are variables, a11 , a12 , a13 x3 , · · · a1n are
coefficients and b1 is a constant.
Following shows the system of linear equations.
(iii) Any row (equation) can be replaced by a weighted linear combination of that row (equa-
tion) with any other row (equation) (elimination).
In the Gaussian Elimination process, first form the augmented matrix [A|B],
0 . 1
a11 a12 a13 · · · · · · · · · a1n .. b1
B C
B a21 a22 a23 · · · · · · · · · a2n ... b2 C
B C
B .
. C
A = B a31 a32 a33 · · · · · · · · · a3n . b3 C .
B C
B .. .. .. .. .. .. C
@ . . . . . .A
.
an1 an2 an3 · · · · · · · · · ann .. bn
This matrix represents a linear system with the same solution set as the original system.
so backward substitution can be performed. Solving the nth equation for xn gives
(n)
bn
xn = (n)
(5)
ann
Solving the (n 1)th equation for xn 1 and using the known value for xn yields
(n 1) (n 1)
bn 1 an
1,n xn
xn 1 = (n 1)
(6)
an 1,n 1
1.1.2 Pivoting
The pivot element for a specific column is the entry or element that is used to place zeros in
the other entries in that column. The elimination procedure described so far fails immediately
if the first pivot element a11 is zero. The procedure also fails if any subsequent pivot element
(k)
aii is zero. To avoid this situation, row interchange was needed. This row interchange has the
(k)
form Rk $ Rp , where p is the smallest integer greater than k with apk 6= 0.
Even when the pivot elements are not zero (but very small compared to the other entries
in that column), it is often necessary to perform row interchanges to reduce round-o↵ error.
As an example, the exact solution of the system
is x1 = 10 and x2 = 1. Using Gaussian elimination with four digit aithmetic rounding (finite-
digit arithmetic), the approximation solution to the system (7) is x1 = 10.00 and x2 = 1.001.
There is a huge di↵erence between the exact and approximated solution of x1 . When performing
the backward substitution for x1 , any error in the numerator can be dramatically increased
(1)
because of the division by a small value of a11 = 0.003. To avoid this, row interchanges has to
be performed.
(k)
If the pivot element akk is small relative to the entries in the same column that is below the
diagonal, select an element in the same column that has the largest absolute value; specifically,
we determine the smallest p k such that
(k) (k)
|apk | = max |aik |
kin
and perform Rk $ Rp .
Scaled pivoting
Another situation that the round-o↵ error can dominate the calculations is when the mag-
nitudes of the pivot elements are smaller than the magnitudes of the other elements in the
equations (or row) containing the pivot elements. In such cases, scaling is employed to select
the pivot elements.
Let si = max1jn |aij |. If si 6= 0, select the row. Rp , p i with
|aki |
max
ikn sk
1.1.3 LU factorization
Another approach to solve system of linear equations is factorization. Suppose that A has
been factored into the triangular form A = LU , where L is lower triangular and U is upper
triangular. Then we can solve for X~ more easily by using a two-step process.
AX~ =B
~ (8)
~ =B
LU X ~ (9)
• First we let Y~ = U X
~ and solve the lower triangular system LY~ = B ~ for Y~ using forward
substitution. Since L is triangular, determining Y~ from this equation requires only O(n2 )
operations.
Solving a linear system AX ~ =B~ in factored form means that the number of operations needed
to solve the system AX ~ = B~ is reduced from O(n3 /3) to O(2n2 ). The reductions from the
factorization come at a cost; determining the specific matrices L and U requires O(n3 /3)
operations. But once the factorization is determined, systems involving the matrix A can be
~
solved in this simplified manner for any number of vectors B.
To see which matrices have an LU factorization and to find how it is determined, see the
following theorem.
Specifying the diagonal elements of either L or U makes the factoring unique. The procedure
based on unity elements on the main diagonal of L is called the Doolittle’s method.
ALGORITHM
~ =B
This factorization can be used if AX ~ can be solved using Gaussian elimination without
row interchanges. Practically, for some matrices, row interchanges needed to perform in order
to reduce round-o↵ error. Now consider the modifications of factorization that must be made
when row interchanges are required.
Permutation Matrix
An n ⇥ n permutation matrix P = [pij ] is a matrix obtained by rearranging the rows of In ,
the identity matrix. This gives a matrix with precisely one nonzero entry in each row and in
each column, and each nonzero entry is a 1.
Two important properties of permutation matrix, P , are,
(i) P A permutes or rearrange the rows of A
1 1
(ii) P exists and P = PT.
By using the permutation matrix, the equations in the system can be rearranged to proceed
Gaussian elimination without row interchanges. That is, for any nonsingular matrix A, a
permutation matrix P exists for which the system
~ = PB
P AX ~ (10)
can be solved without row interchanges. As a consequence, this matrix P A can be factored
into
P A = LU,
1
where L is lower triangular and U is upper triangular. Because P = P T , this produces the
factorization
A = P 1 LU = (P T L)U. (11)
The matrix U is still upper triangular, but P T L is not lower triangular unless P = I.
Theorem 3 The symmetric matrix A is positive definite if and only if Gaussian elimination
without row interchanges can be performed on the linear system AX ~ =B ~ with all pivot elements
positive. Moreover, in this case, the computations are stable with respect to the growth of round-
o↵ errors.
The following two corollaries occur when constructing the proof of the above theorem.
Corollary 1 The matrix A is positive definite if and only if A can be factored in the form
LDLT , where L is lower triangular with 1s on its diagonal and D is a diagonal matrix with
positive diagonal entries.
Corollary 2 The matrix A is positive definite if and only if A can be factored in the form
LLT , where L is lower triangular with nonzero diagonal entries.
The matrix L in these Corollaries are not the same. LLT factorization is called Cholesky
or positive definite decomposition.
ALGORITHM
The above Algorithm provides a stable method for factoring a positive definite matrix into
the form A = LDLT , but it must be modified to solve the linear system AX ~ = B.~ To do this,
we delete the STOP statement from Step 5 in the algorithm and add the following steps to
solve the lower triangular system LY~ = B:
~
CHOLESKY ALGORITHM
To factor the positive definite n ⇥ n matrix A into LLT , where L is lower triangular:
INPUT the dimension n; entries aij , for 1 i, j n of A.
OUTPUT the entries lij , for 1 j i and 1 i n of L.
(The entries of U = LT are uij = lji , for i j n and 1 i n.)
~ =B
To solve the system AX ~ delete the STOP statement from Step 7 and add the following
steps.
where 0 1
a11 a12 0 ··· ··· 0 0 0
Ba21 a22 a23 ··· ··· 0 0 0 C
B C
B 0 a32 a33 a34 ··· 0 0 0 C
B . .. .. .. .. .. .. C
B . C
B . . . . . . . C
A=B . .. .. .. .. .. .. C.
B .. . . . . . . C
B C
B0 0 0 · · · an 2,n an an 2,n 1 0 C
B 3 2,n 2 C
@0 0 0 ··· ··· an 1,n 2 an 1,n 1 an 1,n A
0 0 0 ··· ··· 0 an,n 1 an,n
Suppose the tridiagonal matrix A can be factored into the triangular matrices L and U ,
that also have the form tridiagonal form.
0 1 0 1
l11 0 0 · · · ··· 0 1 u12 0 · · · · · · 0
B C
Bl21 l22 0 · · ·
B ··· 0 CC B0 1 u23 . . . 0 C
B . C B C
B 0 l32 l33 . . ··· 0 C B ... ... C
B0 0 1 0 C
L=B
B ... . . . . . . . . . .. C
.. C and U = B .. C
B . . C B ... . . . . . . . . . . . . . C
B. C B C
@ .. .. . . . . A B .. .. . . . . C
. . . ln 1,n 1 0 @. . . . 1 un 1,n A
0 0 0 · · · ln,n 1 ln,n 0 0 0 ··· 0 1
There are (2n 1) undetermined entries of L and (n 1) undetermined entries of U , which
totals (3n 2), the number of possible nonzero entries of A. The 0 entries of A are obtained
automatically.
The multiplication involved with A = LU gives, in addition to the 0 entries,
Theorem 4 Suppose that A = [aij ] is tri diagonal with ai,i 1 ai,i+1 6= 0, for each i = 2, 3, ..., n
1. If |a11 | > |a12 |, |aii | |ai,i 1 | + |ai,i+1 |, for each i = 2, 3, ..., n 1, and |ann | > |an,n 1 |,
then A is nonsingular and the values of lii described in the Crout Factorization Algorithm are
nonzero for each i = 1, 2, ..., n.
x1 + x2 = 2 x1 + x2 = 2 x1 + x2 = 2
x1 + 1.0001x2 = 2.0001 x1 + 0.9999x2 = 2.0001 x1 + 1.0001x2 = 2
We may solve each system by using Gaussian elimination. The solution of system (a) is
x2 = 1, x1 = 1. The system (b) is quite similar to system (a), the only di↵erence is a22 . It
changed slightly from 1.0001 to 0.9999. So, we will expect a solution close to the solution of
system (a) as the solution of system (b) but it is x2 = 1, x1 = 3 which is greatly di↵erent
from the solution of system (a). Sytem (c) is also a modification of system (a) in which b2
is changed slightly from 2.0001 to 2. The solution to the system (c) is x2 = 0, x1 = 2 which
is also far from the solution of (a). This illustrates that very small changes in any of the
elements of A or B ~ can cause extremely large changes in the solution, X. ~ Such a system is ill-
conditioned. An ill-conditioned problem is one in which a small change in any of the elements
of the problem causes a large change in the solution of the problem. If a small change in any
of the elements of the problem causes only a small change in the solution of the problem then
it is a well-conditioned problem.
With infinite precision arithmetic, ill-conditioning is not a problem. However with finite
precision arithmetic, round-o↵ errors e↵ectively change the elements of A and B ~ slightly, and if
the systemis ill-conditioned, large changes(i.e., errors) can occur in the solution. Ill-conditioning
is quantified by the condition number of a matrix, which is defined in terms of the norms of
the matrix and its inverse.
1.4.2 Norms
VECTOR NORMS
Let <n denote the set of all n-dimensional column vectors with real-number components.
To define a distance in <n we use the notion of a norm, which is the generalization of the
absolute value on <, the set of real numbers.
Definition 1 A vector norm on <n is a function, k· k, from <n into < with the following
properties:
(i) k~x|
geq0 for all ~x 2 <n ,
(ii) k~xk = 0 if and only if ~x = 0 ,
(iii) k↵~xk = |↵|k~xk for all ↵ 2 < and ~x 2 <n ,
(iv) k~x + ~y k k~xk + k~y k for all ~x, ~y 2 <n ,
The norm of a scalar is its absolute value. Thus, k↵k = |↵|. There are several definitions of
the norm of a vector.
Definition 2 The l1 , l2 and l1 norms for the vector ~x = (x1 , x2 , ..., xn )T are defined as follows
respectively.
n
X
(i) k~xk1 = |xi |
i=1
nX
n o1/2
(ii) k~xk2 = x2i (Euclidean Norm)
i=1
Definition 3 If ~x = (x1 , x2 , ..., xn )T and ~y = (y1 , y2 , ..., yn )T are vectors in <n , the l2 and l1
distances between ~x and ~y are defined by
nX
n o1/2
2
k~x ~y k2 = (xi yi ) , k~x ~y k1 = max |xi yi |
1in
i=1
MATRIX NORMS
In a similar manner, the norm of a matrix is defined.
is a matrix norm.
Matrix norms defined by vector norms are called the induced matrix norm associated
with the vector norm. Every vector norm produces an associated induced matrix norm. The
matrix norms induced by vector norms l1 , l2 and l1 respectively, are:
n
X
(i) kAk1 = max |aij | (Maximum column sum)
1jn
i=1
(ii) kAk2 = ⇢(AT A) where ⇢(A) = max( ) is called spectral radius and is an eigen value of
A
n
X
(iii) kAk1 = max |aij | (Maximum row sum)
1in
j=1
k Xk kA 1 kk Bk (22)
~
kBkk ~
Xk kAkkXkkA 1
kk Bk (23)
Thus,
k Xk k Bk
kAkkA 1 k (24)
~
kXk ~
kBk
~
It can be shown by a similar analysis that perturbing the matrix A instead of the vector B
gives
k Xk k Ak
kAkkA 1 k (25)
~ + Xk
kX kAk
(A) = kAkkA 1 k
References
(i) Numerical Methods for Scientific and Engineering Computation, M.K. Kain, S.R.K. Iyenger,
R.K. Jain