Unit 1 Matrices

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 28

MATRICES

UNIT 1 MATRICES
______________________________________________

INTRODUCTION

Matrices provide a means of storing large quantities of information in such a way that
each piece can be easily identified and manipulated. They permit the solution of large
systems of linear equations to be carried out in a logical and formal way so that
computer implementation follows naturally. Application of matrices extends over many
areas of engineering including electrical network analysis and robotics.

LEARNING OUTCOME:

After completing this unit, students should be able to:

1. Identify a matrix and its properties.


2. Identify the various types and properties of matrices.
3. Operate matrices.
4. Find the inverse of second and third order matrix.
5. Solve systems of linear equations using Matrix Inversion Method and
Cramer’s rule.

1
MATRICES
1.1 DEFINITION

1.1.1 MATRIX

A matrix is a rectangular array of elements that appear in rows

And columns and are usually enclosed by brackets.

For example:

1 0
5 6 1 −2 3
A=[ ] B=[ ] C = [−3 −5]
8 7 3 4 −5
4 5

1.1.2 ORDER OF MATRICES

The order of a matrix is determine by the number of its rows,m and


number of its columns,n.

no. of rows x no. of columns

Order : m x n

First column n th column

:
a11 a12 a13⋯ a1n
a21 a22 a23⋯ a2n
A=[ ⋮ ⋮ ⋮ ⋮ ]
am1 am2 am3 amn m×n 𝑚th row

2
MATRICES

Example 1.1 :

column 1 column 2 column 3

The order of the matrix is

1 −2 3 row 1 2×3
B=[ ]
3 4 −5 row 2
number of rows number of columns

1 0
C = [−3 −5] The order of the matrix is 3 × 2
4 5

1.1.3 ELEMENTS

The numbers in the array are called as elements of the matrix. In


general, the element in row−i and column−j can be written as aij .Hence
the element a12 is in row 1 and column 2.

For example,

1 −2 3
Given matrix B = [ ]
−4 5 −6

Hence, matrix B have 6 elements which is


𝑏11 = 1 𝑏12 = −2 𝑏13 = 3
b21 = −4 b22 = 5 b23 = −6

3
MATRICES

1.1.4 TYPES OF MATRICES

Types of Matrices Definition Example

Row matrix - Matrix with one row [1 2 4]1×3

Column matrix - A matrix with one column 3


[ 5]
1 3×1

Square Matrix - Matrix with the same 0 3 4


5 8
[ ] [ 3 7 1]
number of rows and 8 3 2×2
4 0 5 3×3
columns

Identity Matrix - An identity matrix I is a 1 0


I2×2 = [ ]
0 1 2×2
diagonal matrix with all
diagonal element = I.
1 0 0
I3×3 = [0 1 0]
0 0 1 3×3

Equal matrices - Matrix which have same a b e f


A=[ ] B=[ ]
c d 2×2 g h 2×2
dimension and their
corresponding elements a = e, b = f, c = g and d = h

Transpose of Matrix -Transpose of matrix is a 1 0


A = [−2 3]
change of corresponding 4 5 3×2
rows and columns and
denoted as AT 1 −2 4
AT = [ ]
0 3 5 2×3

4
MATRICES

UNIT EXERCISE 1.1

1. Complete the following table

Matrix [1 −3 5] [24] 5 1 2 1 13
[ ] [ ]
7 4 −3 [ 12 22 ]
−7 −6
No of
rows
No of
columns
Order of
matrix

2. Determine the order of each of the following matrices.

3 0
1 −2 3
a) [ ] b) [9 −5]
3 4 −5
2 7

3. Determine type of matrices below whether it is a column matrix,


row matrix, square matrix or identity matrix

−4
2 5 [1
a) [2] b) [ ] c) −2 5]
3 −4
5

1 0 0
[7 1
d) [ 0 1 0] e) 8] f) [ ]
5
0 0 1

5
MATRICES

5 −3
4. Given matrix A = [ 0 1 ].
−1 9
a) Identify

i) the order of matrix A.

ii) the elements of a11 , a12 and a32.

b) Find the transpose of matrix A

4 x y 5
5. Given A = [ ]andB = [ ]. Find the values of x and y if
3 2 3 2
A = B.

6
MATRICES

1.2 OPERATIONS OF MATRICES

1.2.1 MATRIX ADDITION AND SUBTRACTION

Two matrices A and B can be added or subtracted only if they have


the same order. The sum of two matrices of different sizes is undefined.

ADDITION SUBSTRACTION

+ + - -

𝑎 𝑏 𝑒 𝑓 𝑎+𝑒 𝑏+𝑓 𝑎 𝑏 𝑒 𝑓 𝑎−𝑒 𝑏−𝑓


[ ]+[ ]=[ ] [ ]−[ ]=[ ]
𝑐 𝑑 𝑔 ℎ 𝑐+𝑔 𝑑+ℎ 𝑐 𝑑 𝑔 ℎ 𝑐−𝑔 𝑑−ℎ

+ + - -

Example 1.2 : To add matrices

5 3 −1 2
Given A = [ ] andB = [ ], find A + B
2 6 0 4

Solution:

5 3 −1 2
A+B=[ ]+[ ]
2 6 0 4

5 + (−1) 3 + 2
=[ ]
2+0 6+4

4 5
=[ ]
2 10

7
MATRICES
Example 1.3 : To subtract matrices

5 3 −1 2
Given A = [ ] and B = [ ], find A − B
2 6 0 4

Solution:

5 3 −1 2
A−B =[ ]−[ ]
2 6 0 4

5 − (−1) 3 − 2
=[ ]
2−0 6−4

6 1
=[ ]
2 2

1.2.2 SCALAR MULTIPLICATION

To multiply a matrix with a real number, we multiply each element


with this number.

SCALAR MUTIPLICATION 𝑎 𝑏 𝑘𝑎 𝑘𝑏
𝑘[ ]=[ ]
𝑐 𝑑 𝑘𝑐 𝑘𝑑

Example 1.4 :

a) 3[2 0 −1]

3
b) k [5]
1

2 −4 1
1
c) 2
[−6 3 5]
4 6 −2

Solution:

8
MATRICES

a) [3 × 2 3 × 0 3 × −1] = [6 0 −3]

k×3 3k
b) [k × 5] = [5k]
k×1 k

1 1 1
(2) (−4) (1)
2 2 2
1 1 1
c) 2
(−6) 2
(3) 2
(5)
1 1 1
[ 2 (4) 2
(6) 2
(−2)]

1
1 −2 2
= [−3 3 5 ]
2 2
2 3 −1

Example 1.5 : To perform combined operations of addition,


Subtraction and scalar multiplication

1 2 5 −6
Given A = [ ] and B = [ ]. Find:
3 4 −7 8

a) A+B
b) B−A
c) −5B
d) 2A + 3B

Solution:

1 2 5 −6
a) A+B =[ ]+[ ]
3 4 −7 8

9
MATRICES
1+5 2 + (−6)
=[ ]
3 + (−7) 4+8

6 −4
=[ ]
−4 12

5 −6 1 2
b) B−A =[ ]−[ ]
−7 8 3 4

5 − 1 −6 − 2
=[ ]
−7 − 3 8 − 4
4 −8
=[ ]
−10 4

5 −6
c) −5B = −5 [ ]
−7 8

−25 30
=[ ]
35 −40

1 2 5 −6
d) 2A + 3B = 2 [ ]+ 3[ ]
3 4 −7 8

2 4 15 −18
=[ ]+[ ]
6 8 −21 24

17 −14
=[ ]
−15 32

Example 1.6 : To find the values of unknown

3x −4 6 −2 12 −6
Given [ ]+[ ]=[ ]. Find the value of x and y.
6 7 2 y 8 10

Solution :

3x + 6 = 12 7 + y = 10
3x = 12 − 6 y = 10 − 7

10
MATRICES
6
x=3 y=3

x=2

1.2.3 MULTIPLICATION OF MATRICES

The product of a row vector A = [a b c]m×n and column vector B =


d d
[ e ] is defined as [a b c] [ e ] = ad + be + cf. This concept
f n×p f
applies to all row and column vectors as long as they have the

same size.

Am x n Bn x p

these must be equal

the order of AB is m x p

MUTIPLICATION Given A = [a b] e f g
and [ ]
c d 2×2 h i j 2×3

(a × e) + (b × h) (a × f) + (b × i) (a × g) + (b × j)
AB = [ ]
(c × e) + (d × h) (c × f) + (d × i) (c × g) + (d × j) 2×3

ae + bh af + bi ag + bj
=[ ]
ce + dh cf + di cg + dj 2×3

11
MATRICES
Example 1.7 : To multiply matrices (2x2 and 2x2)

+ 2 3 0 1
Given A = [ ] andB = [ ] . Find AB
4 7 2×2 5 6 2×2

Solution:

2 3 0 1
AB = [ ][ ]
4 7 5 6

(2 × 0) + (3 × 5) (2 × 1) + (3 × 6)
=[ ]
× (4 × 0) + (7 × 5) (4 × 1) + (7 × 6)

0 + 15 2 + 18
=[ ]
0 + 35 4 + 42

15 20
=[ ]
35 46 2×2

Example 1.8 : To multiply matrices ( 2x2 and 2x3)

3 −2 −1 2 3
Given A = [ ] and B = [ ] . Find AB
4 −1 2×2 5 −4 0 2×3

Solution:

3 −2 −1 2 3
AB = [ ][ ].
4 −1 5 −4 0

(3 × −1) + (−2 × 5) (3 × 2) + (−2 × −4) (3 × 3) + (−2 × 0)


=[ ]
(4 × −1) + (−1 × 5) (4 × 2) + (−1 × −4) (4 × 3) + (−1 × 0)

−3 + (−10) 6 + 8 9+0
=[ ]
(−4) + (−5) 8 + 4 12 + 0

−13 14 9
=[ ] .
−9 12 12 2×3

Example 1.9 : To multiply matrices ( 2x1 and 1x2)

12
MATRICES
2
Given A = [ ] and B = [0 1]1×2 . Find AB
4 2×1

Solution:

2
AB = [ ] [0 1] .
4

(2 × 0) (2 × 1)
=[ ]
(4 × 0) (4 × 1)

0 2
=[ ]
0 4 2×2

Example 1.10 : To multiply matrices (1x2 and 2x1)

0
Given A = [2 3]1×2 and B = [ ] . Find AB
5 2×1

Solution:

0
AB = [2 3] [ ]
5

= [(2 × 0) + (3 × 5)]

= [0 + 15]

= [15]1×1

Example 1.11 : To Multiply Matrices (1x3 and 3x1)

4
Given A = [1 2 3]1×3 and B = [5] . Find AB
6 3×1

Solution :

4
AB = [1 2 3] [5]
6

13
MATRICES
= [(1 × 4) + (2 × 5) + (3 × 6)]

= [4 + 10 + 18]

= [32]1×1

Example 1.12 : To Multiply Matrices (3x1 and 1x3)

4
Given A = [5] and B = [1 2 3]1×3. Find AB
6 3×1

Solution :

4
AB = [5] [1 2 3]
6

(4 × 1) (4 × 2) (4 × 3)
= [(5 × 1) (5 × 2) (5 × 3)]
(6 × 1) (6 × 2) (6 × 3)

4 8 12
= [5 10 15] .
6 12 18 3×3

14
MATRICES

UNIT EXERCISE 1.2

0 3 5 3 1 3
1. Given X = [ ], Y = [ ] and Z = [ ]. Find:
−1 6 −1 2 4 −5

a) X+Y b) Y+Z

c) Y−Z d) Z−X

e) Y + 2X − 3Z f) 3Z − X + 2Y

2 −1 1 5 3 9
2. Given A = [ ] and B = [ ], find:
6 3 −4 0 −1 −7

a) A−B b) A+B

c) 3A + 2B − A d) B − 2A

3. Find the value of x and y each of the following matrices.

x 7 2
a) [ ]=[ ]+[ ]
8 2y 4

b) [x −6] = [3x y] − [5 2y]

3 2x 4 3x 7 5x
c) [ ]+[ ]=[ ]
y 4 x −x 6 −1

6 4
4. Find matrix Q if [ ]+Q= [ ]
−2 7

15
MATRICES

5. Find the product each of the following:

3
[7 2
a) 1] [ ] b) [6 −2 4] [ 1 ]
−5
−5

−9
2
c) [ ] [ 8 4] d) [ 2 ] [7 −1 0]
−3
3

1 2
1 4 3 2
e) [ ][ ] f) [0 −3] [ ]
2 3 −2 −1
5 4

3 5
[5 1 3 −1 2 8 6
g) 2] [ ] h) [ ] [1 −2]
−2 6 5 −1 0 3
3 −1

16
MATRICES
1.3 THE INVERSION OF A MATRIX

1.3.1 Determinant

1.3.1.1 Determinant (2 X 2)

The determinants of a square matrix is a number produced by


combining the elements of the matrix in a prescribed way; it is written
as  A  or det A.

DETERMINANTS a b
If given A = [ ]
c d
(2 x 2) a b
then det A = |A| = | | = ad − cb
c d

Example 1.13 : Determinant (2 x 2)

Evaluate the following determinants:

1 2 2 −1
a). [ ] b) [ ]
3 4 −3 −3

Solution :

1 2
a) | | = ad − cb
3 4

= 1(4) − 3(2)

=4−6

= −2

2 −1
b) | | = ad − cb
−3 −3

= 2(−3) − (−3)(−1)

= −6 − 3

= −9

17
MATRICES
1.3.1.2 Determinant (3 X 3)

The determinant of a 3  3 matrix can be calculated by expanding the


top row.

DETERMINANTS a11 a12 a13 



If given A = a 21 a 22 a 23  then
(3 x 3) 
a 31 a 32 a 33 

a11 a12 a13


det A = A = a 21 a 22 a 23
a 31 a 32 a 33

a 22 a 23 a a a a
= a11 − a12 21 23 + a13 21 22
a 32 a 33 a 31 a 33 a 31 a 32

Example 1.14 : Determinant (3 x 3)

Evaluate the following determinants:

 2 1 2 1 − 2 3 
a)  0 3 1 b) 6 5 4 
  
− 1 0 4 7 8 − 6

Solution :

18
MATRICES

3 1 0 1 0 3
a) det =2 −1 +2
0 4 −1 4 −1 0
= 2 (12 − 0 ) − 1(0 + 1) + 2 (0 + 3 )
= 2 (12) − 1(1) + 2 (3 )
= 29

5 4 6 4 6 5
b) det =1 − (− 2) +3
8 −6 7 −6 7 8
= 1(− 30 − 32) + 2 (− 36 − 28) + 3 (48 − 35)
= 1(− 62) + 2 (− 64) + 3 (13)
= −151

1.3.2 Matrix Inversion

1.3.2.1 Matrix Inversion (2 2)

1 0
If A A-1 = A-1A = I ( I is an identity matrix [ ] ) then A-1 is the
0 1
inverse of A

INVERSE a b
If given A = [ ]
c d
MATRIX
1 d −b
then A−1 = |A| [ ]
−c a

1 d −b
= ad−cb [ ]
−c a

∗The matrix A is invertible if and only if ad − bc ≠ 0. If ad– bc = 0, then A does


not has an inversion.

19
MATRICES
Example 1.15 : Inverse matrix of 2 x 2

Find the inverse of these matrices

 − 1 − 2 5 3
A =
4 
a) b) B = 
3  − 6 − 2

Solution :

 − 1 − 2
a) A= 3 4 

1 4 2
A-1 = = ( −1)( 4) − ( −2)(3) = 2

A − 3 − 1
A

1 4 2
− 1(4 ) − (− 2)(3 ) − 3 − 1

=

 2 1 
= − 3 1 
 2 − 2

5 3
b) B =  − 6 − 2 B = 5( −2) − (3)( −6) = 8
 

1 − 2 − 3
B-1 =
B  6 5 

1 − 2 − 3
5(− 2) − (3 )(− 6 )  6 5 
=

− 1 − 3 
=  4 8
 3 5 
 4 8 

20
MATRICES
1.3.2.2 Matrix Inversion (3 x 3 )

If A  0 , then A has an inverse A −1 given by :

INVERSE MATRIX 1
A −1 = adj A
(3 x 3) A

Adjoint is the transpose of the matrix of cofactors is defined as the


adjoint matrix of A and is denoted by adj A.

T
ADJOINT  C11 C12 C13   C11 C 21 C 31 
   
adj A =  C 21 C 22 C 23  =  C12 C 22 C 32 
C C 33  C C 33 
 31 C 32  13 C 23

Example 1.16 : Inverse matrix of 3 x 3

 2 3 0
 
Find the inverse of A =  − 5 0 4 
 0 2 1
 

Solution :

0 4 −5 4 −5 0
A =2 −3 +0
2 1 0 1 0 2
= 2(0 − 8) − 3(− 5 − 0) + 0
= −1

Cofactors of the elements of A are

21
MATRICES

0 4 −5 4 −5 0
C11 = = −8 C12 = − =5 C13 = = −10
2 1 0 1 0 2
3 0 2 0 2 3
C 21 = − = −3 C 22 = =2 C 23 = − = −4
2 1 0 1 0 2
3 0 2 0 2 3
C 31 = = 12 C 32 = − = −8 C 33 = = 15
0 4 −5 4 −5 0

 − 8 5 − 10 
 
Matrix of cofactors is  − 3 2 − 4 
 12 − 8 15 
 

 − 8 − 3 12 
 
Adj A =  5 2 − 8
 − 10 − 4 15 
 

1
A −1 = adj A
A
 −8 − 3 12 
1  
=  5 2 − 8
− 1
 − 10 − 4 15 
 8 3 − 12 
 
= − 5 − 2 8 
 10 4 − 15 

Check :
 2 3 0  8 3 − 12   1 0 0 
−1
    
AA =  − 5 0 4  − 5 − 2 8  = 0 1 0
 0 2 1   10 4 − 15   0 0 1 
    

22
MATRICES

UNIT EXERCISE 1.3

1. Find the inverse of the following matrix

2 − 3  1 − 2
a)   b)  
3 − 4 − 3 7 

 2 1  − 3 − 1
c)   d)  
6 4  − 2 − 4

 − 2 3 0  2 −3 1 
   
e)  4 −1 5 f) − 3 −1 5 
 2 4 6   2 4 − 5 
 

23
MATRICES
1.4 SOLUTIONS OF SYSTEMS OF LINEAR EQUATIONS

A system of linear equations is a set of equations with n equations and n


unknowns, is of the form of

ax + by = e
cx + dy = f

The unknowns are denoted by x and y the coefficients (a and b) are assumed
to be given. In matrix form the system of equations above can be written as:

a b   x   e 
c d   y =  f 
    

A simplified way of writing above is like this: Ax = b

and by rearranging it, we would get that the solution would look like

X = A-1 b

−1
 x  a b   e 
 y = c d   f 
     

Example 1.17 : Solving equations using matrix inversion

The simultaneous equation

2x + 5y = 9

3x + 6y = 12

can be written in matrix form as

AX = b

24
MATRICES

2 5  x 9 2 5   x   9 
A=   X=   b=   OR 3 6  y  = 12
3 6 y 12     

Pre-multiplying the matrix equation by A-1 we obtain

A-1AX = A-1b that is X = A-1 b

x 1  6 − 5  9 
Hence  y  = (2)( 6) − (5)(3) − 3 2  12
    

1  6 − 5  9 
− 3 − 3 2  12
=

1 − 6
= −
3  − 3 

2
=  
 1

Example 1.18 : Solving equations using matrix inversion

3x + y = 1

4x + 4y = -4

Solution :

3 1  x   1 
4 4  y  = − 4
    

x 1  4 − 1  1 
 y  = (3)( 4) − (1)( 4) − 4 3  − 4
    

25
MATRICES

1  4 − 1  1 
8 − 4 3  − 4
=

1 8 
8 − 16
=

1
=  
 − 2

Example 1.19 : Solving matrix equation

By using matrix inversion method, find the value of h and k that fulfill
the matrix equation given

6 1 h − 17
2 2 k  =  16 
    

Solution :

6 1 h − 17
2 2 k  =  16 
    

h 1  2 − 1 − 17
k  = 10 − 2 6   16 
    

1  − 34 − 6 
10 − 34 + 96
=

 1  − 40
=   
10   62 

−4
= 31 
 5 

26
MATRICES

UNIT EXERCISE 1.5

1. Solve the following simultaneous equation by using matrix


inversion method

a) 2x – 3y = 11 b) 3p – q = 3

x + 2y = -5 p – 3q = 5

c) 4x + y = 10

2x – 3y = 12

2. Solve each of the following matrix

 3 1  x   11   1 − 3  p   − 3 
a)    =   b)    =  
 4 − 1 y   24   2 − 1  q   4 

 3 2  x   2   4 − 1 m  13 
c)    =   d)    =  
 6 − 4  y   0   5 − 1 n  16 

27
MATRICES
SUMMARY

MATRIX Equal Matrices

Order = No. of Row x No. of Column Matrix which have same dimension
and their corresponding elements

Addition &Substraction Multiplication of Two Matrices


Scalar Multiplication
𝑐
𝑎 𝑏 𝑒 𝑓 𝑎 𝑏 (𝑎 𝑏) ቀ𝑑 ቁ = (𝑎𝑐 + 𝑏𝑑)
ቀ ቁ±൬ ൰ 𝑘ቀ ቁ=
𝑐 𝑑 𝑔 ℎ 𝑐 𝑑
𝑘𝑎 𝑘𝑏 Order = 1 x ②②x1 1x1
𝑎±𝑒 𝑏±𝑓 ቀ ቁ
=൬ ൰ 𝑘𝑐 𝑘𝑑
𝑐±𝑔 𝑑±ℎ

Inverse Matrix
Determinant 𝑎 𝑏
𝐴=ቀ ቁ
𝑐 𝑑
2x2
1 𝑑 −𝑏
𝑎 𝑏 𝐴−1 = ቀ ቁ
𝐴=ቀ ቁ 𝑎𝑑 − 𝑏𝑐 −𝑐 𝑎
𝑐 𝑑
|𝐴| = 𝑎𝑑 − 𝑏𝑐
Solve Simultaneous Linear
3x3 Equations

If given :
det
𝑎 𝑏 𝑥 𝑒
𝑎𝑥 + 𝑏𝑦 = 𝑒 ቀ ቁ ቀ𝑦ቁ = ቀ𝑓ቁ
𝑐 𝑑
𝑐𝑥 + 𝑑𝑦 = 𝑓 A X b

X = A-1 b

28

You might also like