Systems of Linear Equations and Matrices - Afzaal - 2
Systems of Linear Equations and Matrices - Afzaal - 2
2
Linear System
A linear system (or system of linear
equations) is a collection of linear
equations involving the same set of
variables. For example,
4
A linear system in two
variables determines
a collection of
straight lines.
5
Matrices
Variety of engineering problems lead to the
need to solve systems of linear equations
Ax b
where
a11 a12 a13
a1n x1 b1
a21 a22 a23 a2 n x2 b2
A x b
am1 am 2 am3 amn xn bn
1 0 a b 1 2 3
0 1 c e 0 1 0
9
In the double subscript notation for the
entries, the first subscript always denotes the
row and the second the column in which the
given entry stands. Thus a23 is the entry in the
second row and third column.
Vectors are represented by lowercase
boldface letters like a, b, c, …
10
Row and Column Matrices
(vectors)
ROW MATRIX (or row vector) is a matrix with
one row, i.e., the dimension m = 1
r r1 r2 r3 rn
COLUMN VECTOR is a matrix with only one
column
c1
c
c 2
cm 11
Square Matrix
When the row and column dimensions of a
matrix are equal (m = n) then the matrix is
called square
12
Special Matrices
u11 u12 u13 u14
0 u u23 u24
Upper Triangular Matrix U 22
0 0 u33 u34
0 0 0 u44
l11 0 0 0
l l22 0 0
Lower Triangular Matrix 21
L
l31 l32 l33 0
l41 l42 l43 l44
13
Diagonal Matrices
a11 0 0 0
Diagonal Matrix 0 a22 0 0
A
0 0 0
0 0 0 ann
a11 a12 0 0 0
a21 a22 a23 0 0
Tri-diagonal Matrix A 0 a32 0
0 0 a45
0 0 0 a54 a55
14
Identity Matrix
Identity Matrix 1 0 0 0
0 1 0 0
I
0 0 1 0
0 0 0 1
IA AI A
15
Matrix Transpose
The transpose of the (m x n) matrix A is the (n x
m) matrix formed by interchanging the rows and
columns such that row i becomes column i of the
transposed matrix
16
Example - Transpose
1 3 T 1 2
A A
2 5 3 5
1 0
1 3 4
A AT 3 1
0 1 0
4 0
17
Matrix Equality
Two (m x n) matrices A and B are equal if
and only if they have the same size and each
of their elements are equal. That is
A=B
if and only if
ajk = b j k for j = 1,...,m; k = 1,...,n
18
Vector Addition
The sum of two (m x 1) column vectors a and
b is
a1 b1 a1 + b1
a2 b2 a2 + b2
a b
am bm am + bm
19
Examples - Vector Addition
1 3
3 5
u v
2 1
4 2
1 3 1 3 4
3 5 3 5 2
uv
2 1 2 1 1
4 2 4 2 2
20
Matrix Addition
a11 a12 a1n b11 b12 b1n
a21 a22 a1n b21 b22 b1n
AB
am1 am 2 amn bm1 bm 2 bmn
1 2 3 3 2 1 4 4 4
A B 2 1 4 4 1 2 2 2 6
1 4 3 2 3 1 3 7 4
1 2 2 4 6
5 2 1 3 5 ? (not defined!)
22
Scalar – Matrix Multiplication
Multiplication of a matrix A by a scalar is
defined as
a11 a12 a1n
a21 a22 a2 n
A
am1 am 2 amn
Examples
1 2 4 8
4, A , A 0 4
0 1
1 4 1 2 8 2
2, A , A 4 0 6
2 0 3 23
Matrix – Matrix Multiplication
The product of two matrices A and B is defined only if
the number of columns of A is equal to the number of
rows of B.
If A is (m x p) and B is (p x n), the product is an (m x
n) matrix C
C mxn Amxp B pxn
24
Matrix – Matrix Multiplication
a a11 12
a 1r
a a a b b b b
21 22
2r 11 2 1j 1n
b b b b
C AB =
21 12 2j 2n
a ai1 i2
a
ir
b b b b r1 r2 rj rn
a am1 m2
a mr
a b a b
11 11 1r r1
a b a b
11 12
a b a b
1r r2 11 1n 1r rn
a b a b a b a b a b a b
21 11 2r r1 21 12 2r
r2 21 1n 2r rn
a b a b i1 1j ir rj
a b a b
m1 11 mr r1
a b a b
m1 12
a b a b
mr r2 m1 1n mr rn
c a b a b a b a b
ij i1 1j i2 2j ir rj
k 1
ik kj
25
Example –
Matrix Multiplication
b1
b2 c1x1 a1xn bnx1 (scalar)
a (a1, a2 ,, an ) b
bn
b1
b2
c a b (a1 , a2 ,, an ) a1b1 a2b2 an bn
bn
26
Example –
Matrix Multiplication
a11 a12 a1n b1
a
21 a 22 a 2n b2 c nx1 Anxn bnx1
A b
a
a
n1 n 2 a nn bn
27
Example –
Matrix Multiplication
1 3 2 1
A B C 2 x 2 A2 x 2 B2 x 2
2 4 3 5
1 3 2 1 1 2 3 3 1 1 3 5 11 16
C A B
2 4 3 5 2 2 4 3 2 1 4 5 16 22
28
Example –
Matrix Multiplication
1 2 3 2 1
A 2 1 4 B 1 2
C 3 x 2 A3 x3 B3 x 2
1 4 3 2 1
1 2 3 2 1
C A B 2 1 4 1 2
1 4 3 2 1
1 2 2 1 3 2 1 1 2 2 3 1 10 8
2 2 1 1 4 2 2 1 1 2 4 1 13 8
1 2 4 1 3 2 1 1 4 2 3 1 12 12
29
Example –
Matrix Multiplication
3 0
4 7
A 1 1 B C 3 x 2 A3 x 2 B2 x 2
6 8
5 2
3 0 12 21
4 7
C A B 1 1 10 15
6 8
5 2 32 51
30
Matrix Inverse
If A is an (n x n) square matrix and there is a
matrix X with the property that
AX I
AA1 I A1 A I
31
Example - Matrix Inverse
AA1 I
• Example (2 x 2) matrix
a11 a12
A
a a
21 22
1 1 a22 a12
A
a11a22 a12a21 a21 a11
32
System of Linear Equations
A finite set of linear equations in the variables
x1 , x2 ,..., xn is called a system of linear equations or
a linear system.
a11 x1 a12 x2 ... a1n xn b1
a21 x1 a22 x2 ... a2 n xn b2
am1 x1 am 2 x2 ... amn xn bm
An arbitrary system of m
linear equations in n unknowns
33
Matrix Form of the Linear System
where
Ax b
matrix
column vectors
34
A sequence of numbers s1 , s2 ,..., sn that satisfies the
system of equations is called a solution of the
system.
35
Every system of linear equations has either no
solution, exactly one solution, or infinitely many
solutions.
A general system of two linear equations:
a1 x b1 y c1 (a1 , b1 not both zero)
a2 x b2 y c2 (a2 , b2 not both zero)
36
(b) Two lines may intersect at only one point
-> one solution
38
A General System of Three Linear
Equations
The other common example of systems of three variables equations that
have no solution is pictured below. In the case below, each plane
intersects the other two planes. However, there is no single point at
which all three planes meet. Therefore, the system of 3 variable
equations below has no solution.
39
A General System of Three Linear
Equations
40
Augmented Matrix
The location of the +’s, the x’s, and the =‘s in the
linear system can be abbreviated by writing only
the rectangular array of numbers. This is called
the augmented matrix for the system.
For the given system
am1 am 2 ... amn bm
42
Example – Augmented Matrix
The augmented matrix for the system of equations
x1 x2 2 x3 9
2 x1 4 x2 3 x3 1
3x1 6 x2 5 x3 0
is
1 1 2 9
2 4 3 1
3 6 5 0
43
Elementary Row Operations
The basic method for solving a system of linear
equations is to replace the given system by a new
system that has the same solution set but which is
easier to solve.
Since the rows of an augmented matrix correspond
to the equations in the associated system, the new
systems is generally obtained in a series of steps by
applying the following three types of operations to
eliminate unknowns systematically. These are called
elementary row operations.
44
1. Multiply an equation through by a nonzero
constant.
2. Interchange two equations.
3. Add a multiple of one equation to another.
45
Example -
Using Elementary row Operations (1/4)
x y 2z 9 x y 2z 9
add -3 times
2 x 4 y 3 z 1 add - 2 times 2 y 7 z 1 7 the first equation
the first equation
to the third
3x 6 y 5 z 0 to the second
3x 6 y 5 z 0
1 1 2 9 1 1 2 9
2 4 3 1 add - 2 times 0 2 7 17
add -3 times
the first row the first row
3 6 5 0 to the second 3 6 5 0 to the third
46
Example -
Using Elementary row Operations (2/4)
x y 2z 9 x y 2z 9
2 y 7 z 17 multiply the second y 72 z 172 add -3 times
1 the second equation
3 y 11z 27 equation by
23 y 11z 0tothe third
1 1 2 9 1 1 2 9
0 2 7 17 0 1 7 17
multiply the second 2 2 add -3 times
0 3 11 27 row by 1 0 3 11 27 the second row
to the third
2
47
Example -
Using Elementary row Operations (3/4)
x y 2z 9 x y 2z 9 Add -1 times the
Multiply the third secondequation
y 72 z 172
equation by - 2
y 72 z 172
to thefirst
12 z 32 z 3
48
Example -
Using Elementary row Operations (4/4)
Add - 11
2
times
x 112 z 35
2
the third equation x 1
to the first and 72 times
y 72 z 172 the third equation y 2
to the second
z 3
z 3
Add - 11
2
times
the third row
1 0 112 35
2 to the first and 72 1 0 0 1
0 1 7
17 times the third row 0 1 0 2
2 2
to the second
0 0 1 3
0 0 1 3
49
Echelon Forms
A matrix with the following properties is in
reduced row-echelon form, (RREF).
1. If a row does not consist entirely of zeros, then the
first nonzero number in the row is a 1. We call this a
leading 1.
2. If there are any rows that consist entirely of zeros,
then they are grouped together at the bottom of the
matrix.
3. In any two successive rows that do not consist entirely
of zeros, the leading 1 in the lower row occurs farther
to the right than the leading 1 in the higher row.
4. Each column that contains a leading 1 has zeros
everywhere else.
50
A matrix that has the first three properties (but
not necessarily 4) is said to be in row-echelon
form (REF).
51
Row-Echelon &
Reduced Row-Echelon form
reduced row-echelon form:
0 1 2 0 1
1 0 0 4 1 0 0 0
0 1 0 7 , 0 1 0 , 0 0 1 3 0 0
,
0 0 0 0 0 0 0
0 0 1 1 0 0 1
0 0 0 0 0
row-echelon form:
1 4 3 7 1 1 0 0 1 2 6 0
0 1 6 2 , 0 1 0 , 0 0 1 1 0
0 0 1 5 0 0 0 0 0 0 0 1
52
Concluding Remarks on Row-
echelon forms
Row-echelon form of a matrix is not unique and
depends upon the sequence of elementary row
operations performed on the original matrix yet it
does not affect the solution of the linear system.
53
Concluding Remarks on Row-
echelon forms
Many algorithms modify the basic procedure to
reduce round-off errors, minimize the storage
space and accelerate the computations. (For
example, pivoting is performed to reduce round
off errors.)
54
Example (a)
Suppose that the augmented matrix for a system of
linear equations have been reduced by row operations
to the given reduced row-echelon form. Solve the
system.
1 0 0 5
(a) 0 1 0 2
0 0 1 4
Solution x 5
The corresponding system y -2
of equations is : z 4
55
Example - (b)(1/2)
1 0 0 4 1
(b) 0 1 0 2 6
0 0 1 3 2
free variables
Solution
x1 4 x4 - 1
1. The corresponding
system of equations is : x2 2 x4 6
x3 3 x4 2
leading
variables
56
Example - (b)(2/2)
x1 - 1 - 4 x4 2. We see that the free variable can be
assigned an arbitrary value, say t, which
x2 6 - 2 x4
then determines values of the leading
x3 2 - 3 x4 variables.
x1 1 4t ,
3. There are infinitely many
solutions, and the general x2 6 2t ,
solution is given by the x3 2 3t ,
formulas
x4 t
57
Example (c) (1/2)
1 6 0 0 4 2
0 0 1 0 3 1
(c)
0 0 0 1 5 2
0 0 0 0 0 0
Solution
1. The 4th row of zeros leads to x1 6 x2 4 x5 - 2
the equation places no
restrictions on the solutions x3 3 x5 1
(why?). Thus, we can omit x4 5 x5 2
this equation.
58
Example (c) (2/2)
Solution x1 - 2 - 6 x2 - 4 x5
2. Solving for the leading
variables in terms of the free
x3 1 - 3 x5
variables: x4 2 - 5 x5
Solution
the last equation in the corresponding system of equation is
0 x1 0 x2 0 x3 1
Since this equation cannot be satisfied, there is no solution
to the system.
60
Elimination Methods (1/7)
We shall give a step-by-step elimination procedure that can be
used to reduce any matrix to reduced row-echelon form.
0 0 2 0 7 12
2 4 10 6 12 28
2 4 5 6 5 1
61
Elimination Methods (2/7)
Step1. Locate the leftmost column that does not consist entirely
of zeros.
0 0 2 0 7 12
2 4 10 6 12 28
2 4 5 6 5 1
Leftmost nonzero column
2 4 10 6 12 28
0 0 2 0 7 12 The 1st and 2nd rows in the
preceding matrix were
2 4 5 6 5 1 interchanged.
62
Elimination Methods (3/7)
Step3. If the entry that is now at the top of the column found in Step1 is
a, multiply the first row by 1/a in order to introduce a pivot 1.
1 2 5 3 6 14
0 0 2 0 7 12 The 1st row of the preceding
2 4 5 6 5 1 matrix was multiplied by 1/2.
Step4. Add suitable multiples of the top row to the rows below so that
all entries below the pivot 1 become zeros.
1 2 5 3 6 14
0 0 2 0 7 -2 times the 1st row of the
12 preceding matrix was added to
0 0 5 0 17 29 the 3rd row.
63
Elimination Methods (4/7)
Step5. Now cover the top row in the matrix and begin again with Step1
applied to the sub-matrix that remains. Continue in this way until the
entire matrix is in row-echelon form.
1 2 5 3 6 14
0 0 2 0 7 12
0 0 5 0 17 29 Leftmost nonzero
column in the submatrix
1 2 5 3 6 14
0 0 1 0 7 6 The 1st row in the sub-matrix
2 was multiplied by -1/2 to
0 0 5 0 17 29 introduce a pivot 1.
64
Elimination Methods (5/7)
Step5 (cont.)
1 2 5 3 6 14 -5 times the 1st row of the sub-
0 0 1 0 7 6 matrix was added to the 2nd row
2 of the sub-matrix to introduce a
0 0 0 0 12 1 zero below the pivot 1.
1 2 5 3 0 2
0 0 1 0 0 1 -6 times the 3rd row was added
to the 1st row.
0 0 0 0 1 2
1 2 0 3 0 7
0 0 1 0 0 1 5 times the 2nd row was added
to the 1st row.
0 0 0 0 1 2
67
Example -
Gauss-Jordan Elimination(1/4)
Solve by Gauss-Jordan Elimination
x1 3 x2 2 x3 2x 5 0
2 x1 6 x2 5 x3 2 x4 4 x5 3x6 1
5 x3 10 x4 15 x6 5
2 x1 6 x2 8 x4 4 x5 18 x6 6
Solution:
The augmented matrix for the system is
1 3 -2 0 2 0 0
2 6 -5 -2 4 -3 - 1
0 0 5 10 0 15 5
2 6 0 8 4 18 6 68
Example -
Gauss-Jordan Elimination(2/4)
Adding -2 times the 1st row to the 2nd and 4th rows
gives
1 3 -2 0 2 0 0
0 0 -1 -2 0 -3 - 1
0 0 5 10 0 15 5
0 0 4 8 0 18 6
0 0 0 0 0 6 2
Example -
Gauss-Jordan Elimination(3/4)
Interchanging the 3rd and 4th rows and then multiplying the 3rd
row of the resulting matrix by 1/6 gives the row-echelon form.
1 3 -2 0 2 0 0
0 0 1 2 0 3 1
0 0 0 0 0 1 1
3
0 0 0 0 0 0 0
Adding -3 times the 3rd row to the 2nd row and then adding 2
times the 2nd row of the resulting matrix to the 1st row yields the
reduced row-echelon form.
1 3 0 4 2 0 0
0 0 1 2 0 0 0
0 0 0 0 0 1 3 1
70
0 0 0 0 0 0 0
Example -
Gauss-Jordan Elimination(4/4)
The corresponding system of equations is
x1 3 x2 4 x4 2 x 5 0
x3 2 x4 0
x6 13
Solving for the leading variables in terms of the free
variables
x1 3 x2 4 x4 2 x 5
x3 2 x4
x6 1
3
72
solved by Back-
substitution(1/3)
From the computations in previous example, a row-
echelon form from the augmented matrix is
1 3 -2 0 2 0 0
0 0 1 2 0 3 1
0 0 0 0 0 1 1
3
0 0 0 0 0 0 0
x 3 x - 2x
1 2 3
2x 5
0
x 2x
3 4
+3x 1
6
x
6
1
3 73
Example – Previous Example solved
by Back-substitution(2/3)
Step1. Solve the equations for the leading variables.
x1 3 x2 2 x3 2 x 5
x3 1 2 x4 3 x6
x6 1
3
x1 3 x2 2 x3 2 x 5
x3 2 x4
x6 1
3 74
solved by Back-
substitution(3/3)
Substituting x3=-2 x4 into the 1st equation
x1 3 x2 4 x3 2 x 5
x3 2 x4
x6 1
3
75
Gaussian Elimination
Consists of 2 steps
1. Forward Elimination of Unknowns.
2. Back Substitution
76
Forward Elimination
25 5 1 25 5 1
64 8 1 0 4.8 1.56
144 12 1 0 0 0.7
77
Forward Elimination
Linear Equations
A set of n equations and n unknowns
Eqn 2
Eqn3 (a32 )
a22
82
Forward Elimination
83
Forward Elimination
n 1 n 1
ann xn bn
84
Forward Elimination
a "
33
"
a3n x3 b3
"
( n 1)
ann xn bn (n-1 )
85
Back Substitution
86
Back Substitution
( n 1)
b n
xn ( n 1)
a nn
n
i 1 i 1
bi aij xj
j i 1 For i=n-1, n-2,….,1
xi i 1
aii
and
( n 1)
b n
xn ( n 1)
a nn
88
Example -
Gaussian Elimination(1/4)
Solve x y 2z 9 by Gaussian elimination
and 2 x 4 y 3z 1
3x 6 y 5 z 0 back-substitution.
Solution
We convert the augmented matrix
1 1 2 9
2 4 3 1
3 6 5 0
89
Example -
Gaussian Elimination(2/4)
Solution
to the row-echelon form
1 1 2 9
0 1 72 172
0 0 1 3
x y 2 z 9, y 72 z 172 , z 3
90
Example -
Gaussian Elimination(3/4)
Solution
Solving for the leading variables
x 9 y 2 z,
y 172 72 z ,
z 3
Substituting the bottom equation into those
above
x 3 y,
y 2,
z 3 91
Example -
Gaussian Elimination(4/4)
Solution
Substituting the 2nd equation into the top
x 1, y 2, z 3
92
Example: Rocket Velocity
The upward velocity of a rocket is
given at three different times
Time, t Velocity, v
s m/s
5 106.8
8 177.2
12 279.2
The velocity data is approximated by a polynomial as:
vt a1t 2 a 2 t a3 , 5 t 12.
93
Find: The Velocity at t=6,7.5,9, and 11 seconds.
Example: Rocket Velocity
Assume
vt a1t a2t a3 , 5 t 12.
2
Row1
Row2 (64)
25
Yields
25 5 1 a 1 106.81
0 4.8 1.56 a 96.21
2
144 12 1 a 3 279.2
95
Example: Rocket Velocity
Forward Elimination: Step 1
Row1
Row3 (144)
25
Yields
25 5 1 a 1 106.8
0 4.8 1.56 a 96.21
2
0 16.8 4.76 a 3 336.0
96
Example: Rocket Velocity
Forward Elimination: Step 2
Row2
Row3 (16.8)
4.8
Yields
25 5 1 a 1 106.8
0 4.8 1.56 a 96.21
2
0 0 0.7 a 3 0.735
This is now ready for Back Substitution
97
Example: Rocket Velocity
Back Substitution: Solve for a3 using the third equation
0.7a3 0.735
0.735
a3
0.7
a3 1.050
98
Example: Rocket Velocity
Back Substitution: Solve for a2 using the second equation
a2 19.70
99
Example: Rocket Velocity
Back Substitution: Solve for a1 using the first equation
25a1 5a 2 a3 106.8
106.8 5a 2 a3
a1
25
106.8 519.70 1.050
a1
25
a1 0.2900
100
Example: Rocket Velocity
Solution:
a1 0.2900
The solution vector is a 19.70
2
a3 1.050
The polynomial that passes through the
three data points is then:
vt a1t 2 a 2 t a3
0.2900 t 2 19.70 t 1.050, 5 t 12
101
Example: Rocket Velocity
Solution:
Substitute each value of t to find the corresponding
velocity
v6 0.29006 19.706 1.050
2
129.69 m / s.
v7.5 0.29007.5 19.707.5 1.050
2
165.1 m / s.
v9 0.29009 19.709 1.050
2
201.8 m / s.
v11 0.290011 19.7011 1.050
2
252.8 m / s.
102
Pitfalls of Gauss Elimination
Method
Two Potential Pitfalls
-Division by zero: May occur in the
forward elimination steps. Consider the
set of equations:
10 x2 7 x3 7
6 x1 2.099 x2 3 x3 3.901
5 x1 x2 5 x3 6
- Round-off error: Prone to round-off errors.
103
Pitfalls: Example
Consider the system of equations:
Use five significant figures with chopping
10 7 0 x1 7
3 2.099 6 = 3.901
x2
5 1 5 x 6
3
At the end of Forward Elimination
10 7 0 x1 7
0 0.001 x = 6.001
6 2
0 0 15005 x3 15004
104
Pitfalls: Example
Back Substitution
10 7 0 x1 7 15004
0 0.001 x3 0.99993
6 x 2 6.001 15005
0 0 15005 x3 15004
6.001 6 x3
x2 1.5
0.001
7 7 x 2 0 x3
x1 0.3500
10
105
Pitfalls: Example
Compare the calculated values with the exact solution
x1 0
X exact
x 2 1
x3 1
x1 0.35
X calculated x 2 1.5
x3 0.99993
106
Improvements
107
Homogeneous Systems of
Linear Equations
A system of linear equations is said to be
homogeneous if all the constant terms
are zero.
a11 x1 a12 x2 ..... a1n xn 0
a21 x1 a22 x2 ..... a2 n xn 0
am1 x1 am 2 x2 ..... amn xn 0
108
Homogeneous Systems of
Linear Equations
A homogeneous system of linear equations is
always consistent, since it has at least one
solution;
x1 0, x2 0,...xn =0
The above solution is called trivial solution of the
homogeneous system of linear equation.
There may be solutions other than the trivial one
and they are called non-trivial solutions of the
homogeneous system of linear equations.
109
Homogeneous Systems of
Linear Equations
For a homogeneous system, Exactly one
of the following is true:
1. The system has only the trivial solution.
2. The system has infinitely many solutions
in addition to the trivial solution.
A homogeneous system of linear
equations with more unknown than the
equations has infinitely many solutions.
110
Example - Homogeneous
System of Linear Equations
Solve the following homogeneous system of
linear equations by Gauss-Jordan elimination.
2 x1 2 x2 x 3 x5 =0
x1 2 x2 2 x 3 3x 4 x5 =0
x1 x2 2 x 3 x5 =0
x 3 x 4 x5 =0
111
Example
The Augmented Matrix for the system is
2 2 1 0 1 0
1 1 2 3 1 0
1 1 2 0 1 0
0 0 1 1 1 0
Reducing to Reduced Row Echelon form
1 1 0 0 1 0
0 0 1 0 1 0
0 0 0 1 0 0
0 0 0 0 0 0
112
Example
The corresponding system of equations is
x1 x2 x5 = 0
x3 x5 = 0
x4 =0
Solving for leading variables
x1 x2 x5
x 3 x5 x 2 , x5 Free variables
x 4 =0
113
Example
Elementary row operations cannot alter the
last column of zeros, hence reduced system
must also be homogeneous.
For m equations in n variable with m<n, there
exist infinite no. of solutions.
If no. of non zero rows is r in the reduced row
echelon form then the no. of free variables
are n-r.
114
Matrix Multiplication
In general, matrix multiplication is not
commutative AB BA
It can happen that:
AB is defined but BA is not defined.
Both AB & BA are defined but have different
sizes.
Both AB & BA are defined and have equal
sizes but even then they are not equal.
115
Example
1 0 1 2
A , B
2 3 3 0
1 2 3 6
AB , BA
11 4 3 0
Thus AB BA.
116
Matrix Multiplication
If order of A, B and C AB
are such that
BC
and are possible, then matrix
multiplication holds the associative law
A( BC ) ( AB )C
For square matrices A, B and C of same
sizes, matrix multiplication always follows the
associative law.
117
Null or Zero Matrix
A matrix with all entries equal to zero is called
Null or Zero matrix.
0 0 0
0 , 0 0 , 0 0 0
Generally, a zero matrix of order mn is
denoted as Om n .
118
Properties of Zero Matrix
Zero matrix (of appropriate size) is the
additive identity in matrix arithmetic i.e.
AO O A A
A A O
Law of cancellation is not valid for non-zero
matrices.
119
Example
0 1 1 1 2 5 3 7
A ,B ,C ,D
0 2 3 4 3 4 0 0
3 4
AB AC though A 0, it is incorrect
6 8
to cancel A from both sides of equation AB AC
to get B C
and
AD 0 does not mean A 0 or D 0
120
Inverse of a Matrix
If A is an (n x n) square matrix and there is
a matrix X with the property that
AX XA I
X is defined to be the inverse of A and is
denoted by A-1
1 1
AA I A AI
121
1
Properties of A
Inverse of a matrix is unique.
A product of invertible matrices is always
invertible, and inverse of product is the
product of the inverses in the reverse
order. 1 1 1
( AB ) B A
If A is invertible then A1 is also invertible
and 1 1
(A ) A
122
Row Equivalence
Two matrices A and B are said to be row
equivalent if and only if they can be obtained
from each other by a sequence of finite no. of
elementary operations.
A............ B
( sequence of elementray operations )
B............ A
( sequence of inverse elementray
operations )
123
Method of Finding Inverse of a
Matrix
To find the inverse of an invertible matrix
A, we must find a sequence of elementary
operations that turn A to an Identity matrix
and then the same sequence must be
applied on Identity matrix to get inverse of
A.
124
Example (1/4)
Find the inverse of A
1 2 3
A 2 5 3
1 0 8
1 2 3 1 0 0 Augmenting with
Identity matrix
2 5 3 0 1 0
1 0 8 0 0 1
125
Example (2/4)
1 2 3 1 0 0
Adding –2 times 1st row
0 1 3 2 1 0 To 2nd and –1 times the
first row to 3rd row
0 2 5 1 0 1
1 2 3 1 0 0
0 1 3 2 1 0 Adding 2 times the
Sencond row to the third
0 0 1 5 2 1
126
Example (3/4)
0 0 1 5 2 1
1 2 0 14 6 3 Adding 3 times the
0 1 0 13 5 3 Third row to the second
And –3 times the to
the first
0 0 1 5 2 1
127
Example (4/4)
1 0 0 40 16 9 Adding –2 times
0 1 0 13 5 3 The row to the
first
0 0 1 5 2 1
40 16 9
1
Hence A 13 5 3
5 2 1
128
Determinant Function
Determinant Function is a real valued
function of matrix variable in a sense that it
associates a real number ƒ(X) with a matrix
X.
Let A be square matrix. The Determinant
Function is denoted by det. The det(A) is
called the determinant of A.
129
Determinants
A determinant of second order is defined as
a11 a12
det( A) a11a 22 a12 a 21
a 21 a 22
A third order determinant can be defined
a11 a12 a13
det( A) a 21 a 22 a 23
a 31 a 32 a 33
a 22 a 23 a12 a13 a12 a13
a11 a 21 a 31
a 32 a 33 a 32 a 33 a 22 a 23 130
Determinants
The signs on the right are + - +.Each of the
three terms in last line of the last slide is an
entry in the first column of det(A) times its
“minor,” that is, the second-order
determinant obtained by deleting from det(A)
the row and column of that entry .
If we write the minors,
a11a23 a32 a11a22 a33 a13a21a32 a12 a21a33 a12 a23a31 a13a22 a31
131
Determinant of Order n
Determinant of order n
a11 a12 a1n
a 21 a 22 a2n
det( A)
an1 an 2 ann
For n=1 det(A)=a11 and
For n>1
det( A) a j1C j1 a j 2C j 2 a jn C jn j 1, 2 , or n
or
det( A) a1k C1k a2 k C2 k ank Cnk k 1, 2, , or n
132
Determinant of Order n
Where Cofactor
Cjk=(-1)j+k Mjk
and Mjk is a determinant of order n-1,the determinant of the
submatrix of A obtained from A by deleting the row and
column of the entry ajk (the jth row and the kth column).
In this way, det is defined in terms of n determinants of order
n-1, each of which is, in turn, defined in terms of n-1
determinants of order n-2 and so on at last second order
determinant occur.
From the definition it follows that we may expand by any row
or column ,that is to choose the entries in any row or column.
133
Example
1 3 0
det( A) 2 6 4
1 0 2
6 4 2 4 2 6
det( A) 1 3 0
0 2 1 2 1 0
det( A) 1(12 0) 3(4 4) 0(0 6)
134
Properties of Determinants
Interchange of two rows or columns multiplies the
value of the determinant by-1.
Addition of a multiple of a row to another row or
column to another column does not alter the value of
the determinant.
Multiplication of a row or column by c multiplies the
value of the determinant by c.
Transposition leaves the value of a determinant
unaltered.
A zero row or column renders the value of the
determinant zero.
135
Properties of Determinants
Proportional rows or columns also renders
the value of the determinant to zero.
The determinants of the upper
triangular ,lower triangular or diagonal matrix
is the product of entries on the main diagonal
that is
det( A) a11a22 ann
136
Determinants by Row Reduction
The determinant of a matrix can be obtained
by reducing the matrix to row-echelon form.
This method suffers less computational
complexity.
Example: Evaluate det(A) using row-reduction
0 1 5
det( A) 3 6 9
2 6 1
137
Determinants by Row Reduction
138
Determinants by Row Reduction
1 2 3
det( A) 3 0 1 5 R 3 R 3 2 R1
0 10 5
1 2 3
det( A) 3 0 1 5 R 3 R 3 10 R 2
0 0 55
139
Determinants by Row Reduction
1 2 3
det( A) (3)(55) 0 1 5 R3 R3 / 55
0 0 1
det( A) ( 3)( 55)(1)(1)(1)
det( A) 165
140
Example 2
Evaluate determinants reducing to triangular
form
2 0 4 6
4 5 9 12
det( A)
0 2 6 1
3 8 3 10
2 0 4 6
0 5 9 12 R 2 R 2 2 R1
det( A)
0 0 2.4 3.8 R 4 R 4 1.5 R1
0 0 11.4 29.2 141
Example 2 (2/3)
2 0 4 6
R 3 R 3 0.4 R 2
0 5 9 12
det( A)
0 0 2.4 3.8 R 4 R 4 1.6 R 2
0 0 0 47.25
2 0 4 6
0 5 9 12
R 4 R 4 4.75 R 3
det( A)
0 0 2.4 3.8
0 0 0 47.25
142
Example 2 (3/3)
So following the statement of theorem
det( A) (2)(5)(2.4)(47.25)
det( A) 1134
143
Linear Combination
A vector W is called the linear combination of
the vectors a 1, a 2 , ....... an if it can be
expressed in the form
W k 1a1 k 2 a 2 knan
where k 1, k 2 , kn are scalars and
a1, a 2 an have same number of
components.
144
Example 1 (1/3)
Show that 9
w 2
7
is a linear combination of
1 6
a1 2 a 2 4
1 2
145
Example 1 (2/3)
By definition of Linear Combination
w k 1a 1 k 2 a 2
9 1 6
2 k 1 2 k 2 4
7 1 2
146
Example 1 (3/3)
Equating corresponding components yield
k 1 6k 2 9
2k 1 4k 2 2
k 1 2k 2 7
which has the solution k1= -3, k2= 2 so that
w 3a1 2a 2
147
Example 2 (1/5)
Check whether 4
w 1
8
is a linear combination of vectors.
1 6
a1 2
a 2 4
1 2
148
Example 2 (2/5)
So by definition
4 1 6
1 k 1 2 k 2 4
8 1 2
yields
k 1 6k 2 4
2 k 1 4 k 2 1
k 1 2k 2 8 149
Example 2 (3/5)
Augmented Matrix is
1 6 4
2 4 1
1 2 8
1 6 4
0 8 9 R2 2 R1
R3 R1
0 8 12
150
Example 2 (4/5)
1 6 4
0 1 9 / 8 1
R2
8
0 8 12
1 6 4
0 1 9 / 8 R 8R
3 2
0 0 3
151
Example 2 (5/5)
The System of equations is inconsistent ,so
that no such scalars k1,k2 can be found.
Consequently w is not a Linear combination
of a1 and a 2 .
152
Linear Independence
Let A be the non empty set of vectors.
A a1, a 2, a 3...., an
Consider the equation in which W is equal to zero.
k 1a1 k 2 a 2 knan 0
has a trivial solution
k 1 0, k 2 0, kn 0
If this is the only solution ,then A is called the Linear
Independent set. If there are other solutions then A
is called Linear Dependent set.
153
Example(1/3)
Check the Linear Independence of following vectors.
1 5 3
a1 2
a 2 6
a3 2
3 1 1
k 1a 1 k 2 a 2 k 3 a 3 0
154
Example(2/3)
1 5 3 0
k 1 2 k 2 6 k 3 2 0
3 1 1 0
k 1 5k 2 3k 3 0
2k 1 6k 2 2k 3 0
3k 1 k 2 k 3 0 155
Example(3/3)
The equations also have a non-trivial solution
k 1 (1/ 2) k 3
k 2 (1/ 2) k 3
The above set is Linearly dependent set.
The set listed below is Linearly independent
set with only one trivial solution.
1 0 0
a1 0 a 2
1 a 3 0
0
0
1 156
Theorems
1) a) A set A with two or more vectors is Linearly
dependent, if and only if at least one of the
vectors in A is expressible as a linear
combination of the other vectors in A.
b) A set with exactly two vectors is Linearly
independent if and only if neither vector is a
scalar multiple of the other.
2) A set that contains the zero vector is Linearly
dependent because x 0 0
1
has many nontrivial solutions
157
Theorems
3) A set A with two or more vectors is
Linearly independent, if and only if no vector
in A is expressible as a Linear Combination
of the other vectors in A.
158
Theorems
4) Let A a1, a 2, a 3...., an be a set of
vectors in Rq. If n>q then A is linearly
dependent.
For example n=3, q=2
1 5 3
a1 a2 a3
2 6 2
159
Theorems
The solution in terms of k3 as a free variable is
which has a non-trivial solution and are
Linearly dependent.
k 1 (1/ 2) k 3
k 2 (1/ 2) k 3
160
Vector-Equation of Homogeneous
System
For a homogeneous system of Linear
equation
Ax 0
a11 a12 a13 a1n
a21 a22 a23 a2 n
where A
a
m1 am 2 am 3 amn
x1
x
and x 2
xn
161
Vector-Equation of Homogeneous
System
a11 a12 a1n
a a a
21 x 22 x 2 n x 0 and
1 2 n
am1 am 2 amn
a1 x1 a2 x2 an xn 0
If unique solution x1, x 2, x 3...., xnexist then
vectors a1, a 2, a 3...., an will always be Linearly
independent.
162
Vector Spaces
If n is a positive integer ,then an ordered n-
tuple is a sequence of n real numbers
a1, a 2, a 3...., an . The set of all ordered
n-tuples is called n-space and is denoted by
Rn.
A vector space is a nonempty set V=Rn of
vectors such that with any two vectors a and
b in V all their linear combinations αa+βb (α,
β any real numbers) are elements of V. In
addition these vectors in V satisfy the
following axioms.
163
Vector Spaces
If a , b and c are vectors in V, then a+b is in
V
a+b=b+a
a+(b+c)=(a+b)+c
There is a vector in V, called a zero vector for
V ,such that 0+a=a+0 for all a in V.
For each a in V ,there is a vector –a in V,
called the negative of a such that a+(-a)=0.
If k is any scalar and a is any object in V,
then ka is in V.
164
Vector Spaces
k(a+b)=ka+kb
(k+l)a=ka+ la
k(la)=(kl)a
165
Span
If a1, a 2, a 3...., an are vectors in vector
space V and if every vector in V is
expressible as a linear combination of these
vectors ,then a1, a 2, a 3...., an span V.
Example
The vectors i=(1,0,0) ,j=(0,1,0) and k=(0,0,1)
spans R3. Every vector z=(a ,b ,c) in R3 can
be written as
(a, b, c)=a i+b j+c k
166
Example 1(1/5)
Determine whether
1 1 2
a1 1
a 2 0 and a 3 1
2 1 3
and b3.
The coefficient 1 1 2
matrix for the
A 1 0 1
above system of
linear equations is 2 1 3
169
Example 1(4/5)
1 1 2
det( A)
1 0 1
R3 R3 2 R1
0 1 1
1 1 2
det( A)
0 1 1
R2 R2 R1
0 1 1
1 1 2
det( A)
0 1 1
R3 R3 R2
0 0 0
170
Example 1(5/5)
Since the coefficient matrix contains a zero row
it means the determinant of the above matrix
must be equal to zero.
1 1 2
det( A)
0 1 1
0 0 0
det( A) 0
174
Example 2 (2/2)
3 5 5
x1 1 x2 1 3
2 8 6
which has the solution
x1 5 x2 2
175
Basis for a Vector Space
If V is any vector space and A a1, a 2, a 3...., an
is a set of vectors in V, then A is called the
basis for V if the following two conditions
hold
1. A is a linearly Independent.
2. A spans V
176
Basis for vector Space
If A a1, a 2, a 3...., an is a basis for a
vector space V, then every vector a in V can
be expressed in the form a k1a1 k2a 2 kna n
in exactly one way.
Example: Show that the set below is the basis
for R3.
1 2 3
a1 2 a 2 9 and a3 3
1 0 4
177
Example 1 (1/3)
For the basis a1,a2,a3 has to be Linearly
Independent and must span the vector space
Let b be the vector that is the linear
combination of a1,a2,a3.
b k1a1 k2a 2 k3a3
b1 1 2 3
b k 2 k 9 k 3
2 1 2 3
b3 1 0 4
178
Example 1 (2/3)
k1 2k 2 3k3 b1
2k1 9k 2 3k3 b2
2k1 4k3 b3
We can simultaneously prove that a 1,a2,a3
span vector and are Linearly independent. If
the coefficient matrix below is invertible.
1 2 3
A
2 9 3
1 0 4
179
Example 1 (3/3)
Determinant of the coefficient matrix is
calculated
det(A) = -1
So the vectors a1,a2,a3 form basis for R3.
180
Dimensionality of Vector Space
A non-zero vector space V is called finite-
dimensional if it contains a finite set of vectors
a , a , a ...., a
1 2 3 n that form a basis. If no such
vectors exists, V is called the infinite dimensional
space.
In a non-zero vector space V the maximum number
of linearly independent vectors in V is called the
dimensionality of vector space V.
Zero vector space is regarded as the finite
dimensional space even though it has no linear
independent sets and no basis.
181
Rank of a Matrix
The dimension of the row vectors or
column vectors is called the Rank of the
matrix and is denoted by Rank (A).
Or
Rank of a matrix is number of leading
entries or pivot positions in Echelon form.
Let A a jk
be an m×n matrix and
let rank=R(A) has linear independent set of R
row vectors or column vectors.
182
Example 1(1/4)
Find the rank of the matrix
1 2 0 4 5 3
3 7 2 0 1 4
A
2 5 2 4 6 1
4 9 2 4 4 7
Solution:
1 2 0 4 5 3
0 1 2 12 16 5
A
0 1 2 12 16 5
0 1 2 12 16 5
R2 R2 3R1
R4 R4 4 R1
R3 R3 2 R2 183
Example 1(2/4)
1 2 0 4 5 3
0 1 2 12 16 5
A
0 0 0 0 0 0
0 0 0 0 0 0
R4 R4 R2
R3 R3 R2
1 2 0 4 5 3
0 1 2 12 16 5
A
0 0 0 0 0 0
0 0 0 0 0 0
R2 R2
R1 R1 184
Example 1 (3/4)
1 0 4 28 37 13
0 1 2 12 16 5
A
0 0 0 0 0 0
0 0 0 0 0 0
R1 R1 2 R2
x1 4 x3 28 x4 37 x5 13x6
x2 2 x3 12 x4 16 x5 5 x6
186
Rank of a Matrix
Rank (A)=0 if A=0.
A and AT has the same Rank.
187