Matrices: Suppose you have two simultaneous equations: y y 3 () Now, if you see that and y are present in both equations, you may write: y 3 () You should be able to see where the numbers have come from. If you think back to vector notation, you should remember that you can epress as y a vector say. a b Now, you can epress a matri as. c d So, you can epress () as: Infact, a vector like is a matri, just with fewer columns. More generally however, you would say that the matri has i rows, and j columns. nd you can find elements within a matri like this if you want the element that is on the nd row, st column, you would write ij, and in the case above, b. Its quite important to get the order right it goes along the top, then down across, down. nd in the matri in equation (), ( across, down!) a b The general matri ( columns, rows) can then be written as c d So, if you use some general functions, or numbers if you like, in equations (): a by c dy y You should be able to epress this in the form of (): a c b d y y or This can be thought of as a set of operations (the matri) acting upon some points (the vector) to give some new points (the RHS vector). This is a transformation matri. One set of coordinates going to another set. - -
Now, if you where to plot the vector on the -y plane [so, you get a point at y coordinates (, y)]; then the vector, you will begin to see a physical y representation of what the matri is doing or transforming. a You may see matrices written as c b d, rather than curly brackets. It doesn t matter. If you think back to the original equations, and how we got a matri from simultaneous equations, you can start making up some algebra for these things. In particular, multiplication. If you go from: 3 You can see that the top row of the matri is going down the vector. is multiplying 3. nd multiplying. then you add up these products: ( 3) ( ) Similarly for the second row: ( 3) ( ) In this eample, the matri is transforming the coordinates (3, ) to the point (, ). If you draw it on an -y plane it will become a lot clearer! If you think a bit more about vectors, you will remember that y is a 3D vector. z It turns out there are also 33 matrices! So, using the same notation, with a general matri, and a general vector: a d g b e h c f y y i z z or: gain, if you think about some simultaneous equations: a by cz d ey fz y g hy iz z So you can see how to go from equations to matrices. - -
Note also, that the 33 matri is still just transforming points (, y, z) to (, y, z ). The notation of ij before becomes a lot more useful for eample b and 3 g and 3 h, finally 33 i cross the top, then down. Here is a numbers eample again: 8 3 9 8 9 0 7 If I write out everything again: ( ) ( ) ( ) 8 ( ) ( 3 ) ( ) 9 ( 8 ) ( 9 ) ( 0 ) 7 You see where the numbers come from. You can multiply matrices together, and add them and all sorts! Things I will go into later. There are a number of useful operations to do to a matri: The Determinant, Transpose and the Inverse. The Transpose: a b a c Suppose we have a matri, and then the transpose T. c d b d T The ij notation for this operation is: ij ji. asically, the rows become columns, and the columns rows. See this for a 33 matri: a b c d e f Then g h i T a b c d e f g h i The superscript of T means the transpose of the matri. nd eample with numbers: 8 3 9 0 T 3 8 9 0-3 -
This may seem a little abstract, and nonsensical, but there will be need to do this a little later. The Determinant: a b Start, again, with the matri. c d a b Now, the determinant is. c d To calculate this: a c b d ( a d ) ( b c) It s a little more comple with 33 matrices although you have met them in evaluating cross products: a b c a b c e f d f d d e f d e f a b c h i g i g g h i g h i e h Note the minus sign!! So, to find the determinant of a 33 matri, you will need to work out the determinant of 3 matrices. nd, for matrices, its basically the same det s of 33 s, each of which need 3 s! So it gets very messy, very quickly! way of thinking about how to write them down: st element, then multiply by the determinant of the matri which DOES NOT INLUDE the row or column of the element. ut you just need to remember the minus sign for the middle determinant. The Inverse. This is the most useful, so far. Suppose we have simultaneous equations: y 3 How can we find what and y are? Now, remember that we wrote: - -
- - It is valid to say that: Where is the inverse of. It turns out that: a c b d Swop the elements on the leading diagonal, an multiply the others by - numerical eample is best: and ( ) ( ) So: Now, to apply this to solve the simultaneous equations 3 y so Therefore: 3 y We just calculated the inverse: So: 3 y nd we know how to multiply matrices by vectors:
3 3 So, y 3 3 Which is the same as writing: y 3 So, we have just found the solutions to the simultaneous equations. It may seem long winded, but it is more useful with 3 simultaneous equations, in 3 unknowns. The inverse for a 33 matri is a little different: Infact, this is an eample of the more general case. It involves the concept of cofactors: This also needs you to bear in mind this chess board effect: The cofactor of the top left element - - is given by: 3 3 33 There is a cofactor for each element in the 33 matri so 9 altogether. They are found by the determinant of the matri containing the elements from the original matri which are NOT in the row/column containing the cofactor. So, for eample: is formed from the elements NOT in the nd row OR nd column. The sign is determined from the above chessboard rule. Now: The inverse of a 33 matri is: T 3 3 3 3 33 T Where is the transpose of the matri containing the cofactors of. So, in the i/j notation: T ij cof ( ij ) and ij ji. - -
Matri lgebra: Matri addition/subtraction is pretty simple: If you have a matri equation, and you need to find, then the elements of come from adding the corresponding elements of and. So, ij ij ij, which will come a lot more transparent if you where to write the elements out. Similarly for subtraction: ij ij ij, if. lso, when multiplying a matri by a number (or a scalar!) which is something we have already used just multiply every element within the matri by that number: k. k ij Multiplication of matrices: Suppose we want to evaluate: The way to do it is: What you are doing is: Dive row one onto column one multiplying, then adding that gives the first element. Dive row one onto column two. Row two onto column one. Row two onto column two. The i/j notation for this is: m ij ik kj k ik kj Einstein summation convention drops the sum sign. Note, you can only multiply matrices which have same number of columns, then rows. The order of multiplication is VERY important. To multiply 33 matrices, write them out, term by term, and evaluate all the products and sums. - 7 -
n important matri, which hasn t been mentioned so far, is the identity matri. It can be epressed as a, 33, matri. It is denoted by I. 0 I or 0 You should see the pattern. I 0 0 Eigenvalues and Eigenvectors. onsider: λ What that is saying is this: matri is operating on a vector, to give another vector, which is just a scalar multiple of itself. The vector is then called an eigenvector, and the scalar λ is called the eigenvalue. Now, this matri equation, ( I) 0 0 0 0 0 λ, can be written as: λ using the identity matri above. Now, this only has non trivial solutions if: λ I 0 For an eample of matrices: nd, as λ I 0: 0 λ 0 λ I λ 0 0 λ λ λ I 0 λ λ I λ 0 λ λ λ λ λ ( λ)( λ ) 0 Hence, epanding out into a quadratic, we find the characteristic equation: - 8 -
( ) λ 0 λ This gives a quadratic equation for λ, which can be solved this will usually give eigenvalues the roots to the quadratic. Then, the eigenvectors can be found from: The definition was ( λ I) e 0, so for each eigenvector e, there will be an eigenvalue λ, so ( λ I ) e 0 So, solving: i i λ 0 λ y 0 Will give two eigenvectors, one for each eigenvalue found. The process is similar for 33, matrices, but, due to the nature of the determinants, a cubic, or quartic, equation will come out and they are generally hard to solve! ut eamples are the best way to get your head round eigenvalues/vectors. - 9 -