{VERSION 5 0 "IBM INTEL NT" "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 0 1 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 2 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 2 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 0 2 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 0 2 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 "" 0 1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 0 0 0 0 0 0 }{CSTYLE "" -1 458 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 459 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 460 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 461 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 462 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 466 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 467 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{PSTYLE "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 "Times" 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 379 13 "Ctrl + Delete" }{TEXT -1 24 " (which is the same a s " }{TEXT 298 6 "Delete" }{TEXT -1 1 " " }{TEXT 299 9 "Paragraph" } {TEXT -1 20 " from the pull down " }{TEXT 300 4 "Edit" }{TEXT -1 74 " \+ menu). Then the paragraph where your cursor is located will be deleted . " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 131 "A fter deleting , cutting, or pasting something, if you change your min d before doing anything else, you can go to the top of the " }{TEXT 301 4 "Edit" }{TEXT -1 10 " menu and " }{TEXT 302 4 "undo" }{TEXT -1 30 " the deletion, cut, or paste." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 32 "Also note that if you click the " }{TEXT 380 16 "paragraph symbol" }{TEXT -1 193 " near the right end of the me nu bar it will sometimes help to see what you should delete. This is e specially 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 -1 3 "If " }{TEXT 384 1 "a" }{TEXT -1 5 " and " }{TEXT 385 1 "b" }{TEXT -1 24 " are integers , the call " }{TEXT 289 10 "rand(a..b)" }{TEXT -1 35 " creates a proce dure which produces" }{TEXT 381 1 " " }{TEXT -1 37 "(pseudo) random in tegers in the range" }{TEXT 288 3 " a " }{TEXT 386 2 "to" }{TEXT 387 3 " b." }{TEXT -1 117 " To call the procedure one needs to add extra p arenthesizes as in the following examples. If you don't add the extra \+ " }{TEXT 382 2 "()" }{TEXT -1 7 " after " }{TEXT 383 10 "rand(a..b)" } {TEXT -1 95 " you just get the description of the procedure. We will, \+ as in the custom, call the output of " }{TEXT 352 12 "rand(a..b)()" } {TEXT -1 3 " a " }{TEXT 294 13 "random number" }{TEXT -1 218 ". But st rictly speaking the numbers so produced are not really random. After \+ all, they are generate by a compute program. If you wish to learn mor e about such matters I recommend that you take a look at the book The \+ " }{TEXT 290 27 "Art of Computer Programming" }{TEXT -1 1 " " }{TEXT 291 30 "Vol 2 Seminumerical Algorithms" }{TEXT -1 39 ", by Donald Knut h. See Chapter Three, " }{TEXT 292 14 "Random Numbers" }{TEXT -1 1 ". " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 47 "We no w illustrate the use of the Maple command " }{TEXT 356 4 "rand" } {TEXT -1 48 " to produce pseudo-random integers from 0 to 20:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "rand(0..20)();\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "rand(0..20)();" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 129 "If you want to use this procedure repeatedly you \+ can give it a shorter name. I will use f here. Sometime people use n ames like " }{TEXT 303 4 "dice" }{TEXT -1 4 " or " }{TEXT 304 3 "die" }{TEXT -1 14 " (singular of " }{TEXT 305 4 "dice" }{TEXT -1 3 "), " } {TEXT 308 4 "roll" }{TEXT -1 6 ", or " }{TEXT 306 4 "flip" }{TEXT -1 66 ". But you can use any name you 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 293 4 "f ()" }{TEXT -1 56 " is executed it gives a usually different rando m number." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "for i from 1 t o 4 do print(i,f()); od;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 74 "Or, w e can create a sequence of 50 random numbers from 0 to 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 rand om " }{TEXT 307 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 87 "To get a (pseudo) random number in the interval [0,1] you might us e the following idea:" }}}{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 284 22 "(pseudo) random subset" }{TEXT -1 73 " from the set \{1,2, ...,n\}: F irst we must load the combinatorics package " }{TEXT 357 8 "combinat" }{TEXT -1 67 " using the following command. For more on packages see t he section " }{TEXT 358 8 "Packages" }{TEXT -1 7 " below." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "with(combinat); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 22 "The list of procedure " }{TEXT 390 3 "Chi" } {TEXT -1 2 ", " }{TEXT 391 4 "bell" }{TEXT -1 61 ", etc., are procedur es that are in the combinatorics package " }{TEXT 388 8 "combinat" } {TEXT -1 110 ". You may use ?Chi to see what Chi does. The Warning \+ indicates that Chi had one meaning before the package " }{TEXT 389 8 " combinat" }{TEXT -1 42 " was loaded and now has another meaning. \n" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 25 "Set n = 5 to illustrate. " }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "n:=5; " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 63 "We set S to be the powerset of the set of integers f rom 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 se e how many elements 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 generate random numbers between 1 and nops(S). In this ca se between 1 and 32." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "f:= rand(1..nops(S)):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 310 "\nThere are 2^5 = 32 subsets of \{1,2,3,4,5\}. The set S above contains these 32 \+ sets. The sets in S are the sets S[1], S[2], ..., S[32]. If we use f a s just defined to get a random number i from 1 to 32. Then the corresp onding 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 giv en 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 285 9 "numboccur" }{TEXT -1 5 " and " }{TEXT 377 16 "convert/multiset" }{TEXT -1 150 " can be used to simplify the type of computation made in the last lecture when counti ng the number of times a digit appears in the first n digits 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 tha t " }{TEXT 35 1 "x" }{TEXT -1 13 " is found in " }{TEXT 35 3 "f, " } {TEXT 286 29 "where f may be any expression" }{TEXT 287 2 ". " }{TEXT -1 23 "Here are some examples:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "roll:=rand(1..6):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 156 "We cr eate a list of 100 random numbers from 1 to 6. They may be thought of \+ as the results of 100 rolls of a die (cube with numbers 1 to 6 on the \+ six faces)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "L:=[seq(roll (),i=1..100)]; " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 53 "We get the num ber of 2's in this sequence as follows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "numboccur(L,2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 62 "We get the number of 1's, the number of 2's, etc., as follows:" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 88 "for i from 1 to 6 do\n pri nt(cat(`The number of `, i,`s is `,numboccur(L,i)));\nend do;\n" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 70 "Another example. Here the first ar gument to numboccur is a polynomial." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 61 "p:=x^3+3*x*y+2*x^2 + 5*x + 1;\nnumboccur(p,x);\nnumbo ccur(p,2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 30 "Now we define a 3 b y 3 matrix." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "A:=Matrix([[ 3,3,5],[1,2,3],[1,3,6]]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "numboccur(A,3);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 72 "A nice quick way to count the numb er of occurrences of each symbol in a " }{TEXT 392 4 "list" }{TEXT -1 2 ", " }{TEXT 393 5 "table" }{TEXT -1 4 " or " }{TEXT 394 23 "some typ es of algebraic" }{TEXT -1 1 " " }{TEXT 395 11 "expression " }{TEXT -1 26 " is by use of the command " }{TEXT 378 19 "convert(f,multiset) " }{TEXT -1 291 ". 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 expression), 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 first 100 digits of " }{XPPEDIT 18 0 "pi;" "6#%#piG" }{TEXT -1 3 ". " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 24 "Here 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 "" {MPLTEXT 1 0 30 "convert(x^3*y^5*z^3,multiset);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 80 "Here we count the number of times each digit appears in the first 100 digits 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 "" {TEXT -1 19 "Using this we have:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 144 "for i from 1 to 10 do\nd:=L L[i][1]:\ncount:=LL[i][2]:\nprintf(\"The digit %d appears %2d times in the first 100 digits 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 83 "Executing the f ollowing command loads a lot of procedures for doing linear algebra." }}{PARA 0 "" 0 "" {TEXT -1 1 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "with(LinearAlgebra);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 402 13 "LinearAlgebra" }{TEXT -1 35 " is an ex ample of what is called a " }{TEXT 396 7 "package" }{TEXT -1 126 " in \+ Maple. A package is a collection of commands that must be loaded befo re they can be used. Other examples of packages are " }{TEXT 397 67 "n umtheory, combinat, groups, logic, orthopoly, geometry, finance, " } {TEXT -1 4 "and " }{TEXT 398 6 "plots." }{TEXT -1 1 " " }{TEXT 399 1 " " }{TEXT 400 20 "Execute the command " }{MPLTEXT 1 0 14 "?index,packa ge" }{TEXT 401 4 " to " }{TEXT -1 133 "obtain a list of all available \+ Maple packages. You may click on the name of the package to get a list of procedures in that package. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 148 "To browse the commands in the LinearAlge bra package execute the following command and the scroll down and clic k on any procedure that interests you." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "?LinearAlgebra" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 205 "We will illustrate the use of the LinearAlgebra package in a sect ion later in this lecture. So you may delay exploring it for now. The \+ purpose of this section is just to make you aware of the concept of a \+ " }{TEXT 404 13 "Maple package" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 403 21 "For future refer ence:" }{TEXT -1 177 " For information about writing your own package s, you may execute the following command. But this is not something I \+ would recommend until you have more experience with Maple. " }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "?module/package" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 20 " arrays and matrices" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 97 " In Maple an array is a type of indexed variable. The subscripts each must run thru a specif ied " }{TEXT 353 8 "integers" }{TEXT -1 130 ". Arrays come in differe nt dimensions: 1-dimensional, 2-dimensional, 3-dimensional, etc. Here \+ are examples. Execute each in turn." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 83 "We de fine first a 1-dimensional array A with indices -3, -2, - 1, 0, 1, 2, 3, 4. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "A:=array(-3..4) ;\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 26 "To assign the value 10 to \+ " }{XPPEDIT 18 0 "A[-3];" "6#&%\"AG6#,$\"\"$!\"\"" }{TEXT -1 29 " we u se the following command" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " A[-3]:=5;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 24 "We can assign the va lue " }{XPPEDIT 18 0 "i^2;" "6#*$%\"iG\"\"#" }{TEXT -1 4 " to " } {XPPEDIT 18 0 "A[i];" "6#&%\"AG6#%\"iG" }{TEXT -1 31 " for i from -3 t o 4 as follows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "for i fr om -3 to 4 do \n A[i]:=i^2; \nend 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 "" {MPLTEXT 1 0 6 "A[-4];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 89 "Note that unlike regular variable one cannot see the valu e of A by the following command:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "A;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 61 "Use eval(A) to see the value of the entries of A, as follows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "eval(A);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 66 "You may prefer the following way to see what the array A contai ns:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "seq(A[i],i=-3..4);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 82 "Now we define a 2-dimentional a rray B. Again we must specify the range of indices." }}}{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 85 "for i from -1 to 2 do \n for j fro m 0 to 1 do \n B[i,j]:=i + j*x;\n end do;\nend do;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 66 "Observer the following which is similar t o the 1-dimensional case:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "B;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "eval(B);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 54 "We can see the value of a particular entr y as follows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "B[-1,0]; " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 47 "We can change this by the follo wing assignment:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "B[-1,0] :=110;" }}}{PARA 0 "" 0 "" {TEXT -1 2 "A " }{TEXT 257 6 "matrix" } {TEXT -1 250 " is a 2-dimensional array where the row and column indic es start with 1. One can define matrices directly or convert a 2-dimen sional array into a matrix as in the following command. Recall that B \+ was defined as an array with indices -1..2 and 0..1 . " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "MB:=convert(B,matrix);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 55 "Note that the indices in MB run from 1 to 4 and 1 to 2." }}}{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 125 "Ma ple displays the contents of a matrix in an easier to read form than f or arrays. But note 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 contents 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 "Conside r another example:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "C:=ar ray(1..4,1..2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 76 "for i fr om 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 "" {TEXT -1 111 "We can ask Maple if B is a matrix or an array as follows . Note that all matrices are arrays but not vice versa." }}}{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 116 "There are other ways to form a matrix or array. Consider the foll owing examples. We first construct a list of lists:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "L:=[[1,2],[0,1],[1,2],[4,5]];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 132 "Note that the following all give the sam e result, namely, a 4 by 2 matrix with rows taken from L. Study these \+ assignments carefully." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 84 "X :=array(1..4,1..2, L);\nY:=array(L);\nZ:=matrix(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), type(W,matrix);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 88 "If you just specify 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=eva lm(H);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 77 "By loading the old lina lg package we can find the determinant of this matrix." }}}{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 assi gnment statement as in the following example:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "H[1,2]:=10000;\nH=evalm(H);" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 120 "One could define d-dimensional arrays for d > 2, \+ but they are not much used. Here's an example of a 3-dimensional array :" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 144 "T:=array(1..3,1..4,1. .5):\nfor i from 1 to 3 do\n for j from 1 to 4 do\n for k from 1 to 5 do\n T[i,j,k]:=i+j*x+k*x^2;\n end do:\n end do:\nend do:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "T[3,4,5];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 7 " t ables" }}{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 258 5 "table" }{TEXT -1 36 ". Tables are similar to arrays, but " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 261 32 "the indices need not be integers" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT 406 5 " and " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT 405 56 "one need not declare that a variable rep resents a table." }{TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 220 "If you make an assignment of the form G[ z]:=w, then Maple creates a table with the entry z=w. It is not neces sary to declare that G is a table. Then you may add to this table at w ill. You may also use tables to create " }{TEXT 262 17 "indexed varia bles" }{TEXT -1 193 ". In fact indexed variables are the same as tabl es. We illustrate by creating a table named G. The indices are z, box, cup, 1, 2, 3. The entries are w, coin, wine, and some three element s ets:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 78 "G[z]:=w;\nG[box]:=coin;\nG[cup]:=wi ne;\nfor i from 1 to 3 do G[i]:=\{0,i,i+1\}; od;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "G[z], G[box], G[cup], G[1], G[2], G[3];" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 39 "Here's how you can get a list of \+ the i" }{TEXT 407 7 "ndices " }{TEXT -1 29 "of a table and a list of t he " }{TEXT 408 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 83 "As for arrays and matrices the following does not return the co ntents of the table:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "G;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 84 "If you look carefully at the ou tput 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 "" {TEXT -1 12 "Recall that " }{TEXT 359 3 "cat" }{TEXT -1 146 " i s the concatenation operator, for example, we have (after unassigning \+ i which now has the value of r due to the execution of the above do lo op):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "i:='i':" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "MyName:=cat(E,d,w,i,n); " }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 7 "We use " }{TEXT 360 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 8 "One can " }{TEXT 260 6 "change" }{TEXT -1 52 " the entri es in an table by simply reassigning them:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 28 "G[1]:=G[1] union \{infinity\};" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 8 "One can " }{TEXT 259 6 "delete" }{TEXT -1 54 " indi ces 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 0 "" }}{PARA 0 "" 0 "" {TEXT -1 16 "Note that we do " } {TEXT 409 3 "not" }{TEXT -1 157 " have to declare before hand that a v ariable is going to represent a table. However, we must do so for arra ys 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 "typ e(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 364 2 "vs" }{TEXT -1 6 " lists" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 204 "Here we discuss some differences \+ between lists and 1-dimensional arrays. Of course if we want indices o ther than 1 to some positive integer n we must use arrays or tables. B ut there are other differences." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 54 "(This section was largely copied from Rob ert Israel's " }{TEXT 361 5 "Maple" }{TEXT -1 1 " " }{TEXT 362 7 "Advi sor" }{TEXT -1 1 " " }{TEXT 363 20 "Database for Maple 6" }{TEXT -1 3 ".) " }}{PARA 0 "" 0 "" {TEXT -1 134 "\n Maple 6 , 7 and 8 allow you \+ to change a list by assigning a new value to one of its components pro vided the list is not too long: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "L:=[a,b,c,d,e]; \nL[2]:= Changed; \nL;" }}}{PARA 0 "" 0 "" {TEXT -1 146 "However, it only works for lists of length 100 or less. Trying i t for a longer list produces an error message as we see in the followi ng example." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "restart:\nL:= [seq(i,i=1..101)]:\nL[2]:= Changed;" }}}{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 23 "L:=subsop(2=Changed,L);" }{TEXT -1 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 38 "For arrays the usual assignment wo rks." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "restart:\nL:=array( 1..101,[seq(i,i=1..101)]):\nL[2]:=Changed;" }}}{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 a n array it would be very quick. Nevertheless, if only a few of these operations are to be done, it may still be preferable to use lists ra ther than arrays, because lists can be produced very quickly using " } {MPLTEXT 0 21 3 "seq" }{TEXT -1 189 ". It takes longer to set up the \+ array, but as a trade off it is easier to access the entries. See Isra el'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 wha ttype" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 40 "We have already seen thre e ways to make " }{TEXT 410 9 "functions" }{TEXT -1 44 " from expressi ons. Here we show another way:" }}{PARA 256 "" 0 "" {TEXT 266 13 "Firs t we can " }{TEXT -1 22 "assign values at will " }{TEXT 267 60 "as fol lows: We make up a couple of functions called f and g." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 53 "f(x):=y; f(y):=z; f(z):=x;\ng(x):=y; g(y):=x; g(z): =z;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "f(x),f(y),f(z),g(x), g(y),g(z);" }}}{EXCHG {PARA 257 "" 0 "" {TEXT -1 82 "This explains why f(x):=x^2+1; does not define f. Actually it defines the function" }} {PARA 0 "" 0 "" {TEXT 274 64 "f at the variable x only, but not for an ything 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 61 "This indicates th at we have not yet defined h at the value y." }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 263 24 "Composition of functions" }{TEXT -1 53 " in Maple is given by @: For example, the co mposition" }}{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)(x), f(g(x)); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 52 "Note that we must write (f@g)(x) rather than f@g(x)." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "(f@@3)(x), f(f(f(x)));" }}} {EXCHG {PARA 256 "" 0 "" {TEXT 264 15 "Second, we can " }{TEXT -1 33 " change the value of any function " }{TEXT 265 34 "whether we made it, \+ or it is built" }}{PARA 0 "" 0 "" {TEXT -1 55 "into Maple: (Not someth ing 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 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 271 9 "func tions" }{TEXT -1 8 " versus " }{TEXT 272 6 "tables" }{TEXT -1 27 ": \n \nExpression of the form " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT 273 43 " name(variable)" } {TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 12 "are of type " }{TEXT 268 8 "function" }{TEXT -1 50 ". On \+ the other hand if your execute the statement " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 269 51 " \+ name[variable]:=value;" }{TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 16 "then Maple give " }{TEXT 309 4 "name" }{TEXT -1 10 " the type " }{TEXT 270 5 "table" }{TEXT -1 2 ". \+ " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 39 "This \+ gives us the peculiar result that " }{TEXT 275 6 "sin(x)" }{TEXT -1 12 " is of type " }{TEXT 276 9 "function " }{TEXT 411 8 "in Maple" } {TEXT -1 6 ", but " }{TEXT 277 3 "sin" }{TEXT -1 4 " is " }{TEXT 278 4 "not " }{TEXT 414 8 "of type" }{TEXT 415 11 " function " }{TEXT 412 8 "in Maple" }{TEXT 413 1 "." }{TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 279 9 "NOTE WELL" }{TEXT -1 107 ": This usage deviates from the usual mathematical meaning of function . In ordinary mathematics we say that " }{TEXT 280 3 "sin" }{TEXT -1 19 " is a function and " }{TEXT 281 6 "sin(x)" }{TEXT -1 17 " is the v alue of " }{TEXT 282 3 "sin" }{TEXT -1 4 " at " }{TEXT 283 1 "x" } {TEXT -1 325 ". In certain constructions, for example when solving rec urrences and differential equations, one is required to use the Maple \+ notion of a function. The reason is that in these cases Maple needs to know what the independent variable is.\n\nTo make matters even more c onfusing some computer languages refer to what Maple calls a " }{TEXT 416 9 "procedure" }{TEXT -1 13 " by the name " }{TEXT 417 8 "function " }{TEXT -1 18 ". \n\nSo to repeat: " }{TEXT 365 10 "procedures" } {TEXT -1 14 " in Maple are " }{TEXT 366 9 "functions" }{TEXT -1 65 " i n the usual mathematical sense of the word, but NOT as a Maple " } {TEXT 367 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),function);\n\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "type(sin,function);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "type(sin(x),function);" }}}{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 310 8 "whattype " }{TEXT -1 52 " will give the type, but sometimes one needs to use " }{TEXT 418 4 "eval" }{TEXT -1 33 " 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 31 " Introduction to LinearAlgebra " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 60 "There are lot s of things one can do with matrices after the " }{TEXT 419 13 "Linear Algebra" }{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 easil y compute " }{TEXT 322 12 "determinants" }{TEXT -1 1 "," }}{PARA 0 "" 0 "" {TEXT -1 5 "find " }{TEXT 319 11 "eigenvalues" }{TEXT -1 2 ", " } {TEXT 320 12 "eigenvectors" }{TEXT -1 2 ", " }{TEXT 321 22 "Jordan can onical forms" }{TEXT -1 245 ", 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. In past ver sions of Maple the package linalg was used instead of the package " } {TEXT 420 13 "LinearAlgebra" }{TEXT -1 22 ". However the package " } {TEXT 421 13 "LinearAlgebra" }{TEXT -1 96 " is in many respects better , so I will discuss it exclusively. Most of the commands in the old \+ " }{TEXT 422 6 "linalg" }{TEXT -1 71 " package are written in lower ca se and often abbreviated, for example, " }{TEXT 423 3 "det" }{TEXT -1 2 ", " }{TEXT 424 9 "eigenvals" }{TEXT -1 2 ", " }{TEXT 425 6 "matrix " }{TEXT -1 2 ", " }{TEXT 426 10 "randmatrix" }{TEXT -1 138 ". In con trast, the commands in the newer LinearAlgebra package all begin with \+ capital letters and are spelled out in full, for example: " }{TEXT 427 11 "Determinant" }{TEXT -1 2 ", " }{TEXT 428 11 "Eigenvalues" } {TEXT -1 2 ", " }{TEXT 429 6 "Matrix" }{TEXT -1 2 ", " }{TEXT 430 14 " RandomMatrix. " }{TEXT -1 92 "This has the advantage that you don't ha ve to try to remember the abbreviation. \n\nNote that " }{TEXT 431 8 " matrices" }{TEXT -1 5 " and " }{TEXT 432 6 "arrays" }{TEXT -1 20 " are different from " }{TEXT 433 8 "Matrices" }{TEXT -1 5 " and " }{TEXT 434 6 "Arrays" }{TEXT -1 47 ". They are stored in memory in different \+ ways. " }{TEXT 435 8 "Matrices" }{TEXT -1 5 " and " }{TEXT 436 6 "Arra ys" }{TEXT -1 43 " are generally handled more efficiently by " }{TEXT 437 5 "Maple" }{TEXT -1 1 "." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "with(Linea rAlgebra);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 173 "Execute the follow ing commands. They should be self explanatory. Note that there are sev eral ways to define a Matrix. Here are three ways. Personally I prefer the first way." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 98 "A:=Matri x([[2,3,0],[0,5,3],[0,0,4]]);\nB:=<<2|3|0>, <0|5|3>,<0|0|4>>;\nC:=<<2, 0,0>|<3,5,0>|<0,3,4>>;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 84 "We may \+ obtain matrix products, inverses, sums and scalar-matrix products as f ollows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "A.B;\n" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "A^(-1);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "A^3;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "A+B;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "7*A;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "Determinant(A);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 29 "Recall that if A is a matrix " }{XPPEDIT 18 0 "lambda;" "6#%'la mbdaG" }{TEXT -1 17 " is a scalar and " }{XPPEDIT 18 0 "v;" "6#%\"vG" }{TEXT -1 51 " is a non-zero vector written as a column then if " } {XPPEDIT 18 0 "Av = lambda*v;" "6#/%#AvG*&%'lambdaG\"\"\"%\"vGF'" } {TEXT -1 18 " then we say that " }{XPPEDIT 18 0 "lambda;" "6#%'lambdaG " }{TEXT -1 32 " is an eigenvector belonging to " }{XPPEDIT 18 0 "v;" "6#%\"vG" }{TEXT -1 20 " . For example, if " }{XPPEDIT 18 0 "v;" "6#% \"vG" }{TEXT -1 14 " is defined by" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "v:=<1,1,0>;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 66 "W e see that v is an eigenvector of A corresponding to eigenvalues " } {XPPEDIT 18 0 "lambda = 5;" "6#/%'lambdaG\"\"&" }{TEXT -1 1 "." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "A.v = 5*v;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 70 "We can find all eigenvalues and corresponding e igenvectors as follows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 " Eigenvectors(A); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 167 "This means \+ that the eigenvalues of A are 4, 5 and 2 and that the corresponding ei genvectors are the columns of the second matrix. We can get hold of t hese as follows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "E,V:=Ei genvectors(A);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "for i fro m 1 to 3 do\nlambda[i],v[i]:=E[i],Column(V,i);\nend do;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 138 "Note that to check whether or not two Ma trices A and B or two Vectors v and w are equal we must use Equal(A,B) or Equal(v,w). For example:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "A,B;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "Equal(A,B);" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 50 "Note for example that the follow ing does not work!" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 53 "if A \+ = B then print(true); else print(false); end if;" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 20 "Instead we must use:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 58 "if Equal(A,B) then print(true); else print(false); en d if;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 18 "We now check that " } {XPPEDIT 18 0 "A*v[i] = lambda[i]*v[i];" "6#/*&%\"AG\"\"\"&%\"vG6#%\"i GF&*&&%'lambdaG6#F*F&&F(6#F*F&" }{TEXT -1 39 " for i = 1, 2: Note tha t Maple treats " }{XPPEDIT 18 0 "v[i];" "6#&%\"vG6#%\"iG" }{TEXT -1 67 " as a column vector for purposes of multiplication by the matrix A ." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 61 "for i from 1 to 3 do i ,Equal(A.v[1],lambda[1]*v[1]); end do;\n" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 81 "Here are a fe w more examples of what is possible with the package LinearAlgebra:\n " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "Id,Z:=IdentityMatrix(3),ZeroMatrix(3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "GaussianElimination(A);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "ReducedRowEchelonForm(A);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "JordanForm(A);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "CharacteristicPolynomial(A,x);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "ColumnDimension(A), RowDimen sion(A);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "T:=Matrix([[1,2 ,3],[2,4,6],[7,8,9]]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "C olumnSpace(T);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 67 "The two column \+ vectors here form a basis for the column space of A." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "NullSpace(T);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 99 "The null space of T is of dimension 1 and a basis is give n by the single column vector in this set." }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 8 "Rank(T);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 9 " Vectors " }}{PARA 0 "" 0 "" {TEXT -1 98 "Maple has several data types which seem almost the s ame, but behave somewhat differently, namely, " }{TEXT 440 20 "Vector, vector, list" }{TEXT -1 18 ", (1-dimensional) " }{TEXT 438 5 "array" }{TEXT -1 21 " and (1-dimensional) " }{TEXT 439 5 "Array" }{TEXT -1 55 ". Here we just concentrate on discussing the data type " }{TEXT 441 7 "Vector " }{TEXT -1 24 "and how to convert from " }{TEXT 442 7 " Vector " }{TEXT -1 3 "to " }{TEXT 443 4 "list" }{TEXT -1 10 " and back ." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "restart:\nwith(LinearAl gebra):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "L:=[1,2,3]; " } {TEXT -1 2 "\n\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "type(L, list), type(L,Vector);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "v 1:=Vector([1,2,3]); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "typ e(v1,Vector), type(v1,list);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "v2:=<1,2,3>;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "type( v1,Vector), type(v1,list);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "M:=Matrix([[1],[2],[3]]); " }{TEXT -1 1 "\n" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 47 "type(v1,Vector), type(v1,list), type(M,Matrix) ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 221 "Note that the 1 by 3 Matric es look like Vectors in the output region. But they behave differently . The Matrices need two indices to specify entries, whereas the Vecto rs need only 1 entry. Execute the following examples: " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "v1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "v1[1],v1[2],v1[3];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "M;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "M[1]; " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "M[1,1],M[2,1],M[3,1];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 22 "Viewing Large Matrices" }}{PARA 0 "" 0 "" {TEXT -1 155 "Matrices that exceed the di mensions 10 by 10 are not displayed when defined. There are however, v arious ways to see the Matrix entries. Here's an example:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "M:=RandomMatrix(11,11);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 21 "One way to \"see\" the " }{TEXT 449 6 "Ma trix" }{TEXT -1 23 " is to convert it to a " }{TEXT 450 6 "matrix" } {TEXT -1 82 " which has no such limitations on the size output. Nevert heless it is best to use " }{TEXT 451 8 "Matrices" }{TEXT -1 33 ", sin ce they are more efficient. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "convert(M,matrix);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 37 "Anoth er way is to right click on the " }{TEXT 447 6 "output" }{TEXT -1 67 " of , for example, the following command. Then select the option " } {TEXT 448 6 "Browse" }{TEXT -1 178 ". You will see a color representat ion of the Matrix. If you click and drag down the cursor repeatedly \+ you will eventually see the numbers in the individual cells of the Mat rix." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "RandomMatrix(100,10 0);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 36 " Multiplying a Matrix times a Vector" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 293 "Recall t hat if A is an n by k matrix and B is an m by t matrix then the produc t AB is defined if and only if k = m. Maple uses this same rule. Howev er if A is an n by k matrix and v is a Vector of length k then Maple \+ computes the product as if v was a k by 1 matrix. Here are some exampl es: " }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "A:=RandomMatrix(2,3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "v:=RandomVector(3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "A.v;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 82 "As the ne xt commands show when executed one cannot multiply a Matrix times a li st." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "L:=[1,2,3];\nA.L;" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 51 "But we can convert L to a Vecto r with the command:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "v3:= Vector(L);" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 27 " Plotting Vectors as arrows" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 115 "We will have more t o say about plotting later. But here we discuss briefly how to plot Ve ctors: We plot Vectors as " }{TEXT 446 6 "arrows" }{TEXT -1 110 " from the origin to the point given by the coordinates, as follows. Recall \+ the notation <0,0,1> for a Vector. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "type(<0,0,1>, Vector);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 8 "To plot " }{TEXT 445 7 "Vectors" }{TEXT -1 39 " as arrows \+ we need to load the package " }{TEXT 444 5 "plots" }{TEXT -1 1 ":" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(plots):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 255 "a1 := arrow(<0,0,1>, shape=harpoon , color=red):\na2 := arrow(<0,1,0>, shape=arrow, color=green):\na3 := \+ arrow(<1,0,0>, shape=double_arrow,color=blue):\na4 := arrow(<1,1,1>, s hape=arrow, color=black):\ndisplay(a1, a2, a3, a4, scaling=CONSTRAINED , axes=BOXED);\n" }{TEXT -1 108 "You should reduce the size of the plo t before continuing. Note that it can be rotated after you click on it ." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 35 "(For other ways to plot arrows see " }{MPLTEXT 1 0 16 "?p lottools,arrow" }{TEXT -1 5 " and " }{MPLTEXT 1 0 12 "?plots,arrow" } {TEXT -1 3 " .)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 27 " Assignment 5, Due Tuesday" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} }{EXCHG {PARA 0 "" 0 "" {TEXT 297 10 "Problem 1." }{TEXT -1 48 " Gen erate 10 random 3 by 3 matrices using the " }{TEXT 452 12 "RandomMatri x" }{TEXT -1 19 " command from the " }{TEXT 453 13 "LinearAlgebra" } {TEXT -1 42 " package. As each matrix is generated use " }{TEXT 323 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 326 6 "Hin t: " }{TEXT -1 79 "The product will be complicated algebraically and y ou will need to apply first " }{TEXT 324 6 "expand" }{TEXT -1 7 ", the n " }{TEXT 325 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 295 10 "\nProblem 2" } {TEXT -1 59 ". There is a one-to-one correspondence between subsets o f " }{TEXT 334 17 "\{1, 2, . . . , n\}" }{TEXT -1 28 " and binary list s of length " }{TEXT 341 1 "n" }{TEXT -1 17 ", that is, lists " } {TEXT 338 3 "L =" }{TEXT -1 1 " " }{TEXT 335 22 "[x1, x2 , . . . , xn] " }{TEXT -1 6 "where " }{TEXT 336 18 "x1, x2, . . . , xn" }{TEXT -1 25 " are elements of the set " }{TEXT 337 5 "\{0,1\}" }{TEXT -1 57 ". \+ The correspondence is given by associating to the set " }{TEXT 354 1 "S" }{TEXT -1 10 " the list " }{TEXT 340 1 "L" }{TEXT -1 7 " where " } {TEXT 339 34 "xi = 1 if i is in S and 0 if not. " }{TEXT -1 78 "For ex ample, the set \{1,3,5\} corresponds to the list [1,0,1,0,1,0,0] if n \+ = 7." }}{PARA 0 "" 0 "" {TEXT -1 23 "\n(a) Write a procedure " }{TEXT 311 12 "list_to_set " }{TEXT -1 79 "whose input is a binary list and w hose output is the corresponding set. E. g., " }{TEXT 368 24 "list_to_ set([1,0,1,0,1])" }{TEXT -1 21 " will return the set " }{TEXT 369 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) Write a procedure " }{TEXT 312 11 "set_to_list" }{TEXT -1 22 " whose input is a pair" }{TEXT 327 4 " \+ S,n" }{TEXT -1 7 " where " }{TEXT 328 1 "S" }{TEXT -1 16 " is a subset of " }{TEXT 329 17 "\{1, 2, . . . , n\}" }{TEXT -1 5 " and " }{TEXT 332 1 "n" }{TEXT -1 69 " is a positive integer and whose output is the binary list of length " }{TEXT 331 1 "n" }{TEXT -1 26 " corresponding to the set " }{TEXT 330 1 "S" }{TEXT -1 23 ". E. g., if n = 5 then " }{TEXT 370 22 "set_to_list(\{1,3,5\},5)" }{TEXT -1 13 " will return " }{TEXT 371 11 "[1,0,1,0,0]" }{TEXT -1 67 ".\n\n(c) Show by a few test s that each procedure works. Then apply " }{TEXT 313 11 "set_to_list " }{TEXT -1 32 " to each set in the powerset of " }{TEXT 333 12 "\{1, \+ 2, 3, 4\}" }{TEXT -1 231 " to form all binary lists of length 4. Make \+ a program to print out a table of the following form. (But the order n eed not be the same as that started below.)\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 " et c" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 108 "Som e extra commas in the output is okay. You may obtain the power set of \+ the set \{1,2,...,n\} by the command " }{TEXT 372 12 "powerset(n);" } {TEXT -1 37 " but you must first load the package " }{TEXT 373 9 "comb inat." }}{PARA 0 "" 0 "" {TEXT -1 1 "\n" }{TEXT 296 11 "Problem 3." } {TEXT -1 14 " Note that if " }{TEXT 462 1 "i" }{TEXT -1 20 " is an int eger then " }{TEXT 342 18 "convert(i,base, 2)" }{TEXT -1 14 " will con vert " }{TEXT 466 2 "i " }{TEXT -1 47 "to a binary list (the binary re presentation of " }{TEXT 467 1 "i" }{TEXT -1 37 " in reverse order). T hen you may use " }{TEXT 314 11 "list_to_set" }{TEXT -1 46 " to conver t this list to a set. Note that if " }{TEXT 461 1 "i" }{TEXT -1 11 " \+ runs from " }{TEXT 351 1 "0" }{TEXT -1 4 " to " }{XPPEDIT 454 0 "2^n-1 ;" "6#,&)\"\"#%\"nG\"\"\"F'!\"\"" }{TEXT -1 6 " then " }{TEXT 318 32 " list_to_set(convert(i,base,2) ) " }{TEXT -1 33 " will run through all \+ subsets of " }{TEXT 343 16 "\{1, 2, . . ., n\}" }{TEXT -1 49 ". \n\n(a ) Use this idea to make your own procedure " }{TEXT 317 9 "PowerSet " }{TEXT -1 17 "which will given " }{TEXT 455 1 "n" }{TEXT -1 27 ", pro duce the powerset of " }{TEXT 344 17 "\{1, 2, . . . , n\}" }{TEXT -1 89 ". Show by a several examples that your procedure works. For your e xamples you should get " }{TEXT 374 24 "nops(PowerSet(n)) = 2^(n" } {TEXT -1 72 "). Check that this is the case.\n \n(b) Use this idea to \+ make a procedure " }{TEXT 316 7 "RandSet" }{TEXT -1 43 " which given n produces a random subset of " }{TEXT 345 17 "\{1, 2, . . . , n\}" } {TEXT -1 7 ". [Use " }{TEXT 355 4 "rand" }{TEXT -1 42 " to produce a r andom integer in the range " }{TEXT 347 8 "0..2^n-1" }{TEXT -1 37 " a nd then convert it to a subset of " }{TEXT 346 17 "\{1, 2, . . . , n\} " }{TEXT -1 1 "." }{TEXT 315 3 "] " }{TEXT 375 31 "Do NOT use PowerSe t or powerset" }{TEXT -1 244 ". Show by a examples that it works for s mall n such as 5, 10, and 20 as well as for large n such as 100. It \+ will even work for n = 1000, but the output will be rather large. On a verage a random subset of \{1,2,...,n\} will contain n/2 elements." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 376 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 173 " elemen ts. This is, according to current estimates, more than the number of a toms in the whole universe. So you cannot expect your computer to be a ble to store such a set.\n\n" }{TEXT 456 9 "Problem 4" }{TEXT -1 108 " . Construct an original example of each of the following types of Mapl e expressions. Check each using both " }{TEXT 457 4 "type" }{TEXT -1 5 " and " }{TEXT 458 10 "whattype. " }{TEXT -1 25 "Note that in the ca se of " }{TEXT 459 8 "whattype" }{TEXT -1 21 " you may need to use " } {TEXT 460 4 "eval" }{TEXT -1 151 " as illustrated in the lecture. To s eparate the examples make a line using dashes like the following (in t ext mode) between the examples for each type." }}{PARA 0 "" 0 "" {TEXT -1 70 "--------------------------------------------------------- -------------" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 256 "" 0 "" {TEXT -1 8 "list\nset" }}{PARA 256 "" 0 "" {TEXT -1 19 "array\nmatrix \nMatrix" }}{PARA 256 "" 0 "" {TEXT -1 6 "Vector" }}{PARA 256 "" 0 "" {TEXT -1 23 "table\ninteger\nprocedure" }}{PARA 256 "" 0 "" {TEXT -1 8 "function" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{MARK "15" 0 }{VIEWOPTS 0 0 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 1 1 2 33 1 1 }