{VERSION 5 0 "APPLE_PPC_MAC" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" 0 21 "" 0 1 0 0 0 1 0 0 0 0 2 0 0 0 0 1 }{CSTYLE "" -1 35 " " 0 1 104 64 92 1 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE " " -1 259 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 268 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 269 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 270 "" 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normal " -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 4 1 0 1 0 2 2 0 1 }{PSTYLE "Maple Output" -1 11 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 3 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Title" -1 18 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 1 2 2 2 1 1 1 1 }3 1 0 0 12 12 1 0 1 0 2 2 19 1 }{PSTYLE "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 257 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 1 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 258 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 259 1 {CSTYLE "" -1 -1 "T imes" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 } } {SECT 0 {EXCHG {PARA 18 "" 0 "" {TEXT 256 9 "Lecture 5" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 33 " Deletion and Undoing a Deletion." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 151 "Usually \+ selecting something with the cursor and hitting the delete key will de lete things. But to delete some things I have found that I need to u se " }{TEXT 330 6 "Delete" }{TEXT -1 1 " " }{TEXT 331 9 "Paragraph" } {TEXT -1 20 " from the pull down " }{TEXT 332 4 "Edit" }{TEXT -1 73 " \+ menu. Then the paragraph where your cursor is located will be deleted. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 131 "Af ter deleting , cutting, or pasting something, if you change your mind before doing anything else, you can go to the top of the " }{TEXT 333 4 "Edit" }{TEXT -1 10 " menu and " }{TEXT 334 4 "undo" }{TEXT -1 30 " the deletion, cut, or paste." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 241 "Also note that if you click the paragrap h symbol near the right end of the menu bar it will sometimes help to \+ see what you should delete. This is especially true when dealing with \+ text. To get back to normal click the paragraph symbol again." }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 16 " Random Numbers " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "" 0 "" {TEXT 312 10 "rand(a..b)" }{TEXT -1 49 " is a p rocedure with no arguments that creates a " }{TEXT 314 23 "(pseudo) ra ndom integer" }{TEXT -1 13 " in the range" }{TEXT 313 8 " a to b." } {TEXT -1 233 " To call the procedure one needs to add extra parenthens izes as in the following examples. If you don't add the extra () after rand(a..b) you just get the description of the procedure. We will use the custom of calling the output of " }{TEXT 392 12 "rand(a..b)()" } {TEXT -1 3 " a " }{TEXT 319 13 "random number" }{TEXT -1 214 ". But st rictly speaking the numbers so give are not really random. After all, they are generate by a compute program. If you wish to learn more ab out such matters I recommend that you take a look at the book The " } {TEXT 315 27 "Art of Computer Programming" }{TEXT -1 1 " " }{TEXT 316 30 "Vol 2 Seminumerical Algorithms" }{TEXT -1 39 ", by Donald Knuth. \+ See Chapter Three, " }{TEXT 317 14 "Random Numbers" }{TEXT -1 1 "." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 47 "We now il lustrate the use of the Maple command " }{TEXT 398 4 "rand" }{TEXT -1 34 " to produce pseudo-random numbers:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "restart;\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "rand(0..20)();" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 127 "If you wan t to use this procedure repeatedly you can give it a shorter name. I w ill use f here. Sometime people use names like " }{TEXT 335 4 "dice" } {TEXT -1 4 " or " }{TEXT 336 3 "die" }{TEXT -1 14 " (singular of " } {TEXT 337 4 "dice" }{TEXT -1 3 "), " }{TEXT 340 4 "roll" }{TEXT -1 6 " , or " }{TEXT 338 4 "flip" }{TEXT -1 66 ". But you can use any name y ou wish. Let's just name this one f. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "f:=rand(0..20):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 20 "Note that each time " }{TEXT 318 4 "f ()" }{TEXT -1 56 " is execut ed it gives a usually different random number." }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 38 "for i from 1 to 4 do print(i,f()); od;" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 78 "Or, we can create a sequence of 50 random numbers between 0 and 20 as follows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "seq(f(), i=1..50);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 37 "Let's create a sequence of 50 random " }{TEXT 339 4 "bits " }{TEXT -1 14 " ( 0s and 1s):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "b:=rand(0..1):\nseq(b(), i=0..50);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 82 "To get a (pseudo) random \+ number in the interval [0,1] you might use the following:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "h:=rand(0..10^6):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 " for i from 1 to 10 do\nprint(evalf(h()/10^6));\nod;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 12 " Random Sets" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 25 "Here's one way to pick a " }{TEXT 308 22 "(pseudo) random subset" }{TEXT -1 58 " from t he set \{1,2,3,4,5\}: First we must load the package " }{TEXT 404 8 "c ombinat" }{TEXT -1 67 " using the following command. For more on packa ges see the section " }{TEXT 405 8 "Packages" }{TEXT -1 7 " below." }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "with(combinat); " }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 10 "Set n = 5." }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 5 "n:=5;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 63 "W e set S to be the powerset of the set of integers from 1 to n." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "S:=powerset(\{seq(i,i=1..n) \});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 78 "\nLet's see how many elem ents are in S. (Recall that a set with n elements has " }{XPPEDIT 18 0 "2^n;" "6#)\"\"#%\"nG" }{TEXT -1 39 " subsets. Since n = 5, we ought to get " }{XPPEDIT 18 0 "2^5 = 32;" "6#/*$\"\"#\"\"&\"#K" }{TEXT -1 1 "." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "nops(S);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 116 "Now we define a procedure f which will g enerate random numbers between 1 and nops(S). In this case between 1 a nd 32." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "f:=rand(1..nops(S )):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 259 "\nThere are 2^5 = 32 subs ets of \{1,2,3,4,5\}. The set S above contains these 32 sets. If we us e f as just defined to get a random number i from 1 to 32. Then the co rresponding set S[i] may be considered as a random subset of \{1,2,3,4 ,5\}. Here are some examples:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "S[f()];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "S[f()];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "S[f()];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 156 "Note that each time we execute S[ f()] we get a different set. \n\nA better way to generate a random set is given in the homework assignment for this lecture. " }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 31 " numboccur and convert/multiset" }}{PARA 0 "" 0 "" {TEXT -1 15 "The procedures " }{TEXT 309 9 "numboccur" } {TEXT -1 5 " and " }{TEXT 427 16 "convert/multiset" }{TEXT -1 150 " ca n be used to simplify the type of computation made in the last lecture when counting the number of times a digit appears in the first n dig its of " }{XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 15 ". The command \+ " }{TEXT 35 15 "numboccur(f, x)" }{TEXT -1 34 " returns the number of \+ times that " }{TEXT 35 1 "x" }{TEXT -1 13 " is found in " }{TEXT 35 3 "f, " }{TEXT 310 29 "where f may be any expression" }{TEXT 311 2 ". " }{TEXT -1 23 "Here are some examples:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "roll:=rand(1..6):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "L:=[seq(roll(),i=1..100)];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "numboccur(L,2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "for i from 1 to 6 do\n i,numboccur(L,i);\nend do;\n " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 61 "p:=x^3+3*x*y+2*x^2 + 5* x + 1;\nnumboccur(p,x);\nnumboccur(p,2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "A:=matrix([[1,2,3],[1,3,6]]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 80 "Note that numboccur doesn't work with matrices unles s we use first the function " }{TEXT 341 5 "evalm" }{TEXT -1 31 ", as \+ in the following examples:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "numboccur(A,3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "numb occur(evalm(A),3);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 3 "If " } {TEXT 429 1 "f" }{TEXT -1 6 " is a " }{TEXT 430 4 "list" }{TEXT -1 2 " , " }{TEXT 431 5 "table" }{TEXT -1 4 " or " }{TEXT 433 9 "algebraic" } {TEXT -1 1 " " }{TEXT 432 10 "expression" }{TEXT -1 13 " the command \+ " }{TEXT 428 19 "convert(f,multiset)" }{TEXT -1 316 " converts f to a \+ multiset. A multiset is represented in the form [ [e[1],m[1]], ..., [e [n],m[n]] ]; it is a list of pairs where each e[i] is a value (an expr ession), and m[i] is its multiplicity (an integer). We could have used this command to count the number of times each digit appears in the f irst 100 digits of " }{XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 26 ". He re are a few examples:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "L :=[x,x,y,y,x,z,z,z,x,w,w];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "convert(L,multiset);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 80 "Here \+ we count the number of times each digit appears in the first 100 digit s of " }{XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 1 "." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 80 "n:=100:\nDigits:=n:\nX:=evalf(Pi,n):\nX:= floor(10^(n-1)*X):\nX:=convert(X,base, 10):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "LL:=convert(X,multiset);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 144 "for i from 1 to 10 do\nd:=LL[i][1]:\ncount:=LL[ i][2]:\nprintf(\"The digit %d appears %2d times in the first 100 digit s of %s \\n\",d,count, \"Pi\");\nod:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 9 " Packages" } }{EXCHG {PARA 0 "" 0 "" {TEXT -1 86 "Executing the following command l oads a number of procedures for doing linear algebra." }}{PARA 0 "" 0 "" {TEXT -1 1 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 258 6 "linalg" }{TEXT -1 34 " is an example of what are called " } {TEXT 259 8 "packages" }{TEXT -1 126 " in Maple. A package is a collec tion of commands that must be loaded before they can be used. Other e xamples of packages are " }{TEXT 260 56 "numtheory, combinat, groups, \+ logic, geometry, finance, " }{TEXT -1 4 "and " }{TEXT 261 6 "plots." }{TEXT -1 1 " " }{TEXT 262 1 " " }{TEXT -1 34 "To load a package use t he command " }{TEXT 257 4 "with" }{TEXT -1 69 " as in the above exampl e: Note that if you use a semicolon after the " }{TEXT 263 12 "with(li nalg)" }{TEXT -1 132 " command you will get a list of all the commands in that package. If you don't want to see all the commands, just use \+ a colon. \n\nIn " }{TEXT 272 13 "Maple 6 and 7" }{TEXT -1 45 " there a re some new packages that are not in " }{TEXT 273 7 "Maple V" }{TEXT -1 36 ". For example, there is the package " }{TEXT 264 13 "LinearAlge bra" }{TEXT -1 34 " -- but Maple 6 and 7 also retain " }{TEXT 265 6 "l inalg" }{TEXT -1 10 ". The new " }{TEXT 266 13 "LinearAlgebra" }{TEXT -1 60 " package in Maple 6 and 7 has a lot of the same features as " } {TEXT 267 6 "linalg" }{TEXT -1 62 " but it has additional commands for creating special types of " }{TEXT 268 8 "Matrices" }{TEXT -1 101 ", \+ and improved Matrix algebra. Also, especially when calculating with la rge numeric (floating point) " }{TEXT 269 8 "Matrices" }{TEXT -1 73 ", it is much more powerful and efficient. Note that the new commands i n " }{TEXT 406 13 "LinearAlgebra" }{TEXT -1 64 " are genrally capitali zed unlike in the package linalg. So that " }{TEXT 270 6 "matrix" } {TEXT -1 5 " and " }{TEXT 271 6 "Matrix" }{TEXT -1 90 " are different \+ data type. To simplify matters we shall mostly concern ourselves with the " }{TEXT 402 6 "linalg" }{TEXT -1 222 " package in this course.\n \nTo see a list of all the Maple packages execute the following. If yo u are interested in a particular package, click on its name to get a l ist of commands in that package. Some are quite technical." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "?index,package" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 132 "Execute the following command to load the LinearA lgebra package. This will also show the commands available after it is loaded. Use " }{TEXT 399 1 "?" }{TEXT 401 7 "command" }{TEXT -1 20 " \+ to find how to use " }{TEXT 400 8 "command " }{TEXT -1 8 "as usual" } {TEXT 403 1 "." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "with(Line arAlgebra);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 20 " arrays and matrices" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 18 "Before discussing " } {TEXT 274 6 "matrix" }{TEXT -1 40 " let's discuss the more general con cept " }{TEXT 275 5 "array" }{TEXT -1 40 ": More details can be obtain ed by use of" }{TEXT 276 9 " ?array. " }{TEXT -1 136 "They are best un derstood by looking at examples: Arrays are one type of indexed variab le. The subscripts each must run thru a specified " }{TEXT 277 5 "rang e" }{TEXT 393 1 " " }{TEXT 394 12 " of integers" }{TEXT -1 129 ": Arra ys come in different dimensions: 1-dimensional, 2-dimensional, 3-dimen sional, etc. Here are examples. Execute each in turn." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "A:=array(-3..4);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 114 "The array A has indices -3, -2, - 1, 0, 1, 2, 3, 4. A is a 1- dimensional array. We may assign values as follows:\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "for i from -3 to 4 do A[i]:=i^2; en d do;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 57 "Note that you cannot use other values for the index of A:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "A[5]:=2;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 77 "Now w e define a 2-dimentional array B. Again we specify the range of indice s." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "B:=array(-1..2,0..1); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 35 "Here we assign values to the \+ array:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 78 "for i from -1 to \+ 2 do \nfor j from 0 to 1 do \n B[i,j]:=i + j*x;\nend do;\nend do;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "B;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "eval(B);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "B[1,-1]; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "B[-1,0];" }} }{PARA 0 "" 0 "" {TEXT -1 2 "A " }{TEXT 278 6 "matrix" }{TEXT -1 181 " is a 2-dimensional array where the row and column indices start with \+ 1. One can define matrices directly or convert a 2-dimensional array i nto a matrix as in the following command:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "MB:=convert(B,matrix);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "B[-1,0],B[-1,1]; \nMB[1,1],MB[1,2];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 124 "Maple displays the contents of a matrix in an \+ easier to read form than for arrays. But noe that the following gives \+ nothing." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "MB;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 52 "We must use the following to see the cont ents of MB." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "evalm(MB);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 25 "Consider another example:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "C:=array(1..4,1..2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 76 "for i from 1 to 4 do\nfor j from 1 to 2 do\n C[i,j]: =(i-2)+(j-1)*x; \nod;\nod;\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "C;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "evalm(C);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "type(B,matrix);\n" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "type(B,array);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "type(MB, matrix);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "type(C,matrix);" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 80 "There are other ways to form a matrix or array. Conside r the following examples." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "L:=[ [1,2],[0,1],[1,2],[4,5]];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 109 "Note that the following all give the same result, namely, a 4 \+ by 2 matrix. Study these assignments carefully." }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 84 "X:=array(1..4,1..2, L);\nY:=array(L);\nZ:=matr ix(L);\nW:=matrix(4,2,[1,2,0,1,1,2,4,5]);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 63 "type(X,matrix), type(Y,matrix), type(Z,matrix), typ e(W,matrix);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 88 "If you just speci fy the dimensions of the matrix you may treat the entries as variables ." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "H:=matrix(2,2);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "H;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "H=evalm(H);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "with(linalg):\ndet(H);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 86 "To change one of the entries uses an assignment statement as in the f ollowing example:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "H[1,2] :=10000;\nH=evalm(H);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" } }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 7 " tables" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 " " {TEXT -1 28 "We now discuss the datatype " }{TEXT 279 5 "table" } {TEXT -1 36 ". Tables are similar to arrays, but " }{TEXT 284 93 "the \+ indices need not be integers and one need not declare that a variable \+ represents a table." }{TEXT -1 221 " If you make an assignment of the \+ form G[z]:=w, then Maple creates a table with the entry z=w. It is no t necessary to declare that G is a table. Then you may add to this tab le at will. You may also use tables to create " }{TEXT 285 17 "indexe d variables" }{TEXT -1 95 ". In fact indexed variables are the same a s tables. We illustrate by creating a table named G:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "G[z]:=w;\nG[box]:=red;\nfor i from 1 to 5 do G[i]:=\{ 0,i,i+1\}; od;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "G[z]; G[b ox];G[1]; G[2]; G[3];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 76 "As for a rrays and matrices one must use eval to see the contents of a table." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "G;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 84 "If you look carefully at the output of eval(G), you \+ can see what the equations mean." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "eval(G);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "type(G,table);\ntype(G,array);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 12 "Recall that " }{TEXT 407 3 "cat" }{TEXT -1 53 " is the concatenation operator, for example, we have:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "MyName:=cat(E, d,w,'i',n); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 7 "We use " }{TEXT 408 3 "cat" }{TEXT -1 37 " to add some entries to the table G. " }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "for x in \{p,q,r\} do G[x]:= cat(x,stuff); od;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "eval(G) ;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "G[r];\nG[box];" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 39 "Here's how you can get a list of \+ the i" }{TEXT 280 7 "ndices " }{TEXT -1 29 "of a table and a list of t he " }{TEXT 281 7 "entries" }{TEXT -1 84 " in the table. Note that the indices and entries are exhibited as one element lists." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "indices(G);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 11 "entries(G);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 8 "One can " }{TEXT 283 6 "change" }{TEXT -1 25 " the entries in an array:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "G[1]:=G[1] union \{infinity\};" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 8 "One can " }{TEXT 282 6 "delete" }{TEXT -1 54 " indice s and entries as in the following two examples." }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 30 "G[1];\nG[1]:=evaln(G[1]);\nG[1];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "indices(G);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 25 "G[2];\nG[2]:='G[2]';\nG[2];" }}{PARA 0 "" 0 " " {TEXT -1 42 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "indices(G);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 176 "Note that we do not have to declare before hand tha t a variable is going to represent a table. However, we must do so for arrays and matrices: Consider the following examples:\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 29 "type(Z,table), type(Z,array);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "for i from 1 to 2 do\nfor j from 1 to 2 do\nZ [i,j]:=i+j;\nod;\nod;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "ty pe(Z,table), type(Z,array);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "eval(Z);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 57 "But look what happ ens if we first say that Z is an array:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 92 "restart:\nZ:=array(1..2,1..2);\nfor i from 1 to 2 do \nfor j from 1 to 2 do\nZ[i,j]:=i+j;\nod;\nod;" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 44 "type(Z,table),type(Z,array), type(Z,matrix);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "eval(Z);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 21 "1-dimensional arrays " }{TEXT 412 2 "vs" }{TEXT -1 6 " lists" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 54 "(This section was largely copied f rom Robert Israel's " }{TEXT 409 5 "Maple" }{TEXT -1 1 " " }{TEXT 410 7 "Advisor" }{TEXT -1 1 " " }{TEXT 411 20 "Database for Maple 6" } {TEXT -1 98 ".) Maple 6 and 7 allow you to change a list by assignin g a new value to one of its components. " }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "L:=[a,b,c,d,e]; \nL[2]:= B; \nL;" }}}{PARA 0 "" 0 "" {TEXT -1 113 "However, it only works for lists of length 100 or less. Trying it fo r a longer list produces this error message." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "restart:\nL:= [seq(i,i=1..101)]:\nL[2]:= 3;" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 78 "Nevertheless, the same effect can \+ be obtained for a list of any length, using " }{MPLTEXT 0 21 6 "subsop " }{TEXT -1 1 ":" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "L:=subsop(2=3,L );" }{TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 38 "For arrays t he usual assignment works." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 53 "restart:\nL:=array(1..101,[seq(i,i=1..101)]):\nL[2]:=3;" }}}{PARA 0 "" 0 "" {TEXT -1 339 "Assignment to a list is rather inefficient if \+ the list is long, because it requires copying the whole list structure . If you used an array it would be very quick. Nevertheless, if onl y a few of these operations are to be done, it may still be preferable to use lists rather than arrays, because lists can be produced very q uickly using " }{MPLTEXT 0 21 3 "seq" }{TEXT -1 189 ". It takes longe r to set up the array, but as a trade off it is easier to access the e ntries. See Israel's Maple Advisor Database for Maple 6 for some timed experiments to illustrate this." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 38 " functions, tables, \+ type and whattype" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {EXCHG {PARA 0 "" 0 "" {TEXT 286 10 "Functions:" }{TEXT -1 94 " We hav e already seen three ways to make functions from expressions. Here we \+ show another way:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 256 "" 0 " " {TEXT 290 13 "First we can " }{TEXT -1 22 "assign values at will " } {TEXT 291 60 "as follows: We make up a couple of functions called f an d g." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 53 "f(1):=2; f(2):=3; f(3):=1;\ng(1):=2 ; g(2):=1; g(3):=3;" }}}{EXCHG {PARA 257 "" 0 "" {TEXT -1 82 "This exp lains why f(x):=x^2+1; does not define f. Actually it defines the func tion" }}{PARA 0 "" 0 "" {TEXT 298 64 "f at the variable x only, but no t for anything different from x." }{TEXT -1 13 " For example:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "h(x):=x^2+x+1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "h(x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "h(y);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 62 "This ind icates that you have not yet defined h at the value y." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 287 24 " Composition of functions" }{TEXT -1 53 " in Maple is given by @: For e xample, the composition" }}{PARA 0 "" 0 "" {TEXT -1 81 "of f and g as \+ defined above is f@g. Also the composition of f with itself n times" } }{PARA 0 "" 0 "" {TEXT -1 17 "is given by f@@n:" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 19 "(f@g)(1), f(g(1)); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "(f@@3)(1), f(f(f(1)));" }}}{EXCHG {PARA 256 "" 0 " " {TEXT 288 15 "Second, we can " }{TEXT -1 33 "change the value of any function " }{TEXT 289 34 "whether we made it, or it is built" }} {PARA 0 "" 0 "" {TEXT -1 55 "into Maple: (Not something to do lightly. ) For example:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "sin(0):=3 ;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "sin(0);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "restart;\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "sin(0);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 295 9 "f unctions" }{TEXT -1 8 " versus " }{TEXT 296 6 "tables" }{TEXT -1 27 ": \n\nExpression of the form " }{TEXT 297 14 "name(variable)" }{TEXT -1 13 " are of type " }{TEXT 292 8 "function" }{TEXT -1 50 ". On the o ther hand if your execute the statement " }{TEXT 293 22 "name[variable ]:=value;" }{TEXT -1 17 " then Maple give " }{TEXT 342 4 "name" } {TEXT -1 10 " the type " }{TEXT 294 5 "table" }{TEXT -1 2 ". " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 39 "This give s us the peculiar result that " }{TEXT 299 6 "sin(x)" }{TEXT -1 6 " is a " }{TEXT 300 17 "function in Maple" }{TEXT -1 6 ", but " }{TEXT 301 3 "sin" }{TEXT -1 4 " is " }{TEXT 302 23 "not a function in Maple " }{TEXT -1 2 ". " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 303 9 "NOTE WELL" }{TEXT -1 107 ": This usage deviates from the \+ usual mathematical meaning of function. In ordinary mathematics we say that " }{TEXT 304 3 "sin" }{TEXT -1 19 " is a function and " }{TEXT 305 6 "sin(x)" }{TEXT -1 17 " is the value of " }{TEXT 306 3 "sin" } {TEXT -1 14 " at the value " }{TEXT 307 1 "x" }{TEXT -1 372 ". In cert ain constructions, for example when solving recurrences and differenti al equations one is required to use the Maple notion of a function. Th e reason is that in these cases Maple needs to know what the independe nt variable is.\n\nTo make matters even more confusing some computer l anguages refer to what Maple calls a procedure by the name function. \+ \n\nSo to repeat: " }{TEXT 413 10 "procedures" }{TEXT -1 14 " in Maple are " }{TEXT 414 9 "functions" }{TEXT -1 65 " in the usual mathematic al sense of the word, but NOT as a Maple " }{TEXT 415 4 "type" }{TEXT -1 60 ". The following examples may help to clarify this confusion:" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "restart;\ntype(f(x),functi on);\n\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "type(sin,functi on);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "type(sin(x),functio n);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "type(sin,procedure); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "type(g,table);\ng[x]:=y ;\ntype(g,table);" }}{PARA 11 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 343 8 "whattype" }{TEXT -1 89 " will give the type, but \+ sometimes one needs to use eval first, as in the examples below:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "whattype(sin);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "whattype(eval(sin));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "g[3]:=3: \nwhattype(g);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "whattype(eval(g));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "whattype(f(x));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "whattype(.34);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 14 "whattype(3/4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "whattype(-3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "whattype(3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "typ e(3,posint);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "whattype((x +z)*(y+3));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "whattype(x^2 );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 50 "To see the enormous number \+ of Maple types execute:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "? type" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 35 " Introduction to the linalg package" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 60 "There are \+ lots of things one can do with matrices after the " }{TEXT 356 6 "lina lg" }{TEXT -1 21 " package is loaded as" }}{PARA 0 "" 0 "" {TEXT -1 73 "we did above. If the matrices are not too big maple will easily c ompute " }{TEXT 360 12 "determinants" }{TEXT -1 1 "," }}{PARA 0 "" 0 " " {TEXT -1 5 "find " }{TEXT 357 11 "eigenvalues" }{TEXT -1 2 ", " } {TEXT 358 12 "eigenvectors" }{TEXT -1 2 ", " }{TEXT 359 22 "Jordan Can onical Forms" }{TEXT -1 227 ", etc.... Here are a few simple examples: \n\nNote that unless the matrices contain decimal points (floating poi nt numbers) the computations will be exact when possible. For fast flo ating point computations for large matrices the " }{TEXT 416 13 "Linea rAlgebra" }{TEXT -1 60 " package is recommended. Here we concentrate o n the package " }{TEXT 417 6 "linalg" }{TEXT -1 1 "." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 46 "M:=randmatrix(2,2);\nA:=matrix([[2,3],[0,5]]);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "B:=randmatrix(2,2);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "multiply(A,B);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "inverse(A);\n" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 8 "det(A);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "eigenvalues(A); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "EV: =eigenvectors(A);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 332 "Not that EV is a sequence consisting of two list, EV[1] and EV[2]. The first ele ment is the eigenvalue, the second element is the multiplicity of the \+ eigenvalue and the third element is a set whose elements (in this exam ple a single element) are the linearly independent eigenvectors for th at eigenvalue. We illustrate as follows:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 40 "EV[1];\nEV[1][1];\nEV[1][3];\nop(EV[1][3]);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "EV[2];\nEV[2][1];\nEV[2][3]; \nop(EV[2][3]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 31 "We can extract the eigenvalues " }{XPPEDIT 18 0 "lambda[1];" "6#&%'lambdaG6#\"\"\"" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "lambda[2];" "6#&%'lambdaG6#\"\"#" }{TEXT -1 33 " with corresponding eigenvectors " }{XPPEDIT 18 0 "v[1]; " "6#&%\"vG6#\"\"\"" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "v[2];" "6#&% \"vG6#\"\"#" }{TEXT -1 12 " as follows:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "for i from \+ 1 to 2 do\nlambda[i]:=EV[i][1];\nv[i]:=op(EV[i][3]);\nod;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 18 "We now check that " }{XPPEDIT 18 0 "A*v[i ] = lambda[i]*v[i];" "6#/*&%\"AG\"\"\"&%\"vG6#%\"iGF&*&&%'lambdaG6#F*F &&F(6#F*F&" }{TEXT -1 39 " for i = 1, 2: Note that Maple treats " } {XPPEDIT 18 0 "v[i];" "6#&%\"vG6#%\"iG" }{TEXT -1 67 " as a column vec tor for purposes of multiplication by the matrix A." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "multiply(A,v[1]); \nscalarmul(v[1],lambda [1]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 26 "Now let's check for i = \+ 2:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "multiply(A,v[2]); \ns calarmul(v[2],lambda[2]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 9 " vectors " }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 2 "A " }{TEXT 320 7 "vector " }{TEXT -1 10 "is just a " }{TEXT 395 45 "1-dimensional array with index beginning at 1" }{TEXT -1 36 ". It may be formed with the \+ command " }{TEXT 323 15 "vector(list) , " }{TEXT -1 12 "the command " }{TEXT 321 11 "array(list)" }{TEXT -1 17 ", or the command " }{TEXT 322 26 "array(1..n,list). Vectors" }{TEXT -1 73 " have some seemingly strange properties. When printed out they look like " }{TEXT 324 4 "l ist" }{TEXT -1 4 " or " }{TEXT 325 8 "matrices" }{TEXT -1 265 ", but t hey behave differently in some cases. Maple treats them as column vect ors for many purposes. I suggest avoiding them except when necessary i n linear algebra problems. We will spend more time on linear algebra l ater. The following may clear this up somewhat." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "L:=[1,2,3]; " }{TEXT -1 47 "this is a list, not a vector, matr ix or array\n\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "v1:=vect or([1,2,3]); " }{TEXT -1 55 "this is a vector and an array but not a l ist or matrix " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "v2:=array ([1,2,3]); " }{TEXT -1 54 "this is a vector and an array but not a li st or matrix" }{MPLTEXT 1 0 2 "\n\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "A:=array([[1,2,3]]); " }{TEXT -1 73 "this is an array and a 1 by 3 matrix, but is not a list and not a vector," }{MPLTEXT 1 0 1 "\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "M:=matrix([[1, 2,3]]);" }{TEXT -1 76 " this is an arrary and a 1 by 3 matrix but is n ot a list and not a vector.\n\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 191 "Note that the 1 by 3 matrices look different from vectors and lis ts when printed out. On the other hand one cannot distinguish lists fr om vectors when they are printed. Execute the following:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "A[1];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 70 "The matrices are 1 by 3 and so we need 2 indices to speci fy elements. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "A[1,1],A[1 ,2],A[1,3];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 33 " Multiplying a vector by a matrix" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 355 "Recall that if A is an n by k mat rix and B is an m by t matrix then the product AB is defined if and on ly if k = m. Maple uses this same rule. However if A is an n by k matr ix and v is a vector of length k then Maple computes the product as i f v was a k by 1 matrix -- even though when printed v looks more like \+ a 1 by k matrix. Here are some examples: " }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "restart:\nwith(lin alg):\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "A:=matrix([[1,1, 1], [1,0,0]]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "B:=matrix ([[1,2,3],[2,3,4],[3,4,5]]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "multiply(A,B);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "mul tiply(B,A);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "v:=vector([1 ,2,3]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "evalm(v + v), ev alm(x*v);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 68 "Compute Av by hand f irst and see if you can predict the next output." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "multiply(A,v);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 98 "Lists are also sometimes treated like vectors. But note t hat a matrix times a list gives a vector." }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 11 "L:=[1,2,3];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "L2:=multiply(A,L);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "type(L2,list);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "type( L,list);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "type(L2,vector) ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 49 "But we can convert L2 to a l ist with the command:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "L3 :=convert(L2,list);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 298 "But in so me respects lists and vectors are not interchangeable. For example, on e can plot a list of length two as a point, but a vector of length 2 w ill not be accepted by the plot command. Consider the following attemp t to plot the vector L2. But after converting it to the list L3 we can plot it." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "plot([L2], sty le = point, symbol=circle);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "plot([L3],style = point, symbol = circle);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 40 " Ass ignment 5 Due Wednesday, February 27" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 329 10 "Problem 1." }{TEXT -1 48 " Generate 10 random 3 by 3 matrices using the " }{TEXT 361 10 "r andmatrix" }{TEXT -1 18 " command from the " }{TEXT 362 6 "linalg" } {TEXT -1 42 " package. As each matrix is generated use " }{TEXT 363 11 "eigenvalues" }{TEXT -1 159 " to compute its eigenvalues. Then tak e the product of the eigenvalues and check that for each matrix this p roduct is equal to the determinant of the matrix. " }{TEXT 366 6 "Hin t: " }{TEXT -1 79 "The product will be complicated algebraically and y ou will need to apply first " }{TEXT 364 6 "expand" }{TEXT -1 7 ", the n " }{TEXT 365 8 "simplify" }{TEXT -1 133 " to reduce the product of t he eigenvalues to an integer.\nFirst try to do for a single matrix , t hen make a loop to do it 10 times. \n" }{TEXT 326 10 "\nProblem 2" } {TEXT -1 59 ". There is a one-to-one correspondence between subsets o f " }{TEXT 374 17 "\{1, 2, . . . , n\}" }{TEXT -1 28 " and binary list s of length " }{TEXT 381 1 "n" }{TEXT -1 17 ", that is, lists " } {TEXT 378 3 "L =" }{TEXT -1 1 " " }{TEXT 375 22 "[x1, x2 , . . . , xn] " }{TEXT -1 6 "where " }{TEXT 376 18 "x1, x2, . . . , xn" }{TEXT -1 25 " are elements of the set " }{TEXT 377 5 "\{0,1\}" }{TEXT -1 57 ". \+ The correspondence is given by associating to the set " }{TEXT 396 1 "S" }{TEXT -1 10 " the list " }{TEXT 380 1 "L" }{TEXT -1 7 " where " } {TEXT 379 35 "xi = 1 if i is in S and 0 if not. \n" }{TEXT -1 23 "\n(a ) Write a procedure " }{TEXT 346 12 "list_to_set " }{TEXT -1 79 "whose input is a binary list and whose output is the corresponding set. E. \+ g., " }{TEXT 418 24 "list_to_set([1,0,1,0,1])" }{TEXT -1 21 " will ret urn the set " }{TEXT 419 7 "\{1,3,5\}" }{TEXT -1 44 ". Note that nops( L) is the length of a list." }}{PARA 0 "" 0 "" {TEXT -1 23 "\n(b) Writ e a procedure " }{TEXT 347 11 "set_to_list" }{TEXT -1 22 " whose input is a pair" }{TEXT 367 4 " S,n" }{TEXT -1 7 " where " }{TEXT 368 1 "S " }{TEXT -1 16 " is a subset of " }{TEXT 369 17 "\{1, 2, . . . , n\}" }{TEXT -1 5 " and " }{TEXT 372 1 "n" }{TEXT -1 69 " is a positive inte ger and whose output is the binary list of length " }{TEXT 371 1 "n" } {TEXT -1 26 " corresponding to the set " }{TEXT 370 1 "S" }{TEXT -1 11 ". \n E. g., " }{TEXT 420 20 "set_to_list(\{1,3\},5)" }{TEXT -1 13 " will return " }{TEXT 421 11 "[1,0,1,0,0]" }{TEXT -1 67 ".\n\n(c) Sh ow by a few tests that each procedure works. Then apply " }{TEXT 348 11 "set_to_list" }{TEXT -1 32 " to each set in the powerset of " } {TEXT 373 12 "\{1, 2, 3, 4\}" }{TEXT -1 170 " to form all binary lists of length 4. Make a program to print out a table of the following for m\n\n [0,0,0,0] <--> \{ \}\n [1,0,0 0] <--> \{ 1 \}\n [0,1,0,0 ] <--> \{ 2 \} " }}{PARA 0 "" 0 "" {TEXT -1 12 " ........" }}{PARA 0 "" 0 "" {TEXT -1 7 " etc" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 108 "Some extra commas in the output is okay. You may obtain the power set of the set \{1,2,...,n\} by the command \+ " }{TEXT 422 12 "powerset(n);" }{TEXT -1 37 " but you must first load \+ the package " }{TEXT 423 9 "combinat." }}{PARA 0 "" 0 "" {TEXT -1 1 " \n" }{TEXT 327 11 "Problem 3." }{TEXT -1 14 " Note that if " }{TEXT 388 1 "n" }{TEXT -1 20 " is an integer then " }{TEXT 382 18 "convert(n ,base, 2)" }{TEXT -1 14 " will convert " }{TEXT 389 1 "n" }{TEXT -1 86 " to a binary list (the binary representation of n in reverse order ). Then you may use " }{TEXT 349 11 "list_to_set" }{TEXT -1 46 " to co nvert this list to a set. Note that if " }{TEXT 390 1 "n" }{TEXT -1 11 " runs from " }{TEXT 391 1 "0" }{TEXT -1 4 " to " }{XPPEDIT 18 0 "2 ^n-1;" "6#,&)\"\"#%\"nG\"\"\"F'!\"\"" }{TEXT -1 6 " then " }{TEXT 353 32 "list_to_set(convert(n,base,2) ) " }{TEXT -1 26 " will give all sub sets of " }{TEXT 383 16 "\{1, 2, . . ., n\}" }{TEXT -1 49 ". \n\n(a) U se this idea to make your own procedure " }{TEXT 352 9 "PowerSet " } {TEXT -1 45 "which will given n, produce the powerset of " }{TEXT 384 17 "\{1, 2, . . . , n\}" }{TEXT -1 89 ". Show by a several example s that your procedure works. For your examples you should get " } {TEXT 424 24 "nops(PowerSet(n)) = 2^(n" }{TEXT -1 72 "). Check that th is is the case.\n \n(b) Use this idea to make a procedure " }{TEXT 351 7 "RandSet" }{TEXT -1 43 " which given n produces a random subset \+ of " }{TEXT 385 17 "\{1, 2, . . . , n\}" }{TEXT -1 7 ". [Use " }{TEXT 397 4 "rand" }{TEXT -1 42 " to produce a random integer in the range \+ " }{TEXT 387 8 "0..2^n-1" }{TEXT -1 37 " and then convert it to a sub set of " }{TEXT 386 17 "\{1, 2, . . . , n\}" }{TEXT -1 1 "." }{TEXT 350 3 "] " }{TEXT 425 31 "Do NOT use PowerSet or powerset" }{TEXT -1 119 ". Show by a examples that it works for small n such as 5, 10, an d 20 as well as for large n such as 100 or even 1000. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 426 6 "Remark" }{TEXT -1 62 ": The powerset of a set with 1000 elements contains more that " } {XPPEDIT 18 0 "10^300;" "6#*$\"#5\"$+$" }{TEXT -1 171 " elements. This is, according to current estimates, more than the number of atoms in \+ the whole universe. So you cannot expect your computer to be able to s tore such a set." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 1 "\n" }{TEXT 328 9 "Problem 4" }{TEXT -1 108 ". Construct an original example of ea ch of the following types of Maple expressions. Check each using both " }{TEXT 344 4 "type" }{TEXT -1 5 " and " }{TEXT 345 10 "whattype. " }{TEXT -1 25 "Note that in the case of " }{TEXT 354 8 "whattype" } {TEXT -1 21 " you may need to use " }{TEXT 355 4 "eval" }{TEXT -1 32 " as illustrated in the lecture. " }}{PARA 256 "" 0 "" {TEXT -1 0 "" }} {PARA 256 "" 0 "" {TEXT -1 8 "list\nset" }}{PARA 256 "" 0 "" {TEXT -1 12 "array\nmatrix" }}{PARA 256 "" 0 "" {TEXT -1 6 "vector" }}{PARA 256 "" 0 "" {TEXT -1 23 "table\ninteger\nprocedure" }}{PARA 256 "" 0 " " {TEXT -1 8 "function" }}{PARA 256 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 " " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 2 "\n\n" }}}}{MARK "4" 0 }{VIEWOPTS 0 0 0 1 1 1803 1 1 1 1 } {PAGENUMBERS 1 1 2 33 1 1 }