1MA01: Mathematical Methods Tutorial Sheet 4 1 1. Matrix inverses using Gauss-Jordan elimination Determine the inverse of the matrices: A= 2 3 3 5 ! 3 4 5 7 ; B= 2 3 1 0 3 5 0 1 ! ! 1 3/2 1/2 0 3 5 0 1 r1/2 −→ −2 2 1 2 0 ; C= 1 0 −1 0 ! −→ 1 3/2 1/2 0 0 1 −3 2 r2∗2 −→ r1−3/2r2 −→ A 3 4 1 0 5 7 0 1 ! = 5 −3 −3 2 (2) −→ ! ! 1 4/3 1/3 0 5 7 0 1 r1/3 ! 1 0 5 −3 0 1 −3 2 Then −1 ! 1 3/2 1/2 0 0 1/2 −3/2 1 r2−3r1 ! −→ 1 4/3 1/3 0 0 1 −5 3 r2∗3 −→ r1−4/3r2 −→ B 1 = ! 1 0 7 −4 0 1 −5 3 Then −1 ! 1 4/3 1/3 0 0 1/3 −5/3 1 r2−5r1 7 −4 −5 3 (1) ! ! (3) Sinéad Ryan, ryan@maths.tcd.ie, see also http://www.maths.tcd.ie/˜ryan/123.html −2 2 1 1 0 0 r2↔r3 −→ 0 1 0 0 0 −1 1 2 0 0 1 0 −2 2 1 1 0 0 2 0 0 1 0 1 0 −1 0 0 0 1 −1 4 1 1 1 0 r1+r3 −→ 0 1 0 0 0 −1 1 2 0 0 1 0 1 −4 −1 −1 −1 0 r1∗(−1) 0 −1 0 0 −→ 0 1 1 0 1 2 0 0 1 −4 −1 −1 −1 0 r3−r1) 0 0 0 −1 −→ 0 1 0 6 1 1 2 0 1 0 −1 −1 −1 −4 r1+4r2) 0 −1 −→ 0 1 0 0 0 6 1 1 2 0 1 0 −1 −1 −1 −4 r3−6r2) 0 −1 −→ 0 1 0 0 0 0 1 1 2 6 1 0 0 0 1 2 r1+r3) −→ 0 1 0 0 0 −1 0 0 1 1 2 6 Then C −1 0 1 2 = 0 0 −1 1 2 6 (4) 2. Solving systems of equations with matrix inverses Use the inverse of the matrix A in Question 1 to solve the following 2 different systems of linear equations by matrix multiplication. 2x + 3y = 10 3x + 5y = 15 and 2x + 3y = 4 3x + 5y = 7 Hint: first express these systems of equations in matrix form. From Question 1 we know that the inverse of the matrix 2 3 3 5 A= ! −1 is A 5 −3 −3 2 = ! (5) Now recall that a system of linear equations, such as given here, can be expressed in matrix form as Ax = b. If you premultiply both sides of this equation by the inverse of A then you get Ax A Ax Ix x −1 = = = = b A−1 b A−1 b, A−1 b, using the property of matrix inverse using the property of the identity matrix So you see that if we know A−1 we can solve the system of equations by just multiplying it with b. For the particular question here, 2x + 3y = 10 3x + 5y = 15 2 3 3 5 is ! x y ! = 10 15 ! . (6) Then by the algebra above x y ! 10 15 ! = 5 −3 −3 2 ! ! = 5(10) − 3(15) −3(10) + 2(15) = 5 0 ! yielding x = 5 and y = 0. Similarly for the second set of equations, we can write 2x + 3y = 4 3x + 5y = 7 is 2 3 3 5 ! x y ! = 4 7 ! . (7) and now we can reuse the same A−1 as in the first set of equations to get x y ! ! = 5 −3 −3 2 = 5(4) − 3(7) −3(4) + 2(7) = −1 2 4 7 ! ! ! yielding x = −1 and y = 2. Notice that once you know A−1 solving these systems of equations by matrix multiplication is very easy - a lot less work than using GaussJordan elimination. Also, it is sometimes possible to reuse the same A−1 to solve a new problem, if only the right-hand side of the equations changes. 3. Determinants and invertibility Compute the determinant of the following matrices and comment on whether or not they are invertible. A= 2 1 3 6 ! ; B= 2 3 6 9 ! 3 1 6 ; C = −5 0 −2 4 6 −1 (8) det(A) = 2(6) − 1(3) = 9 det(B) = 2(9) − 3(6) = 0 det(C) = 3(0(−1) − (−2)(6)) − (1(−5(−1) − (−2)(4))) + 6((−5)(6) − 0(4)) = −157 Note A and C are invertible since their determinants are nonzero. B is singular ie not invertible. 4. Properties of matrix inverse Verify that • (AB)−1 = B −1 A−1 • det(AB) = det(A)det(B) for the matrices A and B in question 1 above. First, 2 3 3 5 (AB) = −1 (AB) ! 3 4 5 7 47 −29 −34 21 = ! ! You should check this using Gaussian elimination. Now, from question 1 −1 −1 B A ! 5 −3 −3 2 ! = 7 −4 −5 3 = 7(5) + (−4)(−3) 7(−3) + (−4)(2) (−5)(5) + 3(−3) −5(−3) + 3(2) = 47 −29 −34 21 ! ! as required. Secondly, ! 21 29 det(AB) = det 34 47 = (21)(47) − (29)(34) = 987 − 986 = 1 and calculating determinants. det(A) = 2(5) − 3(3) = 1 (9) det(B) = 3(7) − 4(5) = 1 (10) and and so det(A)det(B) = 1 ∗ 1 = 1 as required.