{VERSION 2 3 "SUN SPARC SOLARIS" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 256 "" 1 24 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{PSTYLE "Normal " -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }1 0 0 0 6 6 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 2" 3 4 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 } 0 0 0 -1 4 4 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 3 "" 0 "" {TEXT 256 28 "Elementary Matrix Operati ons" }}{PARA 0 "" 0 "" {TEXT -1 54 "This worksheet shows how to enter \+ matrices and how to " }}{PARA 0 "" 0 "" {TEXT -1 37 "perform basic ope rations on matrices." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 68 "First loa d the linear algebra package. The colon suppresses output." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg):" }}}{SECT 1 {PARA 3 "" 0 " " {TEXT -1 16 "Entering Matrics" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 66 "There are several ways to enter matrices. In what follows A and C" } }{PARA 0 "" 0 "" {TEXT -1 66 "are entered as lists of lists. The matr ix B is entered using the " }{TEXT 257 6 "matrix" }}{PARA 0 "" 0 "" {TEXT -1 66 "command with three parameters. The first two parameters \+ give the " }}{PARA 0 "" 0 "" {TEXT -1 73 "size of the matrix and the t hird is a single list of the elements. Note " }}{PARA 0 "" 0 "" {TEXT -1 46 "the order of the elements in the final matrix." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 90 "A := matrix([[1,2],[2,3]]);\nB := matrix( 2,2,[3,-1,0,3]);\nC := matrix([[1,0,-1],[2,3,-5]]);" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 34 "Matrix Addition and Multiplication" }} {SECT 1 {PARA 4 "" 0 "" {TEXT -1 15 "Matrix Addition" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 69 "There are two basic ways to do matrix addition. The first is with the" }}{PARA 0 "" 0 "" {TEXT -1 35 "addition operat or, + or &+, and an " }{TEXT 258 5 "evalm" }{TEXT -1 26 ". If one doe s not use the" }}{PARA 0 "" 0 "" {TEXT 259 5 "evalm" }{TEXT -1 33 ", M aple will not compute the sum." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "e valm(A + B);\nevalm(A &+ B);\nA + B;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "The " }{TEXT 261 6 "matadd" }{TEXT -1 24 " command is part of th e " }{TEXT 262 6 "linalg" }{TEXT -1 26 " package. One can include" }} {PARA 0 "" 0 "" {TEXT -1 30 "coeffiecients to the addition." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "matadd(A,B);\nmatadd(A,B,1,a);" }}}} {SECT 1 {PARA 4 "" 0 "" {TEXT -1 21 "Matrix Multiplication" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 74 "As with addition, there are two basic way s of doing matrix multiplication." }}{PARA 0 "" 0 "" {TEXT -1 32 "One \+ is with the &* operator and " }{TEXT 260 5 "evalm" }{TEXT -1 1 "." }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "evalm(A &* C);" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 26 "The other way is with the " }{TEXT 263 8 "multiply " }{TEXT -1 39 " command from the linalg package. With" }}{PARA 0 "" 0 "" {TEXT -1 60 "this command one can multiply more than two matrices easily." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "multiply(A,C);\nmultipl y(A,B,C);\nmultiply(C,A);" }}}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 16 "S pecial Matrices" }}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 15 "The Zero Matri x" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "The " }{TEXT 264 6 "matrix" } {TEXT -1 73 " command can have a function of the entry indices as the \+ third parameter." }}{PARA 0 "" 0 "" {TEXT -1 51 "Using this form, it i s easy generate a zero matrix." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "m atrix(2,2,0);" }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 19 "The Identity M atrix" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 4 "The " }{TEXT 265 4 "diag" }{TEXT -1 18 " command from the " }{TEXT 266 6 "linalg" }{TEXT -1 53 " package takes a sequence of n numbers or expressions" }}{PARA 0 "" 0 "" {TEXT -1 81 "and returns a diagonal matrix with the sequence elemen ts on the main diagonal and" }}{PARA 0 "" 0 "" {TEXT -1 30 "zeros in e very other position." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "diag(1,1); " }}}}{SECT 1 {PARA 4 "" 0 "" {TEXT -1 15 "Random Matrices" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 42 "One can generate random matrices with the " }{TEXT 267 10 "randmatrix" }{TEXT -1 18 " command from the " } {TEXT 268 6 "linalg" }}{PARA 0 "" 0 "" {TEXT -1 76 "package. This can be useful for testing a hypothesis. This procedure takes" }}{PARA 0 "" 0 "" {TEXT -1 78 "two parameters, the size of the matrix, and retur ns a matrix whose entries are" }}{PARA 0 "" 0 "" {TEXT -1 27 "random t wo digit integers. " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "randmatrix(2 ,2);" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 75 "There are other specific types of matrices that are preprogrammed in Maple." }}{PARA 0 "" 0 " " {TEXT -1 71 "If you are interested, look at the commands in the lina lg package using" }}{PARA 0 "" 0 "" {TEXT -1 18 "the help facility." } }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 16 "Simple Exercises" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 41 "Find the product and sum of the matrices \+ " }{XPPEDIT 18 0 "A =MATRIX([[1,2,3],[4,3,1],[2,0,1]])" "/%\"AG-%'MATR IXG6#7%7%\"\"\"\"\"#\"\"$7%\"\"%\"\"$\"\"\"7%\"\"#\"\"!\"\"\"" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "B = MATRIX([[1,0,-1],[2,-2,2],[3,-1,2]]) " "/%\"BG-%'MATRIXG6#7%7%\"\"\"\"\"!,$\"\"\"!\"\"7%\"\"#,$\"\"#F-\"\"# 7%\"\"$,$\"\"\"F-\"\"#" }{TEXT -1 1 "." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 84 "Generate 20 pairs of random 2 by 2 matrices and check if \+ they commute, i.e. CS = SC." }}{PARA 0 "" 0 "" {TEXT -1 71 "What do yo u conclude about the portion of 2 by 2 matrices that commute?" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 7 "Define " }{XPPEDIT 18 0 "D=diag(1,2 ,3)" "/%\"DG-%%diagG6%\"\"\"\"\"#\"\"$" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "G = MATRIX([[1,2,3],[4,5,6],[7,8,9]])" "/%\"GG-%'MATRIXG6#7%7%\" \"\"\"\"#\"\"$7%\"\"%\"\"&\"\"'7%\"\"(\"\")\"\"*" }{TEXT -1 42 ". Com pute DG and GD. Explain the results" }}{PARA 0 "" 0 "" {TEXT -1 65 "u sing the sum and row characterizations of matrix multiplication." }}}} }{MARK "4 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 }