Introduction
UTS/UAS
50%
Quiz
30%
Matrix : 4 by 2 Matrix: 3 by 5
Element 3,1 = (3)
Element 3,1 = (5)
Vector
• Vector can be considered a 1 x M matrix
v x y z
Types of Matrix
• Diagonal matrices • Simmetrycal matrices
1 0 0 0
2 0 0 1 0 0 0 2
0 2 0 0
0 3 0 0 1 0 0 0
0 0 3 0
0 0 4 0 0 1 0 0
0 0 0 4
0 0 0 1 0
2 0 0 0 1
2 2 0
2 3 1
• Identity matrices (I) 0 1 4
1 0 0 1 0 0 0 0
0 1 0 0 1 0 0 0
0 0 1 0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
Operation on Matrices
• Addition
• Done elementwise
1 2 3 1 2 3 2 4 6
3 2 1 + 3 2 1 = 6 4 2
2 3 1 2 3 1 4 6 2
• Transpose
• “Flip” (M by N becomes N by M)
𝑇
1 2 3 1 3 2
3 2 1 = 2 2 3
2 3 1 3 1 1
Operation on Matrices
• Multiplication
• Only possible to multiply of dimensions
• x1 by y1 and x2 by y2 iff y1 = x2
• resulting matrix is x1 by y2
• e.g. Matrix A is 2 by 3 and Matrix by 3 by 4
• resulting matrix is 2 by 4
• Just because A x B is possible doesn’t mean B x A is possible!
Matrix Multiplication Order
*
• A is n by k , B is k by m *
* * * * * *
*
• C = A x B defined by *
*
k
cij ailblj
. *
. *
* * * * * . *
.
*
l 1 . *
.
*
• BxA not necessarily equal to AxB
. *
. .
. . . . . . . *
*
* * * * * .
*
• C = A x B , so A = B-1 x C . *
.
*
Example Multiplications
1x2+2x3+1x0=8
2 3
1 2 1 __ 8 __
3 2
2 1 0 0 1 __ __
-2 x 1 + 3 x 0 + 0 x 0 = -2
4 2 2 0 0 1 __ __ __
2 3 0 1 0 0 __ __ -2
__
1 4 3 0 1 0 __
__ __
Inverse of Matrix
• If A x B = I and B x A = I then
A = B-1 and B = A-1
Inverse of Matrix
• For 2 by 2 matrix
1
a b 1 d b
c d ad bc c a
• So :
1
2 4 1 __ __ __ __
3 1 (__) (__) __ __ __ __