Lecture 2
Lecture 2
1
n
n Ex: n Equal matrix:
⎡1 2 3⎤ ⎡ r1 ⎤
A=⎢ ⎥ =⎢ ⎥ If A = [aij ]m×n , B = [bij ]m×n
⎣4 5 6⎦ ⎣r2 ⎦
Then A = B if and only if aij = bij ∀ 1 ≤ i ≤ m, 1 ≤ j ≤ n
⇒ r1 = [1 2 3], r2 = [4 5 6]
n Ex 1: (Equal matrix)
⎡ 1 2 3⎤ ⎡1 2⎤ ⎡a b ⎤
A=⎢ ⎥ = [c1 c2 c3 ] A=⎢ ⎥ B=⎢ ⎥
⎣ 4 5 6⎦ ⎣3 4⎦ ⎣c d ⎦
⎡1 ⎤ ⎡ 2⎤ ⎡ 3⎤
⇒ c1 = ⎢ ⎥, c2 = ⎢ ⎥, c3 = ⎢ ⎥ If A = B
4
⎣ ⎦ 5
⎣ ⎦ ⎣6 ⎦
Then a = 1, b = 2, c = 3, d = 4
Then A + B = [aij ]m×n + [bij ]m×n = [aij + bij ]m×n Then cA = [ca ij ]m×n
n Matrix subtraction:
Ex 2: (Matrix addition)
A − B = A + (−1) B
n
⎡− 1 2⎤ ⎡ 1 3⎤ ⎡− 1 + 1 2 + 3⎤ ⎡ 0 5⎤
⎢ 0 1⎥ + ⎢− 1 2⎥ = ⎢ 0 − 1 1 + 2⎥ = ⎢− 1 3⎥ n Ex 3: (Scalar multiplication and matrix subtraction)
⎣ ⎦ ⎣ ⎦ ⎣ ⎦ ⎣ ⎦
⎡ 1 2 4⎤ ⎡ 2 0 0⎤
⎡ 1⎤ ⎡− 1⎤ ⎡ 1 − 1 ⎤ ⎡0 ⎤ A = ⎢− 3 0 − 1⎥ B = 1 − 4 3⎥
⎢
⎢ − 3⎥ + ⎢ 3⎥ = ⎢ − 3 + 3 ⎥ = ⎢0 ⎥ ⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎣⎢ 2 1 2⎦⎥ ⎢⎣− 1 3 2⎥⎦
⎣⎢− 2⎦⎥ ⎣⎢ 2⎦⎥ ⎢⎣− 2 + 2⎥⎦ ⎢⎣0⎥⎦
Find (a) 3A, (b) –B, (c) 3A – B
2
n
Sol: n Matrix multiplication:
(a)
⎡ 1 2 4⎤ ⎡ 3(1) 3(2 ) 3(4 )⎤ ⎡ 3 6 12⎤ If A = [aij ]m×n , B = [bij ]n× p
3A = 3⎢− 3 0 − 1⎥ = ⎢3(− 3) 3(0 ) 3(− 1)⎥ = ⎢− 9 0 − 3⎥ Then AB = [aij ]m×n [bij ]n× p = [cij ]m× p
⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎣⎢ 2 1 2⎦⎥ ⎣⎢ 3(2 ) 3(1) 3(2 )⎦⎥ ⎣⎢ 6 3 6⎦⎥
Size of AB
(b) 0 0⎤ ⎡ − 2 0 0⎤
n
⎡ 2 where cij = ∑ aik bkj = ai1b1 j + ai 2b2 j + ! + ainbnj
⎢
− B = (− 1) 1 − 4 3 ⎥ = ⎢ − 1 4 − 3⎥ k =1
⎢ ⎥ ⎢ ⎥
⎡ a11 a12 ! a1n ⎤ b ! b
⎣⎢− 1 3 2⎦⎥ ⎢⎣ 1 − 3 − 2⎦⎥ ⎢ " ⎡ 11 ! b1n ⎤ ⎡ ⎤
" ⎥⎥ ⎢
1j
b21 " b2 j ! b2 n ⎥⎥ ⎢
⎢ " ⎥
(c) ⎢ ai1 ai 2 ! ain ⎥ ⎢ = ⎢ ⎥
⎡ 3 6 12⎤ ⎡ 2 0 0⎤ ⎡ 1 6 12⎤ ⎢ " ⎢ " " " " ⎥ ⎢ c c ! c ! c ⎥
" " ⎥⎢ i1 i2 ij in
⎥ ⎢bn1 ! bnj ! bnn ⎥⎥ ⎢⎣ ⎥
3 A − B = − 9 0 − 3 − 1 − 4 3⎥ = ⎢− 10 4 − 6⎥
⎢ ⎥ ⎢ ⎢ ⎦
⎣ ⎦
⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎣⎢an1 an 2 ! ann ⎦⎥
⎣⎢ 6 3 6⎦⎥ ⎢⎣− 1 3 2⎦⎥ ⎣⎢ 7 0 4⎦⎥
n Notes: (1) A+B = B+A, (2) AB ≠ BA
=
A x b
3
n
2.2 Properties of Matrix Operations
n Partitioned matrices: Three basic matrix operators:
submatrix
n
(3) ( cd ) A = c ( dA )
(3) cA = 0m×n ⇒ c = 0 or A = 0m×n
(4) 1A = A
n Notes:
(5) c( A+B ) = cA + cB (1) 0m×n: the additive identity for the set of all m×n matrices
(6) ( c+d ) A = cA + dA (2) –A: the additive inverse of A
4
n
n Transpose of a matrix: n Ex 8: (Find the transpose of the following matrix)
⎡ a11 a12 ! a1n ⎤ ⎡ 1 2 3⎤ ⎡0 1⎤
⎡ 2⎤
⎢a a22 ! a2 n ⎥ (a) A = ⎢ ⎥ (b) A = ⎢ 4 5 6⎥ (c) A = ⎢2 4⎥
If A = ⎢ 21 ⎥ ∈ M m×n ⎣8 ⎦ ⎢ ⎥ ⎢ ⎥
⎢ " " " " ⎥ ⎣⎢7 8 9⎦⎥ ⎣⎢ 1 − 1⎦⎥
⎢a am 2 ! amn ⎥⎦ Sol: (a)
⎣ m1 ⎡ 2⎤
A=⎢ ⎥ ⇒ AT = [2 8]
a21 ! am1 ⎤ ⎣8 ⎦
⎡ a11
⎢a (b) ⎡ 1 2 3⎤ ⎡1 4 7⎤
a22 ! am 2 ⎥
Then AT = ⎢ 12 ⎥ ∈ M n×m A = ⎢4 5 6⎥ ⇒ AT = ⎢2 5 8⎥
⎢ " " " " ⎥ ⎢ ⎥ ⎢ ⎥
⎢a ⎣⎢7 8 9⎦⎥ ⎢⎣3 6 9 ⎦⎥
⎣ 1n a2 n ! amn ⎥⎦
(c) ⎡ 0 1 ⎤
⎡0 2 1⎤
A = ⎢2 4⎥ ⇒ AT = ⎢
⎢ ⎥ ⎣1 4 − 1⎥⎦
⎣⎢ 1 − 1⎦⎥
5
n
n Note: AAT is symmetric n Ex 4:
T Show that AB and BA are not equal for the matrices.
n Note: A A is symmetric
⎡ 1 3⎤ ⎡2 − 1⎤
Matrix: in general A=⎢ ⎥ and B=⎢ ⎥
⎣2 − 1⎦ ⎣ 0 2⎦
n
AB ≠ BA
m× n n× p Sol:
We have 3 situations: ⎡ 1 3⎤ ⎡2 − 1⎤ ⎡2 5⎤
AB = ⎢ ⎥ ⎢ 0 2⎥ = ⎢ 4 − 4⎥
⎣ 2 − 1⎦⎣ ⎦ ⎣ ⎦
(1) If m ≠ p, then AB is defined , BA is undefined.
⎡2 − 1⎤ ⎡ 1 3⎤ ⎡0 7⎤
(2) If m = p, m ≠ n, then AB ∈ M m×m , BA ∈ M n×n (Sizes are not the same) BA = ⎢ ⎥ ⎢2 − 1⎥ = ⎢4 − 2⎥
⎣ 0 2 ⎦⎣ ⎦ ⎣ ⎦
(3) If m = p = n, then AB ∈ M m×m , BA ∈ M m×m
(Sizes are the same, but matrices are not equal) n Note: AB ≠ BA
6
n
2.3 The Inverse of a Matrix
n Inverse matrix: n Find the inverse of a matrix by Gauss-Jordan Elimination:
Consider A ∈ M n×n [A | I ] ⎯Gauss
⎯⎯ ⎯ ⎯ ⎯⎯→[I | A−1 ]
- Jordan Elimination
If there exists a matrix B ∈ M n×n such that AB = BA = I n , n Ex 2: (Find the inverse of the matrix)
Then (1) A is invertible (or nonsingular) ⎡ 1 4⎤
A=⎢
⎣ − 1 − 3⎥⎦
(2) B is the inverse of A
Sol:
n Notes: AX = I
(1)A matrix that does not have an inverse is called ⎡ 1 4⎤ ⎡ x11 x12 ⎤ ⎡ 1 0⎤
⎢− 1 − 3⎥ ⎢ x =
noninvertible (or singular). ⎣ ⎦ ⎣ 21 x22 ⎥⎦ ⎢⎣0 1⎥⎦
(2) The inverse of A is unique and denoted by A−1 ⎡ x11 + 4 x21 x12 + 4 x22 ⎤ ⎡ 1 0⎤
⎢− x − 3 x =
(3) AA −1 = A −1 A = I ⎣ 11 21 − x12 − 3 x22 ⎥⎦ ⎢⎣0 1⎥⎦
− x11 − 3x21 = 0
⎡ 1 4 ! 1 0⎤ Gauss −JordanElimination ⎡ 1 0 ! − 3 − 4⎤
x12 + 4 x22 = 0
(2) ⎢− 1 − 3 ! 0 1⎥ ⎯r⎯ (1 ) ⎯
(⎯
−4 ) →
12 , r21
⎢0 1 ! 1 1⎥⎦
− x12 − 3x22 = 1 ⎣ ⎦ ⎣
A I I A−1
(1) ⇒ ⎡ 1 4 ! 1⎤ ⎯r⎯ ⎯→⎡ 1 0 ! − 3⎤ ⇒ x11 = −3, x21 = 1
(1 ) ( −4 )
⎯
12 , r21
7
n
n Ex 3: (Find the inverse of the following matrix) ⎡ 1 − 1 0 ! 1 0 0⎤ ⎡ 1 0 0 ! − 2 − 3 − 1⎤
r32(1) r21(1)
⎡ 1 − 1 0⎤ ⎯⎯→ ⎢0 1 0 ! − 3 − 3 − 1⎥ ⎯⎯→ ⎢0 1 0 ! − 3 − 3 − 1⎥
A = ⎢ 1 0 − 1⎥ ⎢⎣0 0 1 ! − 2 − 4 − 1⎥⎦ ⎢⎣0 0 1 ! − 1 − 4 − 1⎥⎦
⎢⎣− 6 2 3⎥⎦
= [ I ! A−1 ]
Sol:
So the matrix A is invertible, and its inverse is
⎡ 1 − 1 0 ! 1 0 0⎤
[A ! I ] = ⎢ 1 0 − 1 ! 0 1 0⎥ ⎡− 2 − 3 − 1⎤
⎢⎣− 6 2 3 ! 0 0 1⎥⎦ A−1 = ⎢⎢ − 3 − 3 − 1⎥⎥
( −1 ) ⎡ 1 − 1 0 ! 1 0 0⎤ (6) ⎡ 1 − 1 0 ! 1 0 0⎤ ⎣⎢− 2 − 4 − 1⎦⎥
⎯r⎯⎯→ ⎢ 0 1 − 1 ! − 1 1 0⎥ ⎯r⎯→
12 13
⎢0 1 − 1 ! − 1 1 0 ⎥
⎢⎣− 6 2 3 ! 0 0 1⎥⎦ ⎢⎣0 − 4 3 ! 6 0 1⎥⎦ n Check:
⎡ 1 − 1 0 ! 1 0 0⎤ AA−1 = A−1 A = I
⎡ 1 − 1 0 ! 1 0 0⎤ r3( −1)
r23( 4 )
⎯⎯→ ⎢0 1 − 1 ! − 1 1 0⎥ ⎯⎯
⎯→ ⎢0 1 − 1 ! − 1 1 0⎥
⎢⎣0 0 1 ! − 2 − 4 − 1⎥⎦
⎣⎢0 0 − 1 ! 2 4 1⎥⎦
(3) A ⋅ A = Ar + s
r s
r , s : integers (1) A−1 is invertible and ( A−1 ) −1 = A
( Ar ) s = Ars (2) Ak is invertible and ( Ak ) −1 = $
A−!#
1 −1
A % A−1 = ( A−1 ) k = A− k
! !"
!
⎡d1 0 ! 0⎤ ⎡d k
0 ! 0⎤ k factors
⎢0 ⎢
1
⎥ 1
d2 ! 0⎥ 0 d k
! 0⎥ (3) cA is invertible and (cA) −1 = A−1 , c ≠ 0
( 4) D = ⎢ ⎥ ⇒ Dk = ⎢ 2 c
⎢" " # "⎥ ⎢" " "⎥
⎢0 ⎢ ⎥ (4) AT is invertible and ( AT ) −1 = ( A−1 )T
⎣ 0 ! d n ⎥⎦ ⎣0 0 ! d nk ⎦
(5) If A and B are invertible matrices of size n, then AB
is invertible and (AB)−1 = B −1 A −1
8
n
(6) If C is an invertible matrix, then
(a) If AC=BC, then A=B (Right cancellation property)
(b) If CA=CB, then A=B (Left cancellation property)
(7) Cramer’s rule: If A is an invertible matrix, then the system
of linear equations Ax = b has a unique solution given by
x = A−1b
(7’) If A is an n×n matrix, then the following statements are
equivalent
(a) A is invertible.
(b) Ax = b has a unique solution for every n×1 column matrix b.
(c) Ax = 0 has only the trivial solution.
9
n