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

DBM 1033 MATHEMATICAL COMPUTING

CHAPTER 5 MATRICES & LINEAR ALGEBRA

Learning Outcomes:

At the end of this subtopic, students should be able to:


1) solve algebraic operation in matrix.
2) do the solution for transposition, determinant and inverse of matrices
2) solve simultaneous linear equation by using Cramer’s Rule

5.1 Understand Matrix

A) Identify Characteristics of a Matrix


Matrix is a rectangular array of numbers. It has numbers entry which is known as element.
Matrix has its own order depends on rows and columns.
Column 1

Column 2

Column 3

 k11 k12 k13  Row 1


 
Matrix C =  k21 k22 k23  Row 2

k
 31 k32 k33  Row 3

Element of a Matrix C can be denoted by kij where ith refers to no. of row and jth refers to no.
of column.

a) Element
Each number in matrix is known as element. The numbers should be real number. Matrix C
has ‘k’ elements where ‘k’ is a constant and ‘k’ is any real numbers.

b) Order
Order in matrix is depended on its rows and columns. Usually we state letter m as rows and
letter n as columns. Thus order of a matrix depends on m rows by n columns or (m x n).
Matrix C has 3 rows and 3 columns. Thus, the order of Matrix C is 3 by 3 (3 x 3).

57 | P a g e
DBM 1033 MATHEMATICAL COMPUTING

Example: Below are the examples of matrices.

Name Order Presentation


Row Matrix 1 row x 2 columns (1 x 2) (3 2)
1 row x 3 columns (1 x 3)
(5 7 3)
Name Order Presentation
Column Matrix 2 rows x 1 column (2 x 1)  − 1
 
 10 
3 rows x 1 column (3 x 1)  0 
 
 8 
 − 2
 
Square Matrix 2 rows x 2 column (2 x 2)  1 4
 
3 9
3 rows x 3 columns (3 x 3) 7 0 3 
 
3 4 − 6
−1 − 3 2 
 
Diagonal Matrix 2 rows x 2 column (2 x 2) 3 0
(all non-zero  
diagonal  0 8 
elements) 3 rows x 3 columns (3 x 3) 4 0 0
 
0 5 0
0 0 6
 

Example :

a11 = 2 a13 = 5 a22 = 8

a12 = 4 a21 = 7 a23 = 9

58 | P a g e
DBM 1033 MATHEMATICAL COMPUTING

B) Write Identity Matrix


Identity matrix is a matrix which its diagonals’ element are equal to 1 and overall
non-diagonal elements are 0.
Name Order Presentation

 1 0
Identity 2 rows x 2 column (2 x 2) I 2 =  
Matrix, In  0 1 

 1 0 0
3 rows x 3 columns (3 x 3)  
I3 =  0 1 0 
 0 0 1
 

C) Calculate the Operations of Addition, Subtraction and Multiplication


Involving Matrices
Addition and Subtraction

Two matrices can be added or subtracted if both matrices have the SAME ORDER.

Example:
a. (3 4 5 ) + (1 2) = no solution (not same order)

b. (3 8 ) + (1 4 ) = (3 + 1 8 + 4 ) = (4 12)

 1  7   1 − 7   − 6 
       
c.  5  −  3  =  5 − 3  =  2 
6 5 6 − 5  1 
       

Multiplication

 A Scalar Multiplication: Number x Matrix

Let k be any constant number and A is 2 x 2 matrix then

a a12   k × a11 k × a12 


kA = k ×  11  =  
a
 21 a 22   k × a 21 k × a 22 

Example:

 2 − 10   3 × 2 3 × −10   6 − 30 
3 = = 
1 4   3 × 1 3 × 4   3 12 

123 | P a g e
DBM 1033 MATHEMATICAL COMPUTING

 Matrix Multiplication: (Matrix) x (Matrix)

Two matrices can be multiplied when the number of columns for the first matrix is the
same as the number of rows for the second matrix.

Example:

1 3 5
1.   ×  
2 4 6

2 x 2 2 x 1

Number of columns of 1st matrix = 2


Number of rows of 2nd matrix = 2

Then, multiplication can be done.

How to draw Table of Multiplication for Example 4 (1):

Step 1: Identify the number of rows of 1st Matrix.

1st matrix has 2 rows then draw 2 vertical lines

2 vertical
lines

Step 2: Identify the number of columns of 2nd Matrix.

2nd matrix has 1 column then draw 1 horizontal line perpendicular to the vertical lines.

Step 3: Inside 1st row and 1st column of the table, write symbols multiplication (x)

1st row x
1stcolumn

124 | P a g e
DBM 1033 MATHEMATICAL COMPUTING

Step 4: Inside 2nd row and 1st column of table, insert the element of 1st row of 1st matrix.

x
2nd row
1st column
1 3

Step 5: Inside 3rd row and 1st column of table, insert the element of 2nd row of 1st matrix.

1 3
3rd row
1st column
2 4

Step 6: For 1st row and 2nd column of the table, write down the element of the 2nd matrix.

x 5 1st row
6 2nd column

1 3
2 4

Step 7: Thus, 1st element in 2nd row and 1st column should be multiplied with 1st element in 1st
row and 2nd column and 2nd element in 2nd row and 1st column multiply with 2nd element in 1st
row and 2nd column. Then, sum the elements together. Continue by doing the same for another
elements in other rows and columns.

5
x
6

1 3 (1 x 5) + (3 x 6) = 23

2 4 (2 x 5) + (4 x 6) = 34

 23 
The answer of this question is  
 34 

3 5 − 5
 − 1 2 − 2  
2.   ×  0 7 2 
 11 4 5  1 0 1 
 

Number of columns of 1st matrix = 3


Number of rows of 2nd matrix = 3

125 | P a g e
DBM 1033 MATHEMATICAL COMPUTING

Solution:

Step 1: Draw 2 vertical lines as no. of rows for the 1st matrix is 2 and draw 3 horizontal lines
as no. of columns for 2nd matrix is 3. The horizontal lines must cross the vertical lines. See
illustration below.

Step 2: Write inside of the table like the illustration below.

3 5 -5
x 0 7 2
1 0 1

-1 2 -2

11 4 5

Step 3: Calculate each element for rows and columns and sum them. Continue doing the
same until the empty blocks are filled with the answer. See next illustration.

3 5 -5
x 0 7 2
1 0 1

(-1 x 3 ) = -3 (-1 x 5 ) = -5 (-1 x -5) = 5


-1 2 -2 (2x0)=0 ( 2 x 7 ) = 14 (2x2)=4
(-2 x 1 ) = -2 (-2 x 0 ) = 0 (-2 x 1 ) = -2

= -3 + 0 + (-2) = -5 = -5 + 14 + 0 = 9 = 5 + 4 + (-2) = 7

(11 x 3) = 33 (11 x 5) = 55 (11 x -5) = -55


11 4 5 (4 x 0 ) = 0 (4 x 7 ) = 28 (4x2 )=8
(5 x 1 ) = 5 (5 x 0 ) = 0 (5x1 )=5

= 33 + 0 + 5 = 38 = 55 + 28 + 0 = 83 = -55 + 8 + 5 = -42

Thus, the answer will present in 2 x 3 matrix such illustration below:

− 5 9 7 
 
 38 83 − 42 

126 | P a g e
DBM 1033 MATHEMATICAL COMPUTING

D) Write Transposition of a Matrix


If we exchange the rows and the columns of a matrix with order m x n, we would be able to
obtain a new matrix with the order n x m. This matrix is called a transpose matrix and is
denoted by AT.

Example:

2 0 − 9
 
A =  2 1 − 6
 6 0 − 1
 
1

Transpose A, then

 2 2 6 1
 
AT =  0 1 0
 − 9 − 6 − 1
 

E) Calculate the Determinant of a Matrix


In this topic, students need to calculate 2 types of determinant which are determinant of 2 x
2 matrix and determinant of 3 x 3 matrix.

Determinant of 2 x 2 matrix

Example:

 1 2
Let C =   , find the determinant of C.
3 5

Solution:

 1 2
Det (C) =   = 1(5) – 2(3) = 5 – 6 = -1
3 5

127 | P a g e
DBM 1033 MATHEMATICAL COMPUTING

Determinant of 3 x 3 matrices

Example:

 2 2 1
 
Let B =  3 1 1  , find the determinant of B.
 1 3 2
 
First, add the 1st and 2nd column at the
back of matrix. Then, do the cross as
Solution: shown in number 1, 2, 3, 4, 5 and 6.

1 2 3

2 2 1 2 2
 
3 1 1 3 1
Determinant (B) =
1
 3 2 1 3

6 5 4

= [(multiplication of 1) + (multiplication of 2) + (multiplication of 3)] –


[(multiplication of 4) + (multiplication of 5) + (multiplication of 6)]
= [(2 x 1 x 2) + (2 x 1 x 1) + (1 x 3 x 3)] –
[(2 x 3 x 2) + (2 x 1 x 3) + (1 x 1 x 1)]
= [4 + 2 + 9] – [12 + 6 + 1]
= (15) – (19)
=-4

F) Determine the Inverse of a Matrix


In this topic, students should learn 2 types inverse of matrix which are inverse of 2x2 matrix
and inverse of 3x3 matrix.

Inverse of 2 x 2 Matrix

a b 
Let A =   then inverse of A is
 c d 

1  d − b
A −1 =  
Det (A )  − c a 

128 | P a g e
DBM 1033 MATHEMATICAL COMPUTING

Example:

 1 4
Let A =   , find the inverse of A.
3 9 

Step 1: Determinant of A.

Determinant (A) = (1)(9 ) − (4 )(3 ) = −3

Step 2: Apply formula inverse of A

1  9 − 4
A −1 =  
− 3  − 3 1 

  1   1 
 9  − 4 
  −3  − 3 
A −1 =
  1   1  
 − 3  1  
 −3 −3 

 4 
− 3 
A −1 = 3 
 1 1 
 
 −3

Inverse of 3 x 3 Matrix

Example:

 1 1 2
 
Let D =  0 2 4  , find the inverse of D
 1 3 1
 

Step 1: Find Determinant of D

1 1 2 1 1 
 
0 2 4 0 2
1
 3 1  1 3 
Determinant (D)
= [(1× 2 × 1) + (1× 4 × 1) + (2 × 0 × 3 )] −
[(1× 0 × 1) + (3 × 4 × 1) + (1× 2 × 2)]
= (2 + 4 + 0 ) − (0 + 12 + 4 )
= 6 − 16 = −10

129 | P a g e
DBM 1033 MATHEMATICAL COMPUTING

Step 2: Minor of D

 1 1 2  1 1 2  1 1 2
     
m11 =  0 2 4  m12 = 0 2 4 m13 = 0 2 4
 1 3 1    1 3 1
   1 3 1  

m11 = (2 )(1) − (4 )(3) = −10 m12 = (0 )(1) − (4 )(1) = −4 m13 = (0 )(3) − (2 )(1) = −2

 1 1 2  1 1 2  1 1 2
     
m 21 = 0 2 4 m 22 = 0 2 4 m 23 = 0 2 4
 1 3 1  1 3 1  1 3 1
     

m21 = (1)(1) − (2 )(3) = −5 m22 = (1)(1) − (2 )(1) = −1 m23 = (1)(3) − (1)(1) = 2

 1 1 2  1 1 2  1 1 2
     
m 31 = 0 2 4 m32 = 0 2 4 m33 = 0 2 4
 1 3 1  1 3 1  1 3 1
     

m31 = (1)(4 ) − (2 )(2 ) = 0 m32 = (1)(4 ) − (2 )(0 ) = 4 m33 = (1)(2 ) − (1)(0 ) = 2

Thus, Matrix Minor of D:

 − 10 − 4 − 2 
 
 − 5 −1 2 
 0 4 2 

Step 3: Cofactor of D

 − 10 (− ) − 4 − 2 
 
Cof (D ) =  (− ) − 5 − 1 (− )2 
 0
 (−)4 2 
 − 10 4 − 2 
 
Cof (D ) =  5 − 1 − 2 
 0 −4 2 
 

130 | P a g e
DBM 1033 MATHEMATICAL COMPUTING

Step 4: Adjoint of D / Adjugate of D

Adj (D) = [Cof (D)]T

T
 − 10 4 − 2 
[Cof (D)] T 
=  5 − 1 − 2

 0 −4 2 
 
 − 10 5 0 
 
Adj (D ) =  4 − 1 − 4
 −2 −2 2 
 

Step 5: Inverse of D

D −1 =
1
Det (D )
[ ]
Adj (D )

 − 10 5 0 
−1 1  
D =  4 −1 − 4
− 10  
 −2 −2 2 
  1   1   1  
 − 10 ×   5×  0×  
  − 10   − 10   − 10  
  1   1   1 
=  4×  − 1×   − 4× 
  − 10   − 10   − 10  
  1   1   1  
 − 2 ×  − 10  − 2 ×  − 10  2 ×  − 10  
       
 1 
 1 − 0 
 2 
−1  2 1 2 
D = −
 5 10 5 
 1 1 1
 − 
 5 5 5

131 | P a g e
DBM 1033 MATHEMATICAL COMPUTING

A) Explain the Procedure to Solve Linear Equations


B) Solve Simultaneous Linear Equations with Three Variables by Using
Cramer’s Rule
There are two types system of linear equations that students should know. The 1st type is 2
variables linear equation and 2nd type is 3 variables linear equation. In this topic, students have
to solve both linear equations by using Cramer’s rule.

The procedure to solve both types will be explained below:

2 variables linear equation

Example:

Solve these simultaneous 2 variables linear equations

2x + 4 y = 2
− 2x − 3y = 5

Solution:

Step 1: Write in the form of Ax = b

 2 4   x   2
  ×   =  
 − 2 − 3  y  5

Step 2: Determinant of A
 2 4 
Determinant (A) =   = (2)(− 3 ) − (4 )(− 2) = −6 + 8 = 2
 − 2 − 3

Step 3: Determinant of x
2 4 
Determinant (x) =   = (2)(− 3 ) − (4 )(5 ) = −6 − 20 = −26
5 − 3

Step 4: Determinant of y
 2 2
Determinant (y) =   = (2)(5 ) − (2)(− 2) = 10 + 4 = 14
 − 2 5
Step 5: Values of x and y

Det (x ) − 26
x= = = −13
Det (A ) 2
Det (y ) 14
y= = =7
Det (A ) 2

132 | P a g e
DBM 1033 MATHEMATICAL COMPUTING

3 variables linear equation

Example 11

Solve these simultaneous 3 variables linear equations

2 x − 2y + z = 3
3x + y − z = 7
x − 3 y + 2z = 0

Step 1: Write in the form of Ax = b


 2 − 2 1  x   3 
     
 3 1 − 1 ×  y  =  7 
 1 − 3 2  z  0
     

Step 2: Determinant of A
 2 − 2 1 2 − 2 
 
A =  3 1 − 1 3 1 
 1 − 3 2 1 − 3 
 
Determinant (A)
= [(2 × 1× 2) + (− 2 × −1× 1) + (1× 3 × −3 )] −
[(2 × 3 × −2) + (− 3 × −1× 2) + (1× 1× 1)]
= [4 + 2 + (− 9 )] − [(− 12 + 6 + 1)]
= −3 − (− 5 )
=2

Step 3: Determinant of x

 3 − 2 1 3 − 2 
 
x =  7 1 − 1 7 1 
 0 − 3 20 − 3 
 

Determinant (x)
= [(3 × 1× 2) + (− 2 × −1× 0 ) + (1× 7 × −3 )] −
[(2 × 7 × −2) + (− 3 × −1× 3) + (0 × 1× 1)]
= [6 + 0 + (− 21)] − [(− 28 + 9 + 0 )]
= −15 − (− 19 )
=4

133 | P a g e
DBM 1033 MATHEMATICAL COMPUTING

Step 4: Determinant of y

2 3 1 2 3
 
y = 3 7 − 1 3 7
1 0 2 1 0
 

Determinant (y)
= [(2 × 7 × 2) + (3 × −1× 1) + (1× 3 × 0 )] −
[(2 × 3 × 3) + (0 × −1× 2) + (1× 7 × 1)]
= [28 − 3 + 0] − [(18 + 0 + 7 )]
= 25 − 25
=0

Step 5: Determinant of z

2 − 2 32 − 2
 
z = 3 1 7  3 1
1−3 0 1 − 3
 

Determinant (z)
= [(2 × 1× 0 ) + (− 2 × 7 × 1) + (3 × 3 × −3 )] −
[(0 × 3 × −2) + (− 3 × 7 × 2) + (1× 1× 3)]
= [0 − 14 + (− 27 )] − [(0 − 42 + 3 )]
= −41 − (− 39 )
= −2

Step 6: Values of x, y and z

Det (x ) 4
x= = =2
Det (A ) 2
Det (y ) 0
y= = =0
Det (A ) 2
Det (z ) − 2
z= = = −1
Det (A ) 2

134 | P a g e

You might also like