Financial Mathematics Course FIN 118 Unit Course 5 Number Unit Matrices Unit Subject
Financial Mathematics Course FIN 118 Unit Course 5 Number Unit Matrices Unit Subject
Financial Mathematics Course FIN 118 Unit Course 5 Number Unit Matrices Unit Subject
=
7 1 1 5
1 2 0 4
0 3 1 2
4 , 3
A
4 Columns
3
R
o
w
s
Definition:
5
Example of Matrix
Food shopping online: people go online to shop four items
and have them delivered to their homes.
Cartons of eggs, bread, bags of rice, packets of chickens
were ordered online and the people left their address for
delivery.
A selection of orders may look like this:
Order
Address
Carton of
eggs
Bread Rice Chicken
Al Wuroud
2 1 3 0
Al Falah
4 0 2 1
Al Izdihar
5 1 1 7
6
Matrix notation
A matrix is defined by its order which is always
number of rows by number of columns.
A horizontal set of elements is called a row
A vertical set is called a column
First subscript refers to the row number
Second subscript refers to column number
( )
(
(
(
(
=
mn m m m
n
n
n m
a a a a
a a a a
a a a a
A
...
. . . .
...
...
3 2 1
2 23 22 21
1 13 12 11
,
7
Matrix notation
It has the dimensions m by n (m x n)
( )
(
(
(
(
=
mn m m m
n
n
n m
a a a a
a a a a
a a a a
A
...
. . . .
...
...
3 2 1
2 23 22 21
1 13 12 11
,
row 2
column 3
( )
(
(
(
=
7 1 1 5
1 2 0 4
0 3 1 2
4 , 3
A
7 , 1 , 1 , 5
1 , 2 , 0 , 4
0 , 3 , 1 , 2
34 33 32 31
24 23 22 21
14 13 12 11
= = = =
= = = =
= = = =
a a a a
a a a a
a a a a
8
Types of matrices
1/ Row vector m=1 2/ Column vector n=1
3/ Square Matrix m=n
( )
| |
n n
r r r R .......
2 1 , 1
=
( )
(
(
(
(
(
(
m
m
c
c
c
C
.
.
2
1
1
( )
(
(
(
=
7
3
1
1 , 3
C
( )
| | 1 4 2 3
4 , 1
= R
( )
(
(
(
(
=
nn n n n
n
n
n n
a a a a
a a a a
a a a a
A
...
. . . .
...
...
3 2 1
2 23 22 21
1 13 12 11
,
( )
(
(
(
=
7 2 1
5 4 3
3 2 1
3 , 3
A
Some other Matrices
Zero Matrix
Transpose of a matrix
Symmetric matrix
Diagonal matrix
Identity matrix
Upper triangular matrix
Lower triangular matrix
9
Zero Matrix
Every element of a matrix is zero, it is called a
zero matrix, i.e.,
The symbol O is used to denote the zero matrix.
10
(
(
(
(
=
0 ... 0 0
. ... . .
0 ... . .
0 ... 0 0
O
11
Transpose of a matrix
The matrix obtained by interchanging the rows and
columns of a matrix A is called the transpose of A
(write A
T
or A).
e.g.
( )
(
(
(
(
(
(
(
(
=
mn m m
n
n
n m
a a a
a a a
a a a
A
. . .
. . . . . .
. . . . . .
. . . . . .
. . .
. . .
2 1
2 22 21
1 12 11
,
(
(
(
(
(
(
(
(
= =
nm n n
m
m
T
a a a
a a a
a a a
A A
. . .
. . . . . .
. . . . . .
. . . . . .
. . .
. . .
2 1
2 22 12
1 21 11
'
( ) (
=
7 2 4
3 0 1
3 , 2
A
( ) ( )
(
(
(
= =
7 3
2 0
4 1
'
2 , 3 2 , 3
A A
T
12
Symmetric matrix
A symmetric matrix is a square matrix which
satisfy the following property:
A symmetric matrix satisfy that : A = A
T
Example: the following matrix is symmetric
a
12
= a
21
,
a
13
= a
31
a
23
= a
32
. ' ' s j and s i all for a a
ji ij
=
(
(
(
=
9 4 3
4 6 2
3 2 5
A
A A
T
=
(
(
(
=
9 4 3
4 6 2
3 2 5
13
Diagonal matrix
A Diagonal matrix is a square matrix where all
elements off the main diagonal are zero.
Example:
j i with s j and s i all for a a
ji ij
= = = ' ' 0
(
(
(
(
=
1 0 0 0
0 4 0 0
0 0 3 0
0 0 0 2
D
( )
(
(
(
(
=
nn
n n
a
a
a
D
... 0 0 0
. . . .
0 ... 0 0
0 ... 0 0
22
11
,
14
Identity matrix
An identity matrix is a diagonal matrix where all
elements of the main diagonal are one.
Examples:
j i all for a and i a
ij ii
= = = 0 1
(
(
(
(
=
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
4
I
(
(
(
(
=
1 ... 0 0 0
. . . .
0 ... 0 1 0
0 ... 0 0 1
n
I
(
(
(
=
1 0 0
0 1 0
0 0 1
3
I
(
=
1 0
0 1
2
I
15
Upper triangular matrix
An upper triangular matrix is a square matrix
where all elements below the main diagonal are
zero.
Examples:
j i all for a
ij
> = 0
(
(
(
(
=
9 0 0 0
6 8 0 0
4 1 2 0
1 2 3 1
4
U
(
(
(
=
3 0 0
7 1 0
5 4 2
3
U
(
(
(
(
nn
n n
n
a
a
a
a a a
U
0 0
0
, 1
22
1 12 11
16
Lower triangular matrix
A Lower triangular matrix is a square matrix
where all elements above the main diagonal are
zero.
Examples:
0 j i all for a
ij
< =
(
(
(
(
=
9 6 4 1
0 8 1 2
0 0 2 3
0 0 0 1
4
L
(
(
(
=
3 7 5
0 1 4
0 0 2
3
L
(
(
(
(
(
=
nn n n n
a a a
a a
a
L
1 , 1
22 21
11
0
0 0
=
4 3
2 1
A
(
=
5 2
1 3
B
(
(
(
=
5 4
0 3
2 1
C
(
(
(
=
1 1
1 2
1 0
D
19
Scalar Multiplication of matrices:
Multiplication of a matrix A by a scalar is
obtained by multiplying every element of A by :
A = [ a
ij
].
Examples:
(
(
(
(
(
(
(
(
=
mn m m
n
n
a a a
a a a
a a a
A
. . .
. . . . . .
. . . . . .
. . . . . .
. . .
. . .
2 1
2 22 21
1 12 11
o o o
o o o
o o o
o
(
(
(
=
5 1
3 1
2 1
A
(
(
(
=
15 3
9 3
6 3
3A
(
(
(
=
25 5
15 5
10 5
5A
Usual operations on matrices
o
o
o
o
20
Usual operations on matrices
Multiplication of two matrices:
Multiplication of a matrix A by a matrix B is
possible if the number of columns of A is equal to
the number of rows of B.
Example:
A m x n B n x p = C m x p
( ) ( ) ( ) 4 , 2 4 , 3 3 , 2
C B A =
21
Examples
Consider
1/
2/
3/
(
=
4 3
2 1
A
(
=
5 2
1 3
B
(
(
(
=
5 4
0 3
2 1
C
(
(
+ +
+ +
=
(
=
5 4 1 3 2 4 3 3
5 2 1 1 2 2 3 1
5 2
1 3
4 3
2 1
B A
B A A B =
(
=
(
=
4 3
2 1
5 2
1 3
(
(
(
=
(
(
(
(
=
5 2
1 3
5 4
0 3
2 1
A C
Example of use
Lets show, by a real-life example, why matrix
multiplication is defined in such a way.
Ahmad, Muhammad and Nayef three students in
IMAM University invest their money in the same
stocks but with different quantities. Ahmads,
Muhammad's and Nayefs stock holding are given by
the matrix:
22
10 0 40
10 20 10
10 30 20
3 2 1
Nayef
Muhammad
Ahmad
Q Q Q
M =
Example of use (continued)
Now suppose that the prices of three types of
stocks are respectively 25 SAR, 22 SAR and 30
SAR.
Let the price matrix be
Then the amount that the first student will pay
is just the first entry of the product.
23
(
(
(
=
30
22
25
P
(
(
(
=
(
(
(
(
(
(
=
1300
990
1460
30
22
25
10 0 40
10 20 10
10 30 20
P M
Matrix Properties
Matrix addition is commutative : A + B = B + A
Matrix addition is associative: A + (B +C) = (A +
B) +C
Matrix addition is distributive : (A + B) = A +
B
where is a scalar.
Matrix multiplication is associative : (A.B).C =
A.(B.C)
Matrix multiplication is distributive : (A + B).C
= A.C + B.C
Multiplication is generally not commutative :
A.B B.A
24
Time to Review !
Matrices are used to store information.
This information is written in a
rectangular arrangement of rows and
columns.
Matrices can be added or subtracted if
they have the same order.
Multiplication of a matrix A by a matrix
B is possible if the number of columns of
A is equal to the number of rows of B.
25
we will see in the next unit
Determinant of matrices
Some Properties of Determinants
Some applications of determinant of
matrices
26