You are on page 1of 29

Matrices

2.1 Operations with Matrices


2.2 Properties of Matrix Operations
2.3 Matrices and systems of Linear Equation
2.4 Gaussian Elimination

2.1
2.1 Operations with Matrices
 Matrix:
 a11 a12 a13  a1n 
a a a  a 
 21 22 23 2n 

A  [aij ]   a31 a32 a33  a3n   M mn


 
    
am1 am 2 am3  amn 
mn

(i, j)-th entry (or element): aij


number of rows: m
number of columns: n
size: m×n

 Square matrix: m = n
2.2
Equal matrices: two matrices are equal if they have the same size
(m × n) and entries corresponding to the same position are equal

For A  [aij ]m n and B  [bij ]m n ,


A  B if and only if aij  bij for 1  i  m, 1  j  n

 Ex: Equality of matrices


1 2 a b 
A  B 
3 4   c d 

If A  B, then a  1, b  2, c  3, and d  4

2.3
 Matrix addition:
If A  [aij ]m n , B  [bij ]m n ,

then A  B  [aij ]mn  [bij ]mn  [aij  bij ]mn  [cij ]mn  C

 Ex 2: Matrix addition

 1 2  1 3  1  1 2  3  0 5
 0 1   1 2   0  1 1  2   1 3
       

 1  1  1  1  0 
  3   3    3  3   0 
       
 2  2  2  2 0

2.4
 Scalar multiplication:
If A  [aij ]m n and c is a constant scalar,
then cA  [caij ]m n

 Matrix subtraction:
A  B  A  (1) B

 Ex 3: Scalar multiplication and matrix subtraction


 1 2 4  2 0 0
A   3 0  1 B   1  4 3
   
 2 1 2  1 3 2

Find (a) 3A, (b) –B, (c) 3A – B


2.5
Sol:
 1 2 4  31 32 34  3 6 12
(a)
3A  3 3 0  1  3 3 30 3 1   9 0  3
     
 2 1 2  32 31 32  6 3 6
(b)
 2 0 0   2 0 0
 B   1 1  4 3    1 4  3

 
 1 3 2  1  3  2
(c)
 3 6 12  2 0 0  1 6 12
3 A  B   9 0  3   1  4 3   10 4  6
     
 6 3 6  1 3 2  7 0 4

2.6
 Matrix multiplication:
If A  [aij ]m n and B  [bij ]n p ,
then AB  [aij ]m n [bij ]n p  [cij ]m p  C ,
If equal, A and B are multipliable
size of C=AB is m × p
n
where cij   aik bkj  ai1b1 j  ai 2b2 j    ainbnj
k 1

 a11 a12 a1n  c c c1 j c1n 


   b11 b1 j b1n   11 12 
  b b2 j b2 n   
 ai1 ai 2 ain   21   ci1 ci 2 cij cin 
     
 
 
bn1 bnj bnn   
 an1 an 2 ann  cn1 cn 2 cnj cnn 

※ The entry cij is obtained by calculating the sum of the entry-by-entry
product between the i-th row of A and the j-th column of B
2.7
 Ex 4: Find AB
 1 3
   3 2 
A   4 2 B 
  4 1  2 2
 5 0 3 2
Sol:
 (1)(3)  (3)(4) (1)(2)  (3)(1) 
AB  (4)(3)  (2)(4) (4)(2)  (2)(1) 
 (5)(3)  (0)(4) (5)(2)  (0)(1)  3 2
 9 1 
  4 6 
 15 10  3 2
 Note: (1) BA is not multipliable
(2) Even BA is multipliable, it could be that AB ≠ BA 2.8
Keywords in Section 2.1:
 equality of matrice
 matrix addition
 scalar multiplication
 matrix multiplication
 partitioned matrix
 row vector
 column vector
 trace
 diagonal matrix

2.9
2.2 Properties of Matrix Operations
 Three basic matrix operators, introduced in Sec. 2.1:
(1) matrix addition
(2) scalar multiplication
(3) matrix multiplication
0 0 0
0 0 0 
 Zero matrix: 0mn 
 
 
0 0 0  mn
1 0 0
0 1 0 
 Identity matrix of order n: In  
 
 
0 0 1  n n
2.10
 Properties of matrix addition and scalar multiplication:
If A, B, C  M mn , and c, d are scalars,
then (1) A+B = B+A (Commutative property of matrix addition)

(2) A+(B+C) = (A+B)+C (Associative property of matrix addition)


(3) (cd) A = c (dA) (Associative property of scalar multiplication)

(Multiplicative identity property and 1 is the multiplicative


(4) 1A = A identity (乘法單位元素) for all matrices)
(5) c(A+B) = cA + cB (Distributive property of scalar
multiplication over matrix addition)
(6) (c+d) A = cA + dA (Distributive property of scalar
multiplication over real-number addition)

 Notes:
All above properties are very similar to the counterpart
properties for real numbers
2.11
 Properties of zero matrices:
If A  M mn , and c is a scalar,
then (1) A  0mn  A
※ So, 0m×n is also called the additive identity for the set of all m×n matrices

(2) A  ( A)  0mn
※ Thus , –A is called the additive inverse of A

(3) cA  0mn  c  0 or A  0mn

 Notes:
All above properties are very similar to the counterpart
properties for the real number 0

2.12
 Properties of matrix multiplication:
(1) A(BC) = (AB)C (Associative property of matrix multiplication)
(Distributive property of LHS matrix multiplication
(2) A(B+C) = AB + AC over matrix addition)
(3) (A+B)C = AC + BC (Distributive property of RHS matrix multiplication
over matrix addition)
(4) c(AB) = (cA)B = A(cB) (Associative property of scalar and matrix
multiplication)
※ For real numbers, the properties (2) and (3) are the same since the order for the
multiplication of real numbers is irrelevant
※ The real-number multiplication can satisfy above properties and there is a
commutative property for the real-number multiplication, i.e., cd = dc
 Properties of the identity matrix:
If A  M mn , then (1) AI n  A
(2) I m A  A
※ The role of the real number 1 is similar to the identity matrix. However, 1 is unique
in real numbers and there could be many identity matrices with different sizes 2.13
 Ex 3: Matrix Multiplication is Associative
Calculate (AB)C and A(BC) for
 1 0 
1 2 1 0 2
A  , B  , and C  3 1  .
 2 1 3 2 1   2 4
Sol:
 1 0
 1 2  1 0 2   
( AB)C        3 1 
 2 1 3 2 1  
 2 4 
 1 0 
 5 4 0   17 4
  3 1  
 1 2 3 
 13 14 
 2 4 

2.14
  1 0  
1 2   1 0 2  
A( BC )  
1  3 2 1  
3 1 
2  2 4  

1 2   3 8  17 4 
 
2 1  7 2  13 14 

2.15
 Equipped with the four properties of matrix multiplication,
we can prove a statement on Slide 1.35: if a homogeneous
system has any nontrivial solution, this system must have
infinitely many nontrivial solutions

Suppose there is a nonzero solution x1 for this homegeneous system such


that Ax1  0. Then it is straightforward to show that tx1 must be another
solution, i.e.,
A(tx1 )  t ( Ax1 )  t (0)  0

The fourth property of matrix multiplication on Slide 2.17

Finally, since t can be any real number, it can be concluded that there are
infinitely many solutions for this homogeneous system

2.16
 Definition of Ak : repeated multiplication of a square matrix:
A1  A, A2  AA, , Ak  AA A
k matrices of A

 Properties for Ak:


(1) AjAk = Aj+k
(2) (Aj)k = Ajk
where j and k are nonegative integers and A0 is assumed
to be I

 For diagonal matrices:


 d1 0 0  d1k 0 0
0 d  
0   0 d 2k 0
D 2
D 
k
   
   
0 0 dn   0 0 d nk 
2.17
 Transpose of a matrix:

 a11 a12 a1n 


a a22 a2 n 
If A   21
 M mn ,
 
 
 am1 am 2 amn 

 a11 a21 am1 


a a22 am 2 
then AT   12  M n m
 
 
 a1n a2 n amn 
※ The transpose operation is to move the entry aij (original at the position (i, j)) to
the position (j, i)
※ Note that after performing the transpose operation, AT is with the size n×m
2.18
 Ex 8: Find the transpose of the following matrix
 1 2 3 0 1
 2
(a) A    (b) A   4 5 6 
(c) A  2 4

8   
7 8 9  1  1
Sol: (a)  2
A   AT  2 8
8 
(b) 1 2 3 1 4 7
A  4 5 6  AT  2 5 8
   
7 8 9 3 6 9
(c) 0 1
0 1
A  2 4  AT  
2
   1 4  1
 1  1
2.19
 Properties of transposes:
(1) ( AT )T  A
(2) ( A  B)T  AT  BT
(3) (cA)T  c( AT )
(4) ( AB)T  BT AT
※ Properties (2) and (4) can be generalized to the sum or product of
multiple matrices. For example, (A+B+C)T = AT+BT+CT and (ABC)T =
CTBTAT
※ Since a real number also can be viewed as a 1 × 1 matrix, the transpose
of a real number is itself, that is, for a  R , aT = a. In other words,
transpose operation has actually no effect on real numbers

2.20
 Ex 9: Verify that (AB)T and BTAT are equal

 2 1 2  3 1
A   1 0 3 B   2 1
 0 2 1  3 0

Sol:
T
 2 1 2   3 1 
T
 2 1
        2 6 1
( AB)    1 0
T
3  2 1    6 1   
  0 2  1 1 2 
 1 
 3 0 
 
 1 2 

 2 1 0
3 2 3     2 6 1
B A 
T T
  1 0 2   
1 1 0   2 3 1 1 2 
 1

2.21
 Symmetric matrix:
A square matrix A is symmetric if A = AT
 Skew-symmetric matrix (反對稱矩陣):
A square matrix A is skew-symmetric if AT = –A

 Ex:
 1 2 3
If A  a 4 5 is symmetric, find a, b, c?
 
b c 6
Sol:
 1 2 3 1 a b 
 T
A  a 4 5 AT  2 4 c 
A A
     a  2, b  3, c  5
b c 6 3 5 6

2.22
 Ex:
 0 1 2
If A  a 0 3 is a skew-symmetric, find a, b, c?
 
b c 0
Sol:
 0 1 2  0  a  b
A   a 0 3  AT    1 0  c 
b c 0  
 2  3 0 

A   AT  a  1, b  2, c  3

 Note: AAT must be symmetric ※ The matrix A could be with any size,
i.e., it is not necessary for A to be a
Pf: ( AAT )T  ( AT )T AT  AAT square matrix.
※ In fact, AAT must be a square matrix.
 AA is symmetric
T

2.23
 Before finishing this section, two properties will be discussed,
which are held for real numbers, but not for matrices: the first is
the commutative property of matrix multiplication and the second
is the cancellation law
 Real number:
ab = ba (Commutative property of real-number multiplication)

 Matrix:
AB  BA
m n n p n  p m  n

Three results for BA:


(1) If m  p , then AB is defined, but BA is undefined
(2) If m  p, m  n, then AB  M mm , BA  M nn (Sizes are not the same)
(3) If m  p  n, then AB  M mm , BA  M mm
(Sizes are the same, but resulting matrices may not be equal)
2.24
 Ex 4:
Show that AB and BA are not equal for the following matrices.
 1 3 2  1
A  and B 
 2  1   0 2 
Sol:
 1 3 2  1 2 5
AB       
 2  1 0 2   4  4 

2  1  1 3 0 7
BA       
 0 2  2  1  4  2 

AB  BA (noncommutativity of matrix multiplication)

2.25
 Notes:

(1) A+B = B+A (the commutative law of matrix addition)

(2) AB  BA (the matrix multiplication is not with the


commutative law) (so the order of matrix multiplication is very
important)

※ This property is different from the property for the


multiplication operations of real numbers, for which the
order of multiplication makes no difference

2.26
 Real number:
ac  bc and c  0
 a b (Cancellation law for real numbers)

 Matrix:
AC  BC and C  0 (C is not a zero matrix)
(1) If C is invertible, then A = B
(2) If C is not invertible, then A  B (Cancellation law is not
necessary to be valid)

※ Here I skip to introduce the definition of “invertible” because it


will be studied soon in the next section

2.27
 Ex 5: An example in which cancellation is not valid
Show that AC=BC
 1 3  2 4  1  2
A  , B  , C 
 0 1  2 3   1 2 
Sol:
1 3  1  2  2 4
AC     
0 1  1 
2   1 2
2 4  1  2   2 4
BC   
2
  
3  1 2    1 2

So, although AC  BC , A  B

2.28
Keywords in Section 2.2:
 zero matrix
 identity matrix
 commutative property
 associative property
 distributive property
 cancellation law
 transpose matrix
 symmetric matrix
 skew-symmetric matrix

2.29

You might also like