Professional Documents
Culture Documents
x into + y into =
5 x 2 y 19
2 x 5 y 16
After, solving it we can get x 3 and y 2 . It means, I need to buy 3 packets of N
Dr. PARVEZ ALAM
and 2 packets of S.
Also, I can use other unknowns (variables) instead of x and y. For example
x x1 & y x1 . So, above equations can be written as
5 x1 2 x2 19
2 x1 5 x2 16
What is ‘Linear Equation’?
The equation of a line in two-dimensional space has the form
------- (1)
The coefficients a1 , a2 , a3 , .... an are real numbers, and the constant term b is a real
number. The number a1 is the leading coefficient, and x1 is the leading variable.
We can form linear equation of 2 variables by taking n=2, can form linear equation of
3 variables by taking n=3, form linear equation of 4 variables by taking n=4, etc…
So, here n=1,2,3,4,5……
Earlier, we had example of 2 linear equations for 2 unknowns (variables) x1 , x2 .
5 x1 2 x2 19; a1 5, a2 2 & b 19
and
2 x1 5 x2 16; a1 2, a2 5 & b 16
Note:
(1). 3 x 2 y 7
1
(2). x y z 2
2
(3). x1 2 x2 10 x3 x4 0
(4). x12 2 x2 10 x3 x4 0
(5). x1 2 x2 10 x3 x1 x4 0
(6). sin x1 4 x2 e 2
2
(7). xy z 2
(8). e x 2 y 4
(9). sin x1 2 x2 3 x3 0
1 1
(10). 4
x y
Dr. PARVEZ ALAM
Solution of the linear equations
A solution of the linear equation (1) is a list of real values for the unknowns
say,
The set of all solutions of a linear equation is called its solution set.
Solution set for above eqn.: 4,4 , 0,2 , 2,3 ....
x1 4 2 x2
In this form x2 free and it means we can put any real value for x2 . And he value of x1
is depending on the value of x1 .
Hence, x2 letting x2 t for any real value representation of x2 . So, x1 4 2t.
Hence, the solution set would then have taken the form
Dr. PARVEZ ALAM
s
4 2t, t t or s, 2 s
2
Systems of Linear Equations
A system of linear equations in variables is a set of equations, each of which is
linear in the same variables:
The double-subscript notation indicates aij is the coefficient of x j in the ith equation.
Here the two lines coincide [Fig.(c)]. This occurs when the
lines have the same slopes and same y intercepts
a11 a12 b1
a21 a22 b2
Graphical representation of consistent and inconsistent solutions of three
variables in xyz-plane
(c). No solution:
Solution of System of Linear Equations
There are several methods available to solve a system of linear equation.
Elimination Method
Substitution Method, etc…
Crammer’s Rule
Matrix Inversion Method ( AX B X A1B )
Gauss Elemination Method
Gauss-Jordan Elemination Method, etc…
Total m Rows
Dr. PARVEZ ALAM
Dr. PARVEZ ALAM
Ex.
Some properties of matrices:
Note: Diagonal matrix is matrix which is both upper and lower triangular.
Dr. PARVEZ ALAM
Matrix operations:
Matrix Addition/Subtraction:
If A aij and B bij are two matrices of the same order, then their sum
mn mn
A+B is also a matrix, and each element of that matrix is the sum of the
corresponding elements.
Consider the two matrices A & B of order 2 x 2. Then the difference is given by
Matrix Multiplication:
If A and B are two matrices, then their product AB will be defined only when the
number of columns in A is equal to the number of rows in B.
n
AB C cij air brj
m p
r 1 n p
Dr. PARVEZ ALAM
Note:
Consider the two matrices A & B of order 2 x 2. Then the difference is given by
Dr. PARVEZ ALAM
Matrix representation of a System of Linear Equation
One very common use of matrices is to represent systems of linear equations.
Let, we have a system of ‘m’ linear equations of ‘n’ variables as given below:
where,
Definition: The matrix containing only the coefficients of the system is called the
Dr.PARVEZ ALAM
Ex.
(2). Augmented matrix form:
The matrix derived from the coefficients and constant terms of a system of linear
equations is called the augmented matrix of the system.
Ex.
Ex.
Ex.
Remark:
Use 0 to indicate coefficients of zero. The coefficient of in the third equation is zero, so
a 0 takes its place in the matrix.
When forming either the coefficient matrix or the augmented matrix of a system,
Dr.PARVEZ ALAM
2. Multiply a row by a nonzero constant (scale) k Ri R j ; k 0
3. Add a multiple of a row to another row. k Ri R j R j ; k 0
Ex.
Remark: Notice in (c) that adding (-2) times of row 1 to row 3 does not make any change
Dr.PARVEZ ALAM
row 1.
Forms of augmented matrix
1. Row-Echelon Form
A matrix is called to be in Row-Echelon Form if it satisfies following conditions
1) Maximum numbers of zeros ‘0’ should be gathered at the bottom of the matrix.
2) The first nonzero entry of each rows should be 1 (called a leading 1). (If the row does
not consist entirely of zeros).
3) The leading 1’s should be appeared from left to right in successive rows.
Dr.PARVEZ ALAM
Rule to convert augmented matrix into Row-Echelon form:
1. First of all try to make 1 ate the leading element of first row, by dividing or
interchanging row.
2. Then, make zero at 1,2,3,4… places by row operations, so that maximum zeros we
can get at the bottom of the matrix (in the Lower triangular portion).
3. Then make ‘1’ the leading elements of each row by multiply row operation.
Same above steps we have to follow, but in the last make upper triangle elements ‘0’ in
the upper triangular portion. Such that in each column of the coefficient matrix we can
get only leading 1 and rest others 0.
Dr.PARVEZ ALAM
Q. Find Row and
Reduced Row
echelon form of
the augmented
matrix of given
system of Linear
equations.
Dr.PARVEZ ALAM
Q. Find Row
and Reduced
Row echelon
form of the
augmented
matrix of given
system of
Linear
equations.
Dr.PARVEZ ALAM
Exercise: Find Row and Reduced Row echelon form of the augmented matrix of the given
following systems of Linear equations.
Dr.PARVEZ ALAM
Methods to find solution of System of Linear Equations
Note:
Dr.PARVEZ ALAM
Note: Here
3, R 3,
n3
Rn.
Unique
solution
Dr.PARVEZ ALAM
Q2. Solve the given systems of Linear equations by Gauss Elimination Method.
Dr.PARVEZ ALAM
Note: Here
3, R 3,
n 3
Rn .
Unique
solution
Dr.PARVEZ ALAM
Q4. Solve the
given systems
of Linear
equations by
Gauss- Jordan
Elimination
Method.
Note: Here
3, R 3,
n 3
Rn .
Unique
solution
Dr.PARVEZ ALAM
Dr.PARVEZ ALAM
Note:
n 1
so,
assuming
any one
free
variable.
i.e., z=t.
As t
belonging
to the real
no., so the
system will
Dr.PARVEZ ALAM
have
infinitely
many
solutions
for different
values of t
Note:
n 1
so, assuming
any one free
variable. i.e.,
z=t.
As t
Dr.PARVEZ ALAM
belonging to
the real no.,
so the system
will have
infinitely
many
solutions for
different values of t
Solve by Gauss-Jordan Elimination method and Gauss Elimination method.
Dr.PARVEZ ALAM
Dr.PARVEZ ALAM
Homogeneous systems of linear equations:
A system of linear equations is said to be homogeneous, if all the constant terms are
zero.
2. For a homogeneous system, any one of the following statement will be true
a) The system will have only the trivial solution (exactly one solution), i.e.,
x1 x2 x3 ..... xn 0 . (see Question no 1st).
or
Dr.PARVEZ ALAM
2 2
Q.
or
Find the solution of the following homogeneous system of linear equations;
x yzw0
2x 2 y z w 0
5 x 5 y 2 z 4w 0
Q2. Find the solution of the following homogeneous system of linear equations
Dr.PARVEZ ALAM
Diagonal Matrix: A square matrix (of n x n order) in which every element except
the principal diagonal elements is zero is called a Diagonal Matrix.
Identity Matrix: Identity Matrix is the matrix which is n × n square matrix where
the diagonal consist of 1’s and the other elements are all zeros. It is also called as a Unit
Matrix. We represent it by I n
Null Matrix: Null Matrix is a matrix having zero as each of its elements.
Dr. PARVEZ ALAM
The Inverse of a Matrix
Inverse matrix:
AB BA I ,
where I is the is the identity matrix of the same order.
1
Matrix B is known as the inverse of matrix A and symbolically we represents B by A .
AA1 A1 A I .
Definitions:
2. Then we convert it into the Reduced Row Echelon, hence we get invers of A as
Dr. PARVEZ ALAM
Exercise 1: Find the inverse of following matrices;
Dr. PARVEZ ALAM
Note: If you can’t get I | A1 form, then it means the matrix is not invertible (singular).
See the Ex. (3), it’s not possible to get I | A1 form for this.
Finding solution of a system of linear equations after finding inverse of matrix by
using Gauss Jordan method
AX B …………………(1)
where,
X A1B …………………(2)
So, we can find solution of the system by finding A 1 and multiplying by B into A 1
Dr. PARVEZ ALAM
Note: If you can’t get I | A1 form, then it means the coefficient matrix A is not
invertible (singular), then the system could be have no solution or could be have
infinitely many solutions.
Dr. PARVEZ ALAM
Exercise: Write the following system of linear equations as AX=B and then solve it by
computing A 1 using the Gauss Jordan Elimination method.
a) 2 x y 3z 2, y 4 z 5, 2 x y 2 z 7
b) x 2 y 2 z 10, 2 x 2 y 3z 1, 4 x 3 y 5z 4
Dr. PARVEZ ALAM
Elementary Matrix: A square matrix (of n x n order) is called an elementary
matrix if it is obtained from the identity matrix I n by a single elementary row
operation.
We have following possible elementary row operations:
1. Interchange two rows (swap). R R
i j
2. Multiply a row by a nonzero constant (scale) k Ri R j ; k 0
3. Add a multiple of a row to another row. k Ri R j R j ; k 0
REMARK:
1. The identity matrix is elementary by this definition because it can be obtained
from itself by multiplying any one of its row by 1.
2. We do only one row operation for Elementary matrix.
1
3. Every elementary matrix E is invertible and that E is also an elementary
matrix.
Dr. PARVEZ ALAM
Writing a Matrix as the Product of Elementary Matrices
Question: Find a sequence of elementary matrices whose product is
Soln.: We find the Reduced Row-Echelon (RRE) form of matrix A and we represent it as ARRE . Similarly row operations we
repeat in identity matrix I corresponding to A.
1 1 1 1 1
Therefore, by the left hand multiplication of inverse matrices E k ,E k 1 ,....,E3 ,E 2 ,E1 , we can get
Here we got a sequence of elementary matrices E11E21E31E41 whose product is A:
Some results on Elementary matrices
Jordan method, that formula also has been derived by using this result.
E k E k 1....E3E 2E1 A | In
E k E k 1....E3E 2 E1 A | E k E k 1....E 3E 2E1 I n
A | In In | A 1
Any square matrix is invertible if and only if it can be written as the product of
elementary matrices.
We can get different number of elementary matrices for any given matrix, it will
depend of Row operations only.
Permutation matrix: A square matrix (of n x n order) is called Permutation
matrix if it is obtained from the identity matrix by permuting rows:
Notes:
1. There are n! matrices of size ‘n’.
2. A permutation matrix is the product of finite number of elementary matrices.
3. Any permutation matrix P is invertible and P -1 =P T .
4. Product of permutation matrices is also a Permutation matrix.
5. Transpose of a Permutation matrix is also a Permutation matrix.
Dr. PARVEZ ALAM
LU-factorization: If the square matrix (of n x n order) A can be written as the
product of a lower triangular matrix L and an upper triangular matrix U, then A=LU is
called an LU-factorization of A.
A=LU;
L is a lower triangular matrix
U is an upper triangular matrix
First, we do only row operation of adding a multiple of one row to another row below
k R R
i j R j ; k 0 to gather maximum zeros at the bottom, and it will give
upper matrix U.
(Here we are not interested to make pivot (leading) element’s 1, that’s why we are not using other
row operations. If you want, you also can get Row-Echelon A RE or Reduced Row-Echelon ARRE
form; hence you may get different L and U).
1 0 1 0
Dr. PARVEZ ALAM
1 2 1 0 1 2
We have U= ; so we can have now A=LU=
0 2 3 1 0 2
1 0 1 2 1 2
Check by multiplying L and U, its giving same A=
1 0 2 3 8
.
3
Note: L and U are not unique, because we have many options to get upper matrix like ARE,
ARRE and above one also. But we give preference to above one.
Example 1: Find the LU factor of matrix
1 0 0 1 0 0 1 0 0
We can calculate; E 0 1 0 ,E2 0 1 0 L E1 E2 0 1 0 .
1
1 1 1 1
2 0 1 0 4 1 2 4 1
1 3 0 1 0 0 1 3 0
We have U= 0 1 3 ; so we can have now A=LU= 0 1 0 0 1 3 .
0 0 14 2 4 1 0 0 14
1 0 0 1 3 0 1 3 0
Check by multiplying L and U, its giving same A= 0 1 0 0 1 3 . 0 1 3 .
2 4 1 0 0 14 2 10 2
Trick to find direct L:
First, we put ‘1’ at principle diagonal of the matrix and fill ‘0’ in the upper triangular
side. Then put (–1 x k) at the corresponding lower side entries, where k is the constant
used in row operations to get U. If at any place already ‘0’ is available, just keep it ‘0’.
For example in the upper question;
Dr. PARVEZ ALAM
Solving liner system of equations by LU-Factorization method:
Let, we have a system of ‘m’ linear equations of ‘n’ variables as given below:
Then, we find L and U factors of coefficient matrix A, so we have put A=LU and we put it
in eqn(1).
AX=B
LU X=B; A=LU
L UX =B;
Now, putting UX=M; LM=B .
Then, we solve equation LM=B to get the values of r1 ,r2 ,r3 ,....rn
After finding r1 ,r2 ,r3 ,.... , we put these in M, then we solve UX=M and easily can calculate
x1 ,x2 ,x3 ,....xn .
Dr. PARVEZ ALAM
1 1 1 1 0 0
A 2 3 4 I 0 1 0
3 4 5 0 0 1
1 1 1 1 0 0
0 5 2 R2 2 R1 R2 E1 2 1 0
1 0 0
3 4 5 0 0 1
1 1
L E E E 2
1 2
1
3 1 0
1 1 1 1 0 0
3 1 / 5 1
0 5 2 R3 3R1 R3 E2 0 1 0
0 1 2 3 0 1
1 1 1 1 0 0
U 0 5 2 E3 0 1 0
1
R3 R2 R3
5
0 0 12 / 5 0 1 / 5 1
AX=B
LU X=B; A=LU
L UX =B;
Now, putting UX=M; LM=B ; where M= r1 , r2 , r3
T
1
3 1 / 5 1 r3 40 1 r3 12 12
3r1 r2 r3 40
5
We have UX=M
1 1 1 x 9 r1 r2 r3 9 r1 1 x 1
UX=M 0 5 2 y 5 5r2 2r3 5 r2 3 X y 3 ;
0 0 12 / 5 z 12 12 r3 5 z 5
r3 12
5
Answer; x=1, y=3, z=5.
2 1 1 0 1 0 0
A 4 1 0 1 I 0 1 0
2 2 1 1 0 0 1
2 1 1 0 1 0 0
0 1 2 1 R2 2 R1 R2 E1 2 1 0
1 0 0
2 2 1 1 0 0 1
L E1 E2 E3 2 1 0
1 1 1
2 1 1 0 1 0 0
1 3 1
0 1 2 1 R3 R1 R3 E2 0 1 0
0 3 2 1 1 0 1
2 1 1 0 1 0 0
U 0 1 2 1 R3 3R2 R3 E3 0 1 0
0 0 4 4 0 3 1
AX=B
LU X=B; A=LU
L UX =B;
T
Now, putting UX=M; LM=B ; where M= r1 , r2 , r3
Then, we solve equation LM=B to get the values of r1 ,r2 ,r3 as
1 0 0 r1 1 r1 1 r1 1 1
LM 2 1 0 r2 2 2r1 r2 2 r2 4 M 4
Dr. PARVEZ ALAM
Exercise