LU Factorization and Guess Elimination: by Zeinab Mahdi
LU Factorization and Guess Elimination: by Zeinab Mahdi
elimination
By zeinab mahdi
2.1- Gaussian elimination.
A system of two equations in two unknowns can be considered in terms either of algebra or
of geometry.
Benefits :
a- The geometric view: is very helpful for visualizing solutions of systems,
b- but for computing the solution with a great deal of accuracy we return to algebra.
1 1 -1 ¦ -2
0 -3 3 ¦ 9
0 3 1 ¦ -1
4- R3= R2+R3 ( in order to eliminate 3 )
1 1 -1 ¦ -2
0 -3 3 ¦ 9
0 0 4 ¦ 8
5- for row 2 : multiply -1/3
for row 3 : multiply -1/4
Ex: x+y=3
-7y=-7 therefore y =1 and x=2
The same method can be done inside matrix :
1 1 ¦ 3
1 1 ¦ 3
3 -4 ¦ 2 Subtracte3*R 0 -7 ¦ -7
1 from R2
LU Factorization
An n × n matrix is said to be upper triangular if aij = 0 for i > j and lower triangular if aij =
0 for i < j. Also A is said to be triangular if it is either upper triangular or lower triangular.
To clear idea lets take an example :
Find a matrix into L and U
A= 2 2 3 0 0
5 9 10 = 0 + 0
4 1 2 0 0
L 1 0 0
2.5 1 0
2 -3/4 1
1 0 0 2 2 3
2.5 1 0 0 4 2.5
A=LU = 2 -3/4 1 0 0 -17/8
Back substitution and LU factorization
Once L and U are known, the problem Ax = b can be written as LUx = b. Define a
new “auxiliary’’ vector c = Ux. Then back substitution is a two-step procedure:
(a) Solve Lc = b for c.
(b) Solve Ux = c for x.
Example to understand:
Ax=B
We need to find L and U such that A=LU
-1R1+R2= 1 -1 1 -2R1+R3 1 -1 1 1/3R2+R3 1 -1 1
0 -3 4 0 -3 4 0 -3 4 U
2 3 1 0 1 3 0 0 13/3
And L= 1 0 0 4/3+
The red 9/3=
numbers are 1 1 0 Now solve Lc=B then Ux=c 13/3
the opposite
of the
coefficient 2 -1/3 1
L C B
Now solve Ux=c
1 1 -1 x1 4
0 -3 4 x2 = -10 x3= -13/3
0 0 -13/3 x3 -13/3 -3x2+4(-13/3)=-10 then x2=2
thus x1=1
2.2.3 Complexity of LU factorization
A square matrix is said to have an LU decomposition (or LU factorization) if it can
be written as the product of a lower triangular (L) and an upper triangular (U) matrix
Example : Prove that A = 0 1
1 1 does not have an LU factorization