Sei sulla pagina 1di 24

BBMP 1103

Matematik Pengurusan
Chapter:2 Matrix
Prepared by

Richard Ng

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 1 of 47

1. Introduction to Matrix

Matrix consists of data arranged in the form of rows and


columns

Examples:

[1

3]

1x2 Matrix

1
5

2
3x1 Matrix

BBMP1103 Chapter 2 - Richard Ng (2008)

3
2

2 4

1 5

2x1 Matrix

2x2 Matrix

3 1 0
5 2 1

1 2 3
0 1 5

7 2 3

2x3 Matrix

3x3 Matrix

Page 2 of 47

2. Elements of a 3 x 3 Matrix

a
a

11

21

22

31

32

12

a
a

a
13

23

33

a11 is located at row one and column one


a12 is located at row one and column two
a13 is located at row one and column three
a21 is located at row two and column one
a22 is located at row two and column two
a32 is located at row three and column two
aij is located at row i and column j

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 3 of 47

3. Classifications of Matrices

Column Matrix (Column Vector): has only 1 column


2
1
2

3

0
1
2


0
1

Column Matrix
2x1

Column Matrix

Column Matrix

3x1

4x1

Row Matrix (Row Vector): has only 1 row

[1

2]

[2

0 1]

[3

1 0 4]

Row Matrix

Row Matrix

Row Matrix

1x2

1x3

1x4

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 4 of 47

Zero Matrix (Null Matrix): all elements are zero

0 0
0 0

0 0 0
0 0 0

0
0

0
0

0 0 0
0 0 0

0 0 0

Square Matrix: number rows = number of columns

1 2
3 4

2 1 5
3 4 8

1 2 0

2x2 Matrix

3x3 Matrix

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 5 of 47

Main Diagonal

1 2
(i) 3 4

(ii)

2 1 5
3 4 8

1 2 0

a
a

(iii)
a

11

21

22

31

32

a
a

12

13

23

33

Elements located on the main diagonal in a square


matrix are elements which have the same row
and column number. Examples:

In example (i): a11 = 1 and a22 = 4 hence the elements


on the main diagonal are 1 and 4

In example (ii): a11 = 2, a22 = 4 dan a33 = 0 hence


the elements on the main diagonal are 2, 4 dan 0

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 6 of 47

Identity Matrix

An Identity matrix is a square matrix where all the


elements on the main diagonal = 1 and the rest = 0

Example:

1 0 0
0 1 0

0 0 1

1 0
0 1

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 7 of 47

4. Matrix Operations

Transpose

Elements in a row elements in a column


Elements in a column elements in a row
Example: 1
If

1 0 3
A=

2 4 1

1 2

T
Then A = 0 4

3 1

Example: 2
If

1 2 3
B = 4 5 6
7 8 9

BBMP1103 Chapter 2 - Richard Ng (2008)

1 4 7

T
Then B = 2 5 8
3 6 9
Page 8 of 47

Matrix Addition

Addition in a matrix involves elements at the same position


and same type of matrix only
Example: 3

1 2 2 0
3 2
3 4 + 1 3 = 4 7

Example: 4

1 3 2 1
0 1 + 1 3

2 0 4 2

3 4
= 1 4
6 2

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 9 of 47

Matrix Subtraction

Subtraction in a matrix involves elements at the same


position and same type of matrix only
Example: 5

1 2 2 0
1 2

=
3 4 1 3
2 1

Example: 6

1 3 2 1
0 1 1 3

2 0 4 2

1 2
= 1 2
2 2

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 10 of 47

Matrix Multiplication

Scalar multiplication when a matrix is multiplied by a


scalar, every element must be multiplied with that scalar
Example: 7

1 2
A=

3 4

If

1 2 2 4
=

3 4 6 8

Then 2A = 2

Example: 8

1 0 2
1 0 2 3 0 6

B = 2 1 4 Then 3B = 32 1 4 = 6 3 12

3 1 0
3 1 0 9 3 0

If

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 11 of 47

Multiplication of Matrices

Multiplication of Matrices is only possible when the number


of rows in the 1st matrix = number of columns in the 2nd
Matrix

Tips:
Matrix
2x1

Matrix
1x2

Matrix
2x2

Matrix
2x3

Matrix
3x3

Matrix
2x3

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 12 of 47

Example: 9
2 1 1 2 2 + 0 4 + 1 2 5
3 4 0 1 = 3 + 0 6 + 4 = 3 10

Example: 10
2

2 0
2 0 2 0
1 3 = 1 3 1 3 =

Example: 11
1 3 2 2 + 3 5
2 4 1 = 4 + 4 = 8

4 + 0 0 + 0 4 0
2 + 3 0 + 9 = 5 9

Example: 12
1 3 1 2 3 2 2 + 9 + 1 3 + 0 + 1 2 + 9 + 0 12 4 11
0 1 2 3 0 3 = 0 + 3 + 2 0 + 0 + 2 0 + 3 + 0 = 5 2 3

2 0 1 1 1 0 4 + 0 + 1 6 + 0 + 1 4 + 0 + 0 5 7 4
BBMP1103 Chapter 2 - Richard Ng (2008)

Page 13 of 47

5. Determinant
Is defined only for square matrices
Is used to find the invertible matrix

Finding determinant using cross multiplication

a) For a 2 x 2 Matrix

If A =

2 1
4 3

Hence the determinant of A = |A| = (2)(3) (4)(1)


=64
=2
BBMP1103 Chapter 2 - Richard Ng (2008)

Page 14 of 47

b) For a 3 x 3 Matrix

If B =

2 1 3
0 3 1

4 2 0

Hence |B| = 0

3 2
1 0
0 4

1
3
2

1
3
2

= [(2)(3)(0)+(1)(1)(4)+(3)(0)(2)][(4)(3)(3)+(2)(1)(2)+(0)(0)(1)]
= [0 + 4 + 0][36 + 4 + 0]
= -36
BBMP1103 Chapter 2 - Richard Ng (2008)

Page 15 of 47

Example: 13
If A =

0 1
2 4

1 2
and B =

0 1

a) |A|

b) |B|

e) |A||B|

f) |B||A|

Find:

c) |AB|

d) |BA|

Answer:
0 1
4

a) A = 2

Hence |A|= (0)(4) (2)(-1)


= 0 (-2)
=2

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 16 of 47

1 2
b) B =

0 1

Hence |B|= (1)(1) (0)(2)


=10
=1

0 1 1
4 0

c) AB = 2

2
0 + 0 0 + (1)
=

1
4 + 4
2 + 0
0 1
=

2 8

0 1
Hence |AB|=

2 8
= (0)(8) (2)(-1)
= 0 (-2) = 2
BBMP1103 Chapter 2 - Richard Ng (2008)

Page 17 of 47

0 + 4
1 2 0 1
d) BA =
2 4 = 0 + 2

0 1

1 + 8
0 + 4

4 7

2 4

4 7

Hence |BA| =

2 4
= (4)(4) (2)(7)
= 16 14
=2
BBMP1103 Chapter 2 - Richard Ng (2008)

Page 18 of 47

e) From (a) dan (b):


|A| = 2

|B| = 1

Hence |A||B| = (2)(1) = 2

f) From (a) dan (b):


|A| = 2

|B| = 1

Hence |B||A| = (1)(2) = 2

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 19 of 47

Finding determinant using Cofactor Method


Example: 14

1 2

Given P =

3 4
Step: 1 Find the matrix minor of P:
Minor of P:

a
= 11
a21

1 2
a11 =

3 4

4 3
a12
=
2 1
a22

=4

1 2
a21 =
=2
3
4

BBMP1103 Chapter 2 - Richard Ng (2008)

1 2
a12 =
=3
3
4

1 2
a22 =

3 4

=1

Page 20 of 47

Step: 2 Find the cofactor of P:


Element in a cofactor = element in minor x (-1)(i+j)

4 (1) (1+1) 3 (1) (1+ 2 )


Hence cofactor of P =

( 2 +1)
1 (1) ( 2+ 2 )
2 (1)
4 (1) ( 2 ) 3 (1) ( 3)
=

( 3)
1 (1) ( 4 )
2 (1)

4 3
=
1
2
BBMP1103 Chapter 2 - Richard Ng (2008)

Page 21 of 47

Step: 3 Find the determinant:


Determinant = Product of elements in the original matrix
and elements of the cofactor of a row

1 2

Original matrix P =

3 4

4 3
1
2

Cofactor of P =

Choose first row to find the determinant:


Determinant = (1)(4) + (2)(-3)
= 4 + (-6)
= -2
BBMP1103 Chapter 2 - Richard Ng (2008)

1 2 4 3
3 4 2
1


Page 22 of 47

Example: 15

2 1 3
Given that Q = 0 3 1

4 2 0
Using the second row to find the determinant, then:
Step: 1 Find the elements in the 2nd row of Minor Q:

2 1 3
a21 = 0 3 1
4 2 0

= (1)(0) (2)(3) = 0 6 = - 6

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 23 of 47

2 1 3
a22 = 0 3 1 = (2)(0) (4)(3) = 0 12 = - 12
4 2 0

2 1 3
a23 = 0 3 1 = (2)(2) (4)(1) = 4 4 = 0
4 2 0
Step: 2 Find elements in the 2nd row of cofactor Q:

a21 = (6)(1) ( 2+1) = (6)(1) = 6

a22 = (12)(1) ( 2+ 2 ) = (12)(1) = 12


a23 = (0)(1) ( 2+3) = (0)(1) = 0
BBMP1103 Chapter 2 - Richard Ng (2008)

Page 24 of 47

Step: 3 Find the determinant:


Determinant = Product of elements in the original matrix
and elements of the cofactor of a row

2 1 3
0 3 1

4 2 0

6 -12

Determinant = (0)(6) + (3)(-12) + (1)(0)


= 0 + (-36) + (0)
= -36

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 25 of 47

6. Inverse Matrix

Finding the Inverse Matrix of the type 2x2

Example: 16
Let A =

2 1
4 3

Step: 1 Find the determinant


|A| =

2 1
4 3

= (2)(3) (4)(1)
=64
=2

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 26 of 47

Step: 2 Find the adjoint of A

3 1
4 2

2 1
4 3

Elements of Main Diagonal


Change position
Elements Second Diagonal
Change sign

Step: 3 Find the inverse matrix of A = A-1

A 1 =

1
x[Adjo int A ]
|A|

1
2

A-1 = | A | x 4

1 3
= 2 x 4

= 2

1
2

1

2
1

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 27 of 47

Finding the Inverse Matrix of the type 3x3


Example: 17
Let A =

1 4
0 2

2 3

1
0
3

Step: 1 Find the determinant of A

|A| =

1 4
0 2

2 3

1
0
3

0 2
2 3

BBMP1103 Chapter 2 - Richard Ng (2008)

= [6+0+0] [4+0+0]
=64
=2

Page 28 of 47

Step: 2 Find the Minor for matrix A

1 4

a11 = 0 2
2 3

1
0 = (2)(3) (-3)(0) = 6 0 = 6
3

1 4

a12 = 0 2
2 3

1
0 = (0)(3) (2)(0) = 0 0 = 0
3

1 4

a13 = 0 2
2 3

1
0 = (0)(-3) (2)(2) = 0 4 = -4
3

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 29 of 47

1 4

a21 = 0 2
2 3

1
0 = (4)(3) (-3)(1) = 12 + 3 = 15
3

1 4

a22 = 0 2
2 3

1
0 = (1)(3) (2)(1) = 3 2 = 1
3

1 4

a23 = 0 2
2 3

1
0 = (1)(-3) (2)(4) = -3 8 = -11
3

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 30 of 47

1 4

a31 = 0 2
2 3

1
0 = (4)(0) (2)(1) = 0 - 2 = -2
3

1 4

a32 = 0 2
2 3

1
0 = (1)(0) (0)(1) = 0 0 = 0
3

1 4

a33 = 0 2
2 3

1
0 = (1)(2) (0)(4) = 2 0 = 2
3

BBMP1103 Chapter 2 - Richard Ng (2008)

Matrix Minor A =

Page 31 of 47

6
15

0 4
1 11
0
2

Step: 3 Find the cofactor of A

Matrix cofactor A =

6
15

2
6

= 15
2

BBMP1103 Chapter 2 - Richard Ng (2008)

0 4 +
1 11

0
2 +

+

+

0 4
1 11
0 2
Page 32 of 47

Step: 4 Find the adjoint of A


Adjoint A = [Cofactor A]T
6
15

0 4
1 11
0 2

6
0

15
1
11

2
0
2

Step: 5 Find A-1


A-1 =

6 15 2
1
0
1
0
| A|
4 11 2

6 15 2

= 0 1 0 = 0
2
2
4 11 2

15
2
1
2
11
2

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 33 of 47

7. Solving Simultaneous Equations


Inverse Matrix Method
Example:18
Find the value of x and y for the following equations:
x+y=2
2x y = 1

Step: 1 Change the equations in the form AX = B


1 1 x 2
x+y=2
2 1 y = 1
2x y = 1


Step: 2 Find the determinant of A

1 1

2 1

Let A =

BBMP1103 Chapter 2 - Richard Ng (2008)

Hence |A| = (-1) (2) = -3


Page 34 of 47

Step: 3 Find the adjoint matrix A


1
2

1 1
2 1

1
1

Step: 4 Find the inverse matrix of A


1 1
A-1 =
| A | 2

1
1 1
=

1
-3 2

1
3
3
= 2 1

Step: 5 Multiply B with the inverse matrix


1
1
x 3
3 2
y = 2
1 1


3
3
BBMP1103 Chapter 2 - Richard Ng (2008)

Page 35 of 47

2 + 1 3
x
1


Hence = 3 3 = 3 =
y 4 1 3 1

3 3 3
Thus x =1 and y = 1
Check:

x + y = 2 (a)
2x y = 1 (b)

(a) + (b) =>


Then

3x = 3
x=1

Substitute
Then
and

x = 1 into (a)
1+y=2
y=1

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 36 of 47

Example: 19
Solve the following equations:
x + 4y + z = 1
2y = 3
2x 3y + 3z = 0
Step: 1 Change the equations in the form AX = B
x + 4y + z = 1
2y = 3
2x 3y + 3z = 0

1 4
0 2

2 3

1
0
3

x
y

z

1
3

0

Step: 2 Find the determinant of A


Dari ms 28:

|A| = 2

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 37 of 47

Step: 3 Find the minor of A


6

From slide 32: Minor A = 15 1 11

Step: 4 Find the cofactor of A


6

From slide 32: Cofactor A = 15


2

0 4
1 11
0 2

Step: 5 Find the adjoint of A


6
From slide 33: Adjoint A = 0
4
BBMP1103 Chapter 2 - Richard Ng (2008)

15
1
11

2
0
2
Page 38 of 47

Step: 6 Find the inverse matrix A-1


15

3 2

1
Inverse A = 0
2

2 11

From slide 33:

Step: 7 Solve the equations

x Inverse 1
y = Matrix 3


z A 0
BBMP1103 Chapter 2 - Richard Ng (2008)

15

2
x
1
y = 0

2
z
2 11

Page 39 of 47

45
1

1
3 + 2 + 0 19


2
1

1
3
0 3 = 0 + + 0 = 1

2
2

33
1

2 + + 0 14
1

Hence the value of x = 19


y=1

1
2

and z = 14
BBMP1103 Chapter 2 - Richard Ng (2008)

1
2

1
2
Page 40 of 47

Cramers Rule Method

Example: 20
Solve the equations:

x + 2y = 0
2x y = 5
Step: 1 Change the equation in the form AX = B

1 2 x 0
2 1 y = 5


Step: 2 Find |A|, |A1| dan |A2|
Let A =

1 2
2 1

|A| = (-1) (4) = -5

BBMP1103 Chapter 2 - Richard Ng (2008)

Let A1 =

0 2
5 1

Let A2 =

1
2

0
5

Page 41 of 47

|A1| = (0) (10) = -10

|A2| = (5) (0) = 5

Step: 3 Find the value of x and y


x=

| A1 |
|A|

y=

| A2 |
5
=
|A|
-5

= - 10 = 2
-5

BBMP1103 Chapter 2 - Richard Ng (2008)

= -1

Page 42 of 47

Example: 21
Solve the equations:

2 x y + 3z = 3
x + 2y z = 4
2x 2z = 0
Step: 1 Change the equations in the form AX = B

2 1
1 2

2 0

3 x 3
1 y = 4
2 z 0

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 43 of 47

Step: 2 Find |A|, |A1|, |A2| dan |A3|


Let A =

2 1
1 2

2 0

3 2
1 1
2 2

1
2
0

Hence |A| = [-8+2+0] [12+0+2] = -6 14 = -20

Let A1 =

3 1
4 2

0 0

3 3 1
1 4 2
2 0 0

Hence |A1| = [-12+0+0] [0+0+8] = -12 8 = -20

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 44 of 47

Let A2 =

2 3 3 2
1 4 1 1

2 0 2 2

3
4
0

Hence |A2| = [-16+(-6)+0] [24+0+(-6)] = -22 18 = -40

Let A3 =

2 1
1 2

2 0

3 2 1
4 1 2
0 2 0

Hence |A3| = [0+(-8)+0] [12+0+0] = -8 12 = -20

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 45 of 47

Step: 3 Find the value of x, y and z

20
= 1
20

x=

| A1 |
|A|

y=

40
| A2 |
=
= 2
|A|
20

z=

| A3 |
20
=
= 1
| A|
20

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 46 of 47

End of
Chapter
2

BBMP1103 Chapter 2 - Richard Ng (2008)

Page 47 of 47

Potrebbero piacerti anche