18.06.08: ‘Inverting matrices’ Lecturer: Barwick Monday 22 February 2016 18.06.08: ‘Inverting matrices’ Suppose ๐11 ๐12 ๐ ๐22 ๐ด = ( 21 โฎ โฎ ๐๐1 ๐๐2 โฏ ๐1๐ โฏ ๐2๐ ) โฑ โฎ โฏ ๐๐๐ an ๐ × ๐ (square!!) matrix. We contemplate ๐ด via the map ๐๐ด โถ R๐ R๐ . 18.06.08: ‘Inverting matrices’ Recall that ๐๐ด is defined by the rule ๐ฃ1 ๐ดโ 1 ⋅ ๐ฃ1โ ∑๐๐=1 ๐1๐ ๐ฃ๐ ๐ ๐ ๐ฃ ๐ดโ ⋅ ๐ฃ โ ∑ ๐ ๐ฃ ๐๐ด (๐ฃ)โ = ๐ด ( 2 ) = ∑ ๐ฃ๐ ๐ด๐โ = ( ๐=1 2๐ ๐ ) = ( 2 2 ) . โฎ โฎ โฎ ๐=1 ๐ โ ๐ฃ๐ ๐ด ๐ ⋅ ๐ฃ๐โ ∑๐=1 ๐๐๐ ๐ฃ๐ We’re interested in inverting ๐๐ด ; that is, we’re interested in finding, for each vector ๐คโ ∈ R๐ , a vector ๐ฅโ ∈ R๐ such that ๐คโ = ๐ด๐ฅ.โ When we can do this, we write ๐ฅโ = ๐๐ด−1 (๐ค). โ 18.06.08: ‘Inverting matrices’ In other words, we want to have a way of solving uniquely any system of linear equations that looks like ๐ ๐ค1 = ∑ ๐1๐ ๐ฅ๐ ; ๐=1 ๐ ๐ค2 = ∑ ๐2๐ ๐ฅ๐ ; ๐=1 โฎ ๐ ๐ค๐ = ∑ ๐๐๐ ๐ฅ๐ , ๐=1 regardless of what numbers ๐ค1 , … , ๐ค๐ are! Note that we can’t always do this … 18.06.08: ‘Inverting matrices’ Here’s a 5 × 5 matrix: 1 1 1 1 1 2 3 4 5 6 ( ๐ด= 3 5 7 9 11 ) 4 7 10 13 16 10 16 22 28 34 ) ( I know straightaway that I won’t be able to solve just any old equation ๐คโ = ๐ด๐ฅ.โ (How?) 18.06.08: ‘Inverting matrices’ Here’s the bit that is genuinely surprising: suppose ๐ด is invertible – that is, suppose we can find, for each vector ๐คโ ∈ R๐ , a vector ๐ฅโ ∈ R๐ such that ๐คโ = ๐ด๐ฅ.โ Then there’s a matrix ๐ด−1 such that ๐ฅโ = ๐ด−1 ๐ค.โ Let us reflect upon this miracle! 18.06.08: ‘Inverting matrices’ What we’re saying is that if ๐ด is invertible, then any system of linear equations ๐ ๐ค1 = ∑ ๐1๐ ๐ฅ๐ ; ๐=1 ๐ ๐ค2 = ∑ ๐2๐ ๐ฅ๐ ; ๐=1 โฎ ๐ ๐ค๐ = ∑ ๐๐๐ ๐ฅ๐ ๐=1 18.06.08: ‘Inverting matrices’ admits a unique solution, and moreover that there’s some matrix ๐ด−1 ๐11 ๐12 ๐ ๐ = ( 21 22 โฎ โฎ ๐๐1 ๐๐2 such that for any ๐, โฏ ๐1๐ โฏ ๐2๐ ) โฑ โฎ โฏ ๐๐๐ ๐ ๐ฅ๐ = ∑ ๐๐๐ ๐ค๐ . ๐=1 What are the columns of this matrix? 18.06.08: ‘Inverting matrices’ When ๐ = 1, this is familiar. A 1 × 1 matrix ๐ด is just a number. When is ๐ด invertible? What’s the inverse matrix ๐ด−1 ? 18.06.08: ‘Inverting matrices’ When ๐ = 2, the action gets a bit more interesting: ๐ด=( ๐ ๐ ) ๐ ๐ In order for ๐ด to be invertible, I need to know that any time I have a couple of numbers ๐ข and ๐ฃ, I can solve the system of linear equations ๐ข = ๐๐ฅ + ๐๐ฆ; ๐ฃ = ๐๐ฅ + ๐๐ฆ for ๐ฅ and ๐ฆ. Let’s work our way through the computation. 18.06.08: ‘Inverting matrices’ So our 2 × 2 matrix ๐ด is invertible if and only if ๐๐ − ๐๐ ≠ 0, in which case we have ๐ −๐ ๐ −๐ 1 ๐๐−๐๐ ) . ๐ด−1 = ( ) = ( ๐๐−๐๐ −๐ ๐ ๐๐ − ๐๐ −๐ ๐ ๐๐−๐๐ ๐๐−๐๐ The number ๐๐ − ๐๐ is called the determinant of ๐ด. 18.06.08: ‘Inverting matrices’ The 2 × 2 case is, sadly, a bit misleading. General formulæ are not always so pleasant, or so useful. The problem is that the complexity of these formulæ increases like ๐3 ๐!. So the 3 × 3 case isn’t so bad: the matrix ๐ ๐ ๐ ๐ด=( ๐ ๐ ๐ ) ๐ โ ๐ is invertible if and only if ๐(๐๐ − ๐โ) − ๐(๐๐ − ๐๐) + ๐(๐โ − ๐๐) ≠ 0, 18.06.08: ‘Inverting matrices’ and in that case, −1 ๐ด ๐๐ − ๐โ ๐โ − ๐๐ ๐๐ − ๐๐ 1 = ( ๐๐ − ๐๐ ๐๐ − ๐๐ ๐๐ − ๐๐ ) . ๐(๐๐ − ๐โ) − ๐(๐๐ − ๐๐) + ๐(๐โ − ๐๐) ๐โ − ๐๐ ๐๐ − ๐โ ๐๐ − ๐๐ 18.06.08: ‘Inverting matrices’ However, the 4 × 4 case already pushes the utility of general formulæ to their breaking point: consider the matrix ๐11 ๐ ๐ด = ( 21 ๐31 ๐41 ๐12 ๐22 ๐32 ๐42 ๐13 ๐23 ๐33 ๐43 ๐14 ๐24 ). ๐34 ๐44 18.06.08: ‘Inverting matrices’ Now ๐ด is invertible if and only if det(๐ด) = ๐14 ๐23 ๐32 ๐41 − ๐13 ๐24 ๐32 ๐41 − ๐14 ๐22 ๐33 ๐41 + ๐12 ๐24 ๐33 ๐41 + ๐13 ๐22 ๐34 ๐41 − ๐12 ๐23 ๐34 ๐41 − ๐14 ๐23 ๐31 ๐42 + ๐13 ๐24 ๐31 ๐42 + ๐14 ๐21 ๐33 ๐42 − ๐11 ๐24 ๐33 ๐42 − ๐13 ๐21 ๐34 ๐42 + ๐11 ๐23 ๐34 ๐42 + ๐14 ๐22 ๐31 ๐43 − ๐12 ๐24 ๐31 ๐43 − ๐14 ๐21 ๐32 ๐43 + ๐11 ๐24 ๐32 ๐43 + ๐12 ๐21 ๐34 ๐43 − ๐11 ๐22 ๐34 ๐43 − ๐13 ๐22 ๐31 ๐44 + ๐12 ๐23 ๐31 ๐44 + ๐13 ๐21 ๐32 ๐44 − ๐11 ๐23 ๐32 ๐44 − ๐12 ๐21 ๐33 ๐44 + ๐11 ๐22 ๐33 ๐44 ≠ 0. And I just refuse to write down the formula for the inverse. Ain’t nobody got time for that. 18.06.08: ‘Inverting matrices’ Still, the idea of inversion has conceptual value. Recall that the following are logically equivalent for an ๐ × ๐ matrix ๐ด: โ are linearly independent; 1. the column vectors ๐ด1โ , ๐ด2โ , … , ๐ด๐ 2. the row vectors ๐ดโ 1 , ๐ดโ 2 , … , ๐ดโ ๐ are linearly independent; 18.06.08: ‘Inverting matrices’ 3. the system of linear equations 0 = ๐11 ๐ฅ1 + ๐12 ๐ฅ2 + โฏ + ๐1๐ ๐ฅ๐ ; 0 = ๐21 ๐ฅ1 + ๐22 ๐ฅ2 + โฏ + ๐2๐ ๐ฅ๐ ; โฎ 0 = ๐๐1 ๐ฅ1 + ๐๐2 ๐ฅ2 + โฏ + ๐๐๐ ๐ฅ๐ ; has exactly one solution (namely 0). 18.06.08: ‘Inverting matrices’ We have more: 4. for any real numbers ๐ค1 , … , ๐ค๐ , the system of linear equations ๐ค1 = ๐11 ๐ฅ1 + ๐12 ๐ฅ2 + โฏ + ๐1๐ ๐ฅ๐ ; ๐ค2 = ๐21 ๐ฅ1 + ๐22 ๐ฅ2 + โฏ + ๐2๐ ๐ฅ๐ ; โฎ ๐ค๐ = ๐๐1 ๐ฅ1 + ๐๐2 ๐ฅ2 + โฏ + ๐๐๐ ๐ฅ๐ ; has exactly one solution; 5. the matrix ๐ด in invertible; 6. there exists an ๐ × ๐ matrix ๐ด−1 such that ๐ด−1 ๐ด = ๐ด๐ด−1 = ๐ผ. 18.06.08: ‘Inverting matrices’ There’s even one more: 7. the determinant of ๐ด is nonzero. (We’ll talk more about determinants later in the course.) The point is, we have a notion that’s conceptually convenient, but not so very computable. How do we manage? 18.06.08: ‘Inverting matrices’ Figure 1: Mother Mathematics. Artist’s rendition. When Mother Mathematics gives you a problem that’s too hard to solve in general, you solve it in an easy special case, and you try to reduce to that case. 18.06.08: ‘Inverting matrices’ So …which matrices can we invert easily? 18.06.08: ‘Inverting matrices’ Diagonal matrices are pretty easy: the matrix ๐ด = diag(๐1 , … , ๐๐ ) is invertible if and only if none of the ๐๐ s are zero, in which case −1 ๐ด−1 = diag(๐−1 1 , … , ๐๐ ). 18.06.08: ‘Inverting matrices’ More generally, if I’ve got myself an upper triangular matrix, we should be able to work out whether it’s invertible: ๐11 ๐12 0 ๐22 ๐ด=( โฎ โฎ 0 0 When does that happen? โฏ ๐1๐ โฏ ๐2๐ ). โฑ โฎ โฏ ๐๐๐ 18.06.08: ‘Inverting matrices’ So, what about something that isn’t quite upper triangluar? Is 2 0 ๐ด=( 0 0 invertible? 1 3 0 0 8 8 8 8 5 2 ) 5 1 18.06.08: ‘Inverting matrices’ Is ( ๐ด=( ( ( 2 1 0 0 0 0 1 3 0 0 0 0 ๐ ๐ 8 8 0 0 ๐ ๐ 5 1 0 0 ๐ ๐ ๐ โ ๐ ๐ ) ) ๐ ๐ ) 5 −7 9 1 ) invertible? (Does it matter what ๐, ๐, ๐, ๐, ๐, ๐, ๐, โ, ๐, ๐, ๐, or ๐ are?) 18.06.08: ‘Inverting matrices’ Is ( ( ( ๐ด=( ( ( ( ( ( invertible? 2 1 1 0 0 0 0 0 1 2 1 0 0 0 0 0 1 ๐ ๐ ๐ ๐ ๐ 1 ๐ ๐ โ ๐ ๐ 2 ๐ ๐ ๐ ๐ ๐ ) ) 0 5 6 ๐ ๐ ๐ ) ) ) 0 −4 9 ๐ ๐ก ๐ข ) ) 0 0 0 3 1 1 ) 0 0 0 1 1 3 0 0 0 1 3 1 )