A Fast Introduction What is a matrix ------ (One Matrix many matrices) Why do they exist Matrix Terminology • Elements • Rows • Columns Square Matrix Adding/Subtracting Multiplying/ Dividing (Divisions are Multiplications) The Inverse Matrix (equivalent to 1.0) inverse matrix 1 Inverse of a Matrix Solving simultaneous equations Today’s Goals —To be able to find the inverse of a Matrix A ~ A’ —To use this for solving simultaneous equations Recap The identity Matrix is the equivalent of the number 1 in matrix form 1 0 1 0 1 3 2 4 1 2 2 4 1 3 inverse matrix 2 4 1 0 0 1 1 2 2 4 3 Definition of Inverse The inverse is Defined as 1 3 2 4 ? ? ? ? AA-1 = A-1A = I 1 0 0 0 ? ? ? ? 1 3 2 4 1 0 0 0 We will find out how to calculate the inverse for 2x2 matrix But first why is it important ? Because it will allow us to solve equations of the form a 11 a 21 a 12 x 1 . a 22 x 2 b1 b 2 inverse matrix We will only consider 2x2 Matrix systems That means simultaneous equations 4 Why will it help us solve equations? Because if we can express a system of equations in the form Ax b Then we can multiply both sides by the inverse matrix A 1 1 Ax A b And we can then know the values of X because A 1 A I 1 x A b inverse matrix 5 Recap Multiplication 4 6 6 1 5 4 3 0 2 1 3 2 2 7 3 6 2 5 2 = 1 6 = 1 4 = 8+ 3+ 12 -12+0+ 6 12+ 9 2+ 6 10+ 21 24+10 inverse matrix 4+8 = 23 -6 = 21 8 31 = 34 12 6 Shapes and sizes • Dimensions and compatibility given by the domino rule 23 31 21 To multiply the columns of the first must be equal to the rows of the second The dimensions of the result are given by the 2 outer numbers Note matrix multiplication is not commutative. If A is a 3x1 and B is a 1x3 then AB is 3x3 BA is 1x1 inverse matrix The multiplicative inverse of a matrix • This can only be done with SQUARE matrices • By hand we will only do this for a 2x2 matrix • Inverses of larger square matrices can be calculated but can be quite time expensive for large matrices, computers are generally used Ex A = 4 1 4 1 8 3 8 0 . 75 3 0 . 25 then A-1 = 0 . 75 0 . 25 2 1 2 32 1 0 . 75 0 . 75 inverse matrix as AxA-1 = I 8 8 1 2 3 0 0 1 8 a c Finding the Inverse of a 2x2 matrix b d Step-1 First find what is called the Determinant This is calculated as ad-bc Step-2 Then swap the elements in the leading diagonal Step-3 Then negate the other elements d c b a d b c a Step-4 Then multiply the Matrix by 1/determinant d b c a ad cb 1 inverse matrix 9 Example Find Inverse of A Step 1 – Calc Determinant 4 A 1 8 3 Determinant (ad-cb) = 4x3-8x1 = 4 Step 2 – Swap Elements on leading diagonal step2 3 1 8 4 Step 3 – negate the other elements step3 3 1 Step 4 – multiply by 1/determinant step4 1 3 4 1 8 4 8 4 check A 1 0 . 75 0 . 25 2 1 AA 1 4 8 1 3 inverse matrix 0 . 75 0 . 25 3 2 0 . 75 0 . 75 2 1 8 8 23 1 0 0 1 10 Find the inverses and check them 2 A 1 5 B 1 2 C 0 6 5 20 2 2 1 A 1 5 4 1 1 B C 1 1 6 1 . 25 2 0 . 25 1 2 10 1 1 1 2 0 inverse matrix 20 0 . 2 5 0 .1 2 0 .5 2 0 1 .5 0 .5 2 0 .5 1 1 11 More inverses to find and check 2 A 1 4 3 A 5 10 B 1 2 3 C 2 8 D 1 2 E 1 1 F 0 C 2 0 8 4 0 1 1 B 2 1 1 D E 1 1 1 4 1 .5 2 0 .5 1 3 2 1 10 0 . 1 5 0 . 05 1 2 20 1 1 1 1 2 1 0 2 1 2 1 3 2 2 0 8 0 .5 2 1 0 .5 0 . 25 2 3 1 4 cannot be found as det 2 4 ( 1 8 ) 8 8 0 F inverse matrix 1 11 1 0 0 1 1 0 0 self inverting 1 12 Applications of matrices • Because matrices are clever storage systems for numbers there are a large and diverse number of ways we can apply them. • Matrices are used in to solve equations on computers - solving equations • They are used in computer games and multi-media devices to move and change objects in space - transformation geometry • We only consider solving equations on Maths1 with using 2x2 matrices inverse matrix 13 Solving simultaneous equations • • • We can use our 2x2 matrices to express 2 simultaneous equations (2 equations about the same 2 variables) First we must put them in the correct format for the variables x & y the format should be ax + by = m cx + dy = n {where a,b,c,d,m & n are constants} Example Peter and Jane spend £240 altogether and Peter spends 3 times as much as Jane. let p: what Peter spends and j: what Jane spends then p + j = 240 p=3j rewrite p-3j = 0 (right format a and b = 1 m = 240) (wrong format) (right format c = 1 d = -3 n = 0) inverse matrix 14 Solving simultaneous equations We can use our 2x2 matrices to express these simultaneous equations x y 240 0 x 3y 1 1 1 x1 3 x 2 constants from the left hand side Becomes in matrix form 240 0 UNKNOWNS X ~ x1 Y ~ x2 inverse matrix constants from the right hand side 15 1 1 1 x1 3 x 2 240 0 Format is Ax=B To solve this using the matrix we must get rid of it by using its inverse! First find the inverse 1 1 1 3 1 1 3 4 1 1 0 . 75 1 0 . 25 0 . 25 0 . 25 now use it on both sides of the equation 0 . 75 0 . 25 0 . 25 1 0 . 25 1 1 x1 3 x 2 1 0 0 . 75 0 . 25 0 x1 1 x 2 0 . 75 0 . 25 x1 x 2 180 60 0 . 25 240 0 . 25 0 0 . 25 240 0 . 25 0 So Answer is p = 180 j = 60 inverse matrix 16 Summary of method 1. Format the simultaneous equations for variable x & y 2. Rewrite them in matrix form 3. Find the inverse of the 2x2 matrix 4. Solve for the variables x,y by multiplying the right hand side of the equation by the inverse ax + by = m cx + dy = n a c b x m d y n a c b d 1 d ad bc c 1 x d 1 y ad bc c inverse matrix b a b m a n 17 Your Turn solve the following 3x +4y = 5 5x = 7-6y x+7y = 1.24 3y -x = 0.76 8x = 3y -1 x+y =-7 3 5 4 x 5 6 y 7 x 1 6 y 2 5 1 1 x 1 3 y 10 1 8 1 Answer x = -1 y = 2 4 5 1 30 28 1 2 1 3 7 2 25 21 2 4 2 7 x 1 . 24 3 y 0 . 76 Answer x = -0.16 y = 0.2 7 1 . 24 1 3 . 72 5 . 32 1 1 . 6 0 . 16 1 0 . 76 10 1 . 24 0 . 76 10 2 0 . 2 3 x 1 1 y 7 x 1 1 y 11 1 Answer x = -2 y = -5 3 1 1 1 21 1 22 2 8 7 11 1 56 11 55 5 inverse matrix 18