Lecture 6
Lecture 6
Solution of
System of Linear equation
Linear Equations
Only simple variables are allowed in linear equations.
No x2, y3, √x, etc.
Linear vs non-linear
Compact from
Ax = b
General form
Independence
The equations of a linear system are independent if
none of the equations can be derived algebraically
from the others.
For example, following equations are not independent
— they are the same equation when scaled by a factor
of two, and they would produce identical graphs.
Department of Computer Science 18
Properties of SLE
Independence
For example, the equations
x − 2y = −1,
3x + 5y = 8,
4x + 3y = 7
are not independent, because the third equation is
the sum of the other two.
No solution
If m = n and then there exists no solution
In this case equations are called inconsistent
Unique solution
If m= n and then the system will have a unique
solution.
In this case equations are called consistent
Infinitely many solutions
If m < n, the system usually will have an infinite
number of solutions.
In this case equations are also called consistent
No solution
One solution
Infinitely many solutions
No solution
One solution
Infinitely many solutions
Computing a Determinant
Lower-triangular matrix L
It has zero coefficients above the diagonal.
Upper-triangular matrix U
It has all zero coefficients below the diagonal
Diagonal Matrix
It has nonzero coefficients along the diagonal and
zeros everywhere else
Let
a) Compute det(A)
b) Find its lower triangular Matrix
c) Find its upper triangular Matrix
d) Find its diagonal form
Transformation
2x 3y z 5
4 x 4 y 3z 3
2 x 3 y z 1
Department of Computer Science
Solution
2x 3y z 5 ½*R1 3
x y
z 5
2 2 2
4 x 4 y 3z 3 R2 – 4R1 2 y z 7
6 y 2z 6
2 x 3 y z 1 R3 -2R1
Department of Computer Science
Example
3 z 5
x y
2 2 2
2 y z 7
6 y 2z 6
Department of Computer Science
Example
3 z 5 3 z 5
x y -1/2R x y
2 2 2 2 2 2
2
z 7
2 y z 7 R -6R y
2 2
6 y 2z 6
3 2
5 z 15
z 3
using this value of z, the second equation
gives
7 3
y 2
2 2
x = 1, y = 2, z = 3
Step 1
For Equation 2, divide Equation 1 by a11 and
multiply by a21 .
a21
a ( a11 x1 a12 x2 a13 x3 ... a1n xn b1 )
11
a21 a21 a21
a21 x1 a12 x2 ... a1n xn b1
a11 a11 a11
or a x ... a x b
'
22 2
'
2n n
'
2
End of Step 1
Department of Computer Science
Forward Stage
Step 2
Repeat the same procedure for the 3rd term of
Equation 3.
a11 x1 a12 x2 a13 x3 ... a1n xn b1
'
a22 x2 a23
'
x3 ... a2' n xn b2'
"
a33 x3 ... a3" n xn b3"
. .
. .
. .
n 1 n 1
ann xn bn
0 0 0 0 ann xn bn
(n 1 )
(n-1 )
n 1 n 1
ann xn bn
( n 1)
b
xn n
( n 1)
a nn
x 2y z 8
2 x 3 y 4 z 20
4 x 3 y 2 z 16
Department of Computer Science
Example
1 2 1 x 8
2 3 4 y 20
4 3 2 z 16
Department of Computer Science
Example
1 2 1 x 8
0 1 2 y 4
0 5 2 z 16
Department of Computer Science
Example
1 0 5 x 16
0 1 2 y 4
0 0 12 z 36
1 0 5 x 16
0 1 2 y 4
0 0 1 z 3
1 0 0 x 1
0 1 0 y 2
0 0 1 z 3
The solution is
x =1,
y =2,
z =3.