Appendix 5
Appendix 5
Appendix 5
Matrices
2.1 Operations with Matrices
2.2 Properties of Matrix Operations
2.3 The Inverse of a Matrix
MAT1041 - Chapter 2 1
2.1 Operations with Matrices
Matrix representations:
An uppercase case: A, B, C, …
Definitions
Equality of Matrices
Two matrices A = [aij] and B = [bij] are equal if they have the same
size (mn) and aij = bij for 1 i m and 1 j n.
Matrix Addition
If A = [aij] and B = [bij] are matrices of size mn, then their sum is
the mn matrix given by A+B = [aij + bij].
The sum of two matrices of different sizes is undefined.
Scalar Multiplication
If A = [aij] is an mn matrix and c is a scalar, then the scalar
multiplication of A by c is the mn matrix given by cA = [caij]
Example 1
Consider the four matrices
1 2 1 1 2
A , B , C 1 3, D
3 4
3 x 4
Matrices A and B are not equal because they are of different sizes.
Similarly, B and C are not equal.
Matrices A and D are equal if and only if (iff) x = 3.
Subtraction of Matrices
If A and B are of the same size, AB represents the sum of A and (B).
That is, AB = A+(1)B = [aij bij].
cA dB = [caij dbij].
1 2 4 2 0 0
B 1 4 3
Example 3: A 3 0 1 and
2 1 2 1 3 2
1 2 4 2 0 0 3 1 2 3 2 0 3 4 0
3 A B 3 3 0 1 1 4 3 3 (3) 1 3 0 ( 4) 3 (1) 3
2 1 2 1 3 2 3 2 (1) 3 1 3 3 2 2
1 6 12
10 4 6
7 0 4 MAT1041 - Chapter 2 2-5
Section 2-1
Matrix Multiplication
If A = [aij] is an mn matrix and B = [bij] is an np matrix, then the
product AB is an mp matrix AB = [cij], where
n
cij aik bkj ai1b1 j ai 2 b2 j ainbnj
k 1
a11 a12 a1n c11 c12 c1 j c1 p
a a22 a2 n b11 b12 b1 j b1 p c21 c22 c2 j c2 p
21
b21 b22 b2 j b2 p
ai1 ai 2 ain ci1 ci 2 cij cip
bn1 bn 2 bnj bnp
am1 am 2 amn cm1 cm 2 cmj cmp
A B AB
mn n p m p
MAT1041 - Chapter 2 2-6
Section 2-1
Example 4
1 3
3 2
Find the product AB, where A 4 2 and B
4 1
5 0
1 3 c11 c12 9 1
4 2 3 2 c 4 6
4 1 21 22 c
5 0 c31 c32 15 10
3 2 2 2 3 2
c11 ( 1)( 3) (3)( 4 ) 9 c12 ( 1)( 2) (3)(1) 1
c21 (4)(3) (2)(4) 4 c22 (4)(2) (2)(1) 6
c31 (5)(3) (0)(4) 15 c32 (5)(2) (0)(1) 10
Example 5
2 4 2
1 0 3 5 7 1
(a ) 1 0 0
2 1 2 3 6 6 23
1
1 1
1 2 1 2 1 0
(c ) 0 1
1 1 1 1 22
2
(d ) 1 2 3 1 1 11 AB BA
1
Matrix multiplication is not,
2 2 4 6 in general, commutative.
1 2
(e) 1 1 2 3 3
1 1 2 3 33
MAT1041 - Chapter 2 2-8
Section 2-1
Matrix Equation
Real Numbers m n Matrices
xa b X A B
x a (a) b (a) X A ( A) B ( A)
x0ba X O B A
x ba X B A
Exercise 2: Solve for X in the equation 3X+A = B, where
1 2 3 4
A and B
0 3 2 1
1 1 3 4 1 2 1 4 6 43 2
X ( B A) 2
3
3 2 1 0 3 3 2 2 3 23
MAT1041 - Chapter 2 2-14
Section 2-2
Theorem 2.3
Properties of Matrix Multiplication
If A, B, and C are matrices (with sizes such that the given matrix products
are defined) and c is a scalar, then the following properties are true.
1. A(BC) = (AB)C Associative property
2. A(B+C) = AB + AC Distribution property
3. (A+B)C = AC + BC Distribution property
4. c(AB) = (cA)B = A(cB)
Proof of Property 2: A: mn matrix, B: np matrix, C: np matrix.
The entry in the ith row and jth column of A(B+C) is
a i1 (b1 j c1 j ) a i 2 (b2 j c 2 j ) a in (bnj c nj )
The entry in the ith row and jth column of AB +AC is equal
( a i1b1 j a i 2 b2 j a in bnj ) ( a i1c1 j a i 2 c 2 j a in c nj )
Noncommutativity
A commutative property for matrix multiplication was NOT listed
in Theorem 2.3.
If A is of size 23 and B is of size 33,
then the product AB is defined, but the product BA is not.
Example 4: Show that AB and BA are not equal for the matrices
1 3 2 1
A B
2 1 0 2
1 3 2 1 2 5
AB
2 1 0 2 4 4 AB BA
2 1 1 3 0 7
BA
0 2 2 1 4 2
MAT1041 - Chapter 2 2-16
Section 2-2
Cancellation Property
It does NOT have a general cancellation property for matrix
multiplication.
If AC = BC, it is NOT necessary true that A = B.
Repeated Multiplication
Repeated multiplication of a square matrix:
For a positive integer k, Ak is A k AA A
k factors
A0 = In, where A is a square matrix of order n.
A j A k A j k j and k are nonnegative integer.
( A j ) k A jk
2 1
Example 3: Find A for the matrix A
3
.
3 0
2 1 2 1 2 1 1 2 2 1 4 1
A
3
3 0 3 0 3 0 6 3 3 0 3 6
MAT1041 - Chapter 2 2-19
Section 2-2
( A B C )T AT BT C T ( ABC ) T C T B T A T
For any matrix A, the matrix AAT is symmetric.
pf : ( AAT )T ( AT )T AT AAT
MAT1041 - Chapter 2 2-22
Section 2-2
Example 9
Show that ( AB ) T B T AT are equal.
2 1 2 3 1
A 1 0 3 B 2 1
0 2 1 3 0
Sol: 2 1 2 3 1 2 1
2 6 1
AB 1 0 3 2 1 6 1 ( AB)
T
1 1 2
0 2 1 3 0 1 2
2 1 0 ( AB ) T B T AT
3 2 3 2 6 1
B A
T T
0 2
1 1 2
1
1 1 0 2 3 1
MAT1041 - Chapter 2 2-23
Section 2-2
Example 10
T
Find the product AA and show that it is symmetric.
1 3
A 0 2
Sol: 2 1
1 3 10 6 5
1 0 2
AAT 0 2
6 4 2 a a
ij ji
2 1 5 2
3 2 1
3
AB = I
C(AB) = C(I)
(CA)B = C
(I)B = C B = C
Consequently B = C, and it follows that the inverse of a matrix is unique.
Example 2
1 4
Find the inverse of the matrix A
1 3
Sol: To find the inverse of A, try to solve the matrix equation AX = I for X.
1 4 x11 x12 1 0
1 3 x 1 3 4
21 22
x 0 1 A X
1 1
x11 4 x21 x12 4 x22 1 0
Using matrix multiplication
x11 3 x 21 x 12 3 x 22 0 1 to check the result.
x11 4 x21 1
x11 3, x21 1 1 4 3 4 1 0
x11 3 x21 0 1 3 1
1 0 1
x12 4 x22 0
x12 4, x22 1
x12 3 x22 1
MAT1041 - Chapter 2 2-27
Section 2-3
Gauss-Jordan Elimination
x11 4 x21 1 x12 4 x22 0
x11 3 x21 0 x12 3 x22 1
1 4 1 1 4 0
1 3 0 1 3 1 The same coefficient matrix
1 4 1 0 1 4 1 0 1 0 3 4
0 1 1
1 3 0 1
0 1 1 1 (4) 1
[ A ┇ I ] … [ I ┇ A1 ]
Double augment matrix
Example 4
1 2 0
Show that the matrix A has no inverse. A
3 1 2
Sol: 2 3 2
1 2 0 1 0 0 (3)
A I 3 1 2 0 1 0 2
2 3 2 0 0 1
1 2 0 1 0 0
0 7 2 3 1 0
0 7 2 2 0 1
It is not possible to rewrite
1 2 0 1 0 0 [A┇I ] in the form [I ┇A1 ].
0 7 2 3 1 0
Hence A has no inverse.
0 0 0 1 1 1
MAT1041 - Chapter 2 2-30
Section 2-3
Example 5
If possible, find the inverse of each matrix.
3 1
(a) A
2 2
1 1 2 1 12 1
ad bc 4 0 A 1 4
4 2 3 2 3
4
3 1
(b ) B
6 2
ad bc (3)(2) (1)(6) 0
The matrix B is not invertible.
1
1
) (1) I I Hence C1 A 1 is the inverse of (cA),
3.
1 1
( cA)( c A ) ( c c )( AA
1 1 1
1 1
which implies that ( cA ) 1c A , c 0
c
( A )(cA ) ( 1
c c )( A A) (1) I I
Example 6
Compute A2 in two different ways and show that the results are equal.
1 1
A
2 1 2 4 1 2
1. (A ) : 2. (A ) :
1 1 1 1 3 5 1 1
A
2
A (1)( 4) ( 2)(1) 2
2 4 2 4 10 18 2 4
(3)(18) (5)(10) 4 1 1 4 1 2 12
A 1
54 2 2 1 1 2
1 18 5 9
(A2 ) 1
2
3
4 10 3 52 4
2 12 2 12 92
1 2
(A ) 5
54
1 1 3
1 2 1 2 2 4
the same result
Proof:
1. (AB)(B1A1) = A(BB1)A1 = A(I)A1 = AA1 = I.
2. (B1A1)(AB) = B1(A1A)B = B1(I)B = B1B = I.
Hence AB is invertible.
Example 7
1 3 3 1 2 3
Find (AB)1 for the matrices A 1 4 3 and B 1 3 3 using the fact that
A1 and B1 are given by 1 3 4 2 4 3
7 3 3 1 2 1
0
A1 1 0 B 1
1
1 1
Sol:
1 0 1
2
3 0 13
1 2 1 7 3 3 8 5 2
( AB) 1 B 1 A 1 1 1 0 1 1 0 8 4 3
23 0 13 1 0 1 5 2 73
10 23 21 10 23 21 1 0 0 1 0 0 8 5 2
AB 11 26 24 11 26 24 0 1 0 0 1 0 8 4 3
12 27 24 12 27 24 0 0 1 0 0 1 5 2 3
7
(c ) 2 x 3 y z 0 1 1 0 1 2 0
3x 3 y z 0 ( a ) x A b 1
1
0 1 1 1 (c) x A1b 0
2x 4 y z 0 6 2 3 2 2 0
MAT1041 - Chapter 2 2-38