Professional Documents
Culture Documents
ITP3902 DMS Lec 4 Matrix Arithmetic
ITP3902 DMS Lec 4 Matrix Arithmetic
ITP3902 DMS Lec 4 Matrix Arithmetic
Lecture 4
Matrix Arithmetic
Example 1 is a 2 x 3 matrix,
where 1, 1, 3, 4, 6, 9 are the elements of the
matrix.
Example 2 is a 4 x 3 matrix.
Example 3 (5 2 7 1) is a 1 x 4 matrix ( a row vector)
Short Questions
4x2
What is Matrix?
• in the i-th row and the j-th column of a matrix A is
called an element or an entry.
• Any digital image can be represented by a matrix
e.g.
1 1 1 1 1
sampling
0 1 0 1 0
0 1 0 1 0
• All image processing techniques involve matrix operations
• When using Photoshop, your computer is working with
matrices! LCD monitor shows images to you in the form of
matrices!
ITP3902 Discrete Mathematics & Statistics Page 5
Lecture 4 Matrix Arithmetic
Matrix Notation
Each element in a matrix has its own particular
‘address’ or location which can be defined by a system
of double suffixes: the first indicates the row, and the
second indicates the column.
Example 5
A=
Short Questions
12, 32, 88
can be denoted by or by A.
Similarly, can be denoted by or by X.
Equal Matrices
Example 7
1 3 8 3
Let A and B , then A B.
3 8 3 8
7 9 5 42 34 21 49 43 26
3 6 3 13 16 18 16 22 21
5 0 2 3 3 3
2 1 6 6 4 5
ITP3902 Discrete Mathematics & Statistics Page 10
Lecture 4 Matrix Arithmetic
Exercise
3 1 1 2 6 1
Let A and B . Calculate
0 2 4 10 3 6
A + B and A – B.
Solution
5 7 0
10 5 10
1 5 2
10 1 2
Multiplication of Matrices
Scalar multiplication
Example 9
7 9 5 28 36 20
4
3 6 3 12 24 12
i.e. k[aij] = [kaij]
This also means that we can take a common factor out
of every element.
A B C
(m n) (n p) (m p)
1 0 2
1 2 3 c11 c12 c13
A B 0 2 1 C AB
3 2 1 1 3 2 c21 c22 c23
c12= a11 b12 + a12 b22 + a13 b32 = 1x0 + 2x2 + 3x3
= 13
1 0 2
1 2 3 c11 c12 c13
A B 0 2 1 C AB
c21 c22 c23
3 2 1 1 3 2
c13= a11 b13 + a12 b23 + a13 b33 = 1x(-2) + 2x1 + 3x2
=6
1 0 2
1 2 3 c11 c12 c13
A B 0 2 1 C AB
3 2 1 1 3 2 c21 c22 c23
c21= a21 b11 + a22 b21 + a23 b31 = 3x1 + 2x0 + 1x(-1)
=2
1 0 2
1 2 3 c11 c12 c13
A B 0 2 1 C AB
c21 c22 c23
3 2 1 1 3 2
c22= a21 b12 + a22 b22 + a23 b32 = 3x0 + 2x2 + 1x3
=7
1 0 2
1 2 3 c11 c12 c13
A B 0 2 1 C AB
3 2 1 1 3 2 c21 c22 c23
c = a b + a b + a b = 3x(-2) + 2x1 + 1x2
23 21 13 22 23 23 33
= -2
2 13 6
C AB
2 7 2
Discrete Mathematics Page18
Lecture 4 Matrix Arithmetic
Exercise
1 5
8 4 3
2 7
3 4 2 5 8 This step
can be
1 8 5 2 1 4 5 5 1 3 5 8 omitted.
2 8 7 2 2 4 7 5 2 3 7 8
3 8 4 2 3 4 4 5 3 3 4 8
18 29 43
30 43 62
32 32 41
ITP3902 Discrete Mathematics & Statistics Page 19
Lecture 4 Matrix Arithmetic
Exercise
3 1 2 6
If A and B then
0 2 10 3
A + B = 5 7
10 5
AB = 16 15
20 6
3A = 9 3
0 6
then and
Therefore AB ≠ BA .
In general CD ≠ DC for any matrices C and D
Transpose ( 轉置 ) of a Matrix
If .
Square Matrix
A square matrix is one in which
no. of rows = no. of columns
Example 13
1 0 9 2 4
A B
2 4 2 3 6
Symmetric Matrix
Diagonal Matrix
diagonal
Example 17