งานนำเสนอmatrix

Click here to load reader

Download งานนำเสนอMatrix

Post on 01-Nov-2014

525 views

Category:

Technology

0 download

Embed Size (px)

DESCRIPTION

presentation Matrix

TRANSCRIPT

  • 1. Matrix Algebra Basics By Nittaya NoinanKanchanapisekwittayalai phechabunM.4

2. Algebra 3. Matrix Algebra Matrix algebra is a means of expressing largenumbers of calculations made upon ordered sets ofnumbers. Often referred to as Linear Algebra Many equations would be completely intractable ifscalar mathematics had to be used. It is alsoimportant to note that the scalar algebra is underthere somewhere. 4. Matrix (Basic Definitions)An m n matrix A is a rectangular array ofnumbers with m rows and n columns. (Rows arehorizontal and columns are vertical.) The numbersm and n are the dimensions of A. The numbers inthe matrix are called its entries. The entry in row iand column j is called aij . a11 ,, a1n a21 ,, a2 n AAij ak 1 , , akn4 5. MatrixA matrix is any doubly subscripted array ofelements arranged in rows and columns. a11 , , a1n a 21 , , a 2nA Aij am1 , , am n 6. Definitions - Matrix A matrix is a set of rows and columns ofnumbers 1 2 34 5 6 Denoted with a bold Capital letter All matrices (and vectors) have an order -that is the number of rows x the number ofcolumns. Thus A = 1 2 34 5 6 2x3 7. Definitions - scalar scalar - a number denoted with regular type as is scalar algebra [1] or [a] 8. Definitions - vector vector - a single row or column of numbers denoted with bold small letters row vector a =1 2 3 4 5 column vector x =x1x2x3x4x5 9. Row Vector[1 x n] matrix A a1 a2 , , anaj 10. Column Vector[m x 1] matrix a1 a2A ai am 11. Special matrices There are a number of special matrices Square Diagonal Symmetric Null Identity 12. Square matrix A square matrix is just what it sounds like, an nxn matrixa11 a12 a13 a14a21 a22 a23 a24a31 a32 a33 a34a41 a42 a43 a44 Square matrices are quite useful for describing theproperties or interrelationships among a set of things like a data set. 13. Square MatrixSame number of rows andcolumns 5 4 7B3 6 1 2 1 3 14. Diagonal Matrices A diagonal matrix is a square matrix that hasvalues on the diagonal with all off-diagonalentities being zero.a11000 0a220 0 0 0a330 0 00 a44 15. Symmetric Matrix All of the elements in the upper right portion ofthe matrix are identical to those in the lowerleft. For example, the correlation matrix 16. Identity Matrix The identity matrix I is a diagonal matrixwhere the diagonal elements all equal one.It is used in a fashion analogous to multiplyingthrough by "1" in scalar math. 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 17. Null Matrix A square matrix where all elements equal zero.0 0 0 00 0 0 00 0 0 00 0 0 0 Not usually used so much as sometimes the resultof a calculation. Analogous to a+b=0 18. Types of Matrix Identity matrices - I Symmetric1 00 0ab c1 0 0 10 0bd e010 01 0c e f0 00 1 Diagonal matrices are (of Diagonal course) symmetric Identity matrices are (of 1 0 00course) diagonal 0 2 00 0 01 0 0 0 0 4 19. TheIdentity 20. Identity MatrixSquare matrix with ones on thediagonal and zeros elsewhere.1 0 0 00 1 0 0I0 0 1 00 0 0 1 21. Operations with Matrices (Transpose)TransposeThe transpose, AT , of a matrix A is the matrix obtained from A bywriting its rows as columns. If A is an kn matrix and B = AT thenB is the nk matrix with bij = aji. If AT=A, then A is symmetric.Example: Ta11 a21a11 a12 a13a12 a22a21 a22 a23a13 a23 It it easy t overify: (A B)T AT B T , (A B)T AT BT , (AT )T A, (rA)TrAT where A and B are k n and r is a scalar. Let C be a k m mat rixand D be an m n mat rix. hen,T (CD)T DT C T , 22. The Transpose of a Matrix At Taking the transpose is an operation thatcreates a new matrix based on an existingone. The rows of A = the columns of At Hold upper left and lower right corners androtate 180 degrees. 23. Transpose Matrix Rows become columns and columns become rowsa11 , a12 ,, a1n a11 , a 21 , , an1a 21 , a 22,, a 2n a12 , a 22 , , an 2AA tam1 , am 2, amna1m, a 2 m , , anm 24. Example of a transpose1 4 t 1 2 3A 2 5 ,A 4 5 63 6 25. The Transpose of a Matrix At If A = At, then A is symmetric (i.e. correlation matrix) If A AT = A then At is idempotent (and A = A) The transpose of a sum = sum of transposes The transpose of a product = the product of thetransposes in reverse order (A BC) t At Bt Ct 26. Transpose MatrixEx 1 1 2 T 1 3 1A3 0 A1 42 0 4 (3 2) (2 3) 27. Transpose MatrixEx 24 14 34 0 2B 01 3 1 BT 11 72 7 5 2 4 3 5 (3 4)3 1 2(4 3) 28. Matrix Equality Two matrices are equal iff (if and only if) all oftheir elements are identical Note: your data set is a matrix. 29. Matrix EqualityEx1. Assume A = B find x , y ,z 1 2 x2 A 3 0 ,B3y1 4z4Solution. If A = B that mean x =1 y = 0 z = -1 30. Matrix EqualityEx2. Assume C = D find x , y ,zx y 1 4 34 14 3C 01 3 1 ,D01 3 12 7 5 2y 7 5 zSolution. If C = D that mean y = 2 , z = 2 andx + y = 4 thus x + 2 = 4then x = 2 31. Matrix Operations Addition and Subtraction Multiplication Transposition Inversion 32. Matrix Addition A new matrix C may be defined as the additive combination of matrices A and B where: C = A + B is defined by: CijAijBijNote: all three matrices are of the same dimension 33. Addition a11 a12 AIf a 21 a 22 b11 b12andB b 21 b 22a11 b11 a12 b12then Ca 21 b 21 a 22 b22 34. If A and B are both m n matrices then the sum of Aand B, denoted A + B, is a matrix obtained by addingcorresponding elements of A and B.corresponding elements of A and B. add addadd addadd these add these these 0 4 3 111these222 22theseB2these33 300 0 44 4 AA 1A 0 1 22 22111 333B B 2 33 00 444B 1B 2 21 1 4 4 A 00A 0B 2 1 411 33 2 1402 14 2222 226AAABBB22 2 22 666AAABBB201220 35. Matrix Addition Example3 4 1 2 4 6AB C5 6 3 4 8 10 36. A B BA A (B C) ( A B) C 37. Addition and Subtraction (cont.)a11 b11c11 Where a12 b12c12a21 b21c 21a22b22 c 22a31 b31c31a32b32 c32 Hence 1 2 4 6 5 83 4 4 6 7 105 6 4 6 9 12 38. Matrix Subtraction C = A - B Is defined byCij Aij BijNote: all three matrices are of the same dimension 39. Subtractiona11 a12 AIfa 21 a 22b11 b12andBb 21 b 22thena11 b11 a12 b12Ca 21 b21 a 22 b22 40. Addition and Subtraction (cont.)a11b11 c11 Where a12b12 c12a 21 b21 c 21a 22 b22 c 22a 31 b31 c31a 32 b32 c32 Hence 1 24 6343 44 6 125 64 610 41. Operations with Matrices (Scalar Multiple)Scalar MultipleIf A is a matrix and r is a number (sometimescalled a scalar in this context), then the scalarmultiple, rA, is obtained by multiplying everyentry in A by r. In symbols, (rA)ij = raij .Example:3 4 1 6 8 226 7 0 12 14 041 42. Scalar Multiplication To multiply a scalar times a matrix, simplymultiply each element of the matrix by thescalar quantity a11 a122a11 2a12 2 a21 a222a21 2a22 43. If A is an m n matrix and s is a scalar, then we let kA denote the matrix obtained by multiplying every element of A by k. This procedure is called scalar multiplication.1 2 2 31 3 2 3 236 6A3A0 1 3 30 3 1 33 03 9PROPERTIES OF SCALAR MULTIPLICATIONk hA kh Ak h AkA hAk AB kA kB 44. The m n zero matrix, denoted 0, is the m nmatrix whose elements are all zeros.0 00 0 00 01 32 2A 0 AA ( A) 00 A 0 45. Operations with Matrices (Product)ProductIf A has dimensions k m and B has dimensions m n, then the productAB is defined, and has dimensions k n. The entry (AB)ij is obtainedby multiplying row i of A by column j of B, which is done by multiplyingcorresponding entries together and then adding the results i.e., b1 j b2 j( ai1 ai 2 ... aim ) ai1b1 j ai 2b2 j ... aimbmj . bmjExam ple a baA bC aBbD A B c d .cA dC cBdD C D e feA fC eB fD 1 0 0 0 1 0Ident it ym at rixI for any m n m at rixA, AI A and for 0 0 1 n nany nm m at rixB, IBB. 46. Matrix Multiplication (cont.) To multiply a matrix times a matrix, we write A times B as AB This is pre-multiplying B by A, or post-multiplying A by B. 47. Matrix Multiplication (cont.) In order to multiply matrices, they must beconformable (the number of columns in Amust equal the number of rows in B.) an (mxn) x (nxp) = (mxp) an (mxn) x (pxn) = cannot be done a (1xn) x (nx1) = a scalar (1x1) 48. Matrix Multiplication (cont.) The general rule formatrix multiplicationis:Ncij aik bkj wherei 1,2,...,M , and j 1,2,...,Pk 1 49. Matrix MultiplicationMatrices A and B have these dimensions:[r x c] and [s x d] 50. Matrix MultiplicationMatrices A and B can be multiplied if: [r x c] and [s x d] c=s 51. Matrix MultiplicationThe resulting matrix will have the dimensions: [r x c] and [s x d] rxd 52. Computation: A x B = C a11 a12A[2 x 2] a 21 a 22b11 b12 b13B[2 x 3]b 21 b 22 b 23a11b11 a12b21 a11b12 a12b22 a11b13 a12b23Ca 21b11 a 22b21 a 21b12 a 22b22 a 21b13 a 22b23 [2 x 3] 53. Computation: A x B = C 2 3 111A 11and B 1 0 21 0[3 x 2][2 x 3] A and B can be multiplied2 *1 3 *1 5 2 *1 3 * 0 2 2 *1 3 * 2 8528C 1*1 1*1 2 1*1 1* 0 1 1*1 1* 2 32131*1 0 *1 1 1*1 0 * 0 1 1*1 0 * 2 1 111[3 x 3] 54. Computation: A x B = C 2 3111A 11and B1 0 21 0[3 x 2][2 x 3]Result is 3 x 32 *1 3 *1 5 2 *1 3 * 0 2 2 *1 3 * 2 8528C 1*1 1*1 2 1*1 1* 0 1 1*1 1* 2 32131*1 0 *1 1 1*1 0 * 0 1 1*1 0 * 2 1 111 [3 x 3] 55. The multiplication of matrices is easier shown than put into words. You multiply the rows of the first matrix with the columns of the second adding products Find AB2 43 21A B1 3041 3 13 22 322 11 1 3 5First we multiply across the first row and down thefirst column adding products. We put the answer inthe first row, first column of the answer. 56. Find AB2 4321A B1 30 41 3 1 5 77 5 AB AB0034 4 442313 3 1 1 3 7 1 0 24 4 3 3 40 2 21 1 1111 11Notice the sizes of A and B and the size of the product AB.Now we multiplyacross first first androw and downNow we multiply across the row rowrow and downWe multiplied across the second down first thesecond and downthe second column well put the the answerthe thesecond column andand well put answer in the firstthe first column and the answer inanswer in incolumn so we put well put the the firstsecond row, first column.row, second second column.second row, column.row, first column. 57. To multiply matrices A and B look at their dimensionsm nn pMUST BESAMESIZE OFPRODUCTIf the number of columns of A does notequal the number of rows of B

View more