{VERSION 3 0 "IBM INTEL NT" "3.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "" -1 256 "" 0 1 255 0 255 1 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 257 "" 0 1 255 0 255 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 255 0 255 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 } {PSTYLE "" 0 256 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 0 1 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 257 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 0 1 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 } {PSTYLE "" 0 258 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 0 1 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT 256 34 "Mth 341 Linear Algebra \+ Spring 2000" }}{PARA 257 "" 0 "" {TEXT 257 24 "MLC Computer Lab Visit \+ 1" }}{PARA 258 "" 0 "" {TEXT 258 13 "Bent Petersen" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 259 5 "Login" }}{PARA 0 "" 0 "" {TEXT -1 181 "Press the Ctrl-Alt-Delete keys simultaneously. You shoul d get a login prompt. Enter your ORST user name and press the Tab key. Then enter your ORST password and press the Enter key." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 260 14 "Personal Files" }} {PARA 0 "" 0 "" {TEXT -1 176 "Make sure you save your work on the Z: d rive. This drive is actually your personal space on the lab server and will be available if you log in later on a different workstation." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 261 17 "Start Ap plication" }}{PARA 0 "" 0 "" {TEXT -1 277 "To start Maple (or Matlab, \+ or Mathematica, ... ) select the Start button (lower left corner of th e screen), then Programs from the menu, etc. Alternately, if you use t he browser, Internet Explorer or Netscape, to download a Maple Workshe et it will offer to start Maple for you." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 262 6 "Logout" }}{PARA 0 "" 0 "" {TEXT -1 363 "When you are done with your session, you must logout. One way \+ to do it is to press Ctrl-Alt-Delete. A menu will appear. Select Logof f. If you do not logout you leave your account open for the next perso n to come along. That person will have access to your personal files o n the ORST server. Do not forget to logout, even if you are just leavi ng for a short while!" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 263 13 "The Worksheet" }}{PARA 0 "" 0 "" {TEXT -1 230 "In the live version of this worksheet I have removed all of the Maple output . If you press the Enter key over each Maple command below (in order) \+ you will see Maple's responses appear. Fell free to modify anything as you go along!" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 374 "Sometimes it is desirable to be able to restart more or \+ less cleanly. If we begin the worksheet with a restart command, then w e can just re-execute the whole worksheet in order to clean up a mess \+ and do everything in sequential order. This is a useful trick, but it \+ is not a good idea if your worksheet contains some very length calcula tions (which you do not want to redo)." }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 428 "We will \+ be doing some linear algebra, so we load the linear algebra library, l inalg. This library defines some of the commands and data structures t hat we will use. When we load a library it announces all of the comman ds that it defines. We can suppress this output by using a colon, in p lace of the usual command-terminanting semicolon. Here I used a semico lon so you can see the list of commands defined by the linalg library. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 196 "Matrices can be entered by listing t heir rows (lists are denoted by [ ] in Maple) or by giving the size an d then listing the entries in the matrix row-wise. Here I enter the ma trix A in both ways." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "A:=matrix([[1,2,3,4],[0,-1,3,4],[2,-1,2,3 ]]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "A:=matrix(3,4,[1,2, 3,4,0,-1,3,4,2,-1,2,3]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 152 "Personally I prefer the second method fo r interactive entry. It is also possible to build a matrix by specifyi ng its columns (as vectors or lists). Thus" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 61 "a[1]:=[1,0,2]; a[ 2]:=[2,-1,-1]; a[3]:=[3,3,2]; a[4]:=[4,4,3];" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 51 "Now we use the augment \+ command to build the matrix:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "A:=augment(a[1],a[2],a[3],a[ 4]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 130 "Alternately we can build the matrix by entering its rows and t hen stacking them on top of each other with the stackmatrix command." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "b[1]:=[1,2,3,4]; b[2]:=[0,-1,3,4]; b[3]:=[2,-1,2,3];" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "A:=stackmatrix(b[1],b[2],b[3 ]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 187 "There is also a command called entermatrix which may be used t o build a matrix. It is a special purpose command though and not very \+ convenient unless you enjoy typing numerous semicolons." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 50 "Diagonal matrices ca n be entered in a natural way." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "diag(1,2,3,4);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 89 "The diag \+ command gives you a simple way to define your own n by n identity matr ix, IE(n):" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 27 "IE:=n->diag(seq(1,k=1..n));" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 6 "IE(2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "IE(3);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 122 "It would have been more natural to use I for the ide ntity matrix, but Maple uses that for the square root of minus one. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 138 "Maple \+ has a built-in command, rref, for computing the row reduced echelon f orm of a matrix. For example, for the matrix A above we have" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "rref(A);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 152 "Note we still have A available. Ordinarily in Maple a n expression may be evaluated (or the value recalled) by entering the \+ name followed by a semicolon." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "A;" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 238 "As we see, Maple makes an exception for matrices. The reason is they can be quite large and \+ you may not wish to waste time displaying them, nor to clutter up your worksheet. You can always use the evalm function to force matrix eval uation" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "evalm(A);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 106 "Now suppose we want to row reduce A ou rselves. We'd want to add -2 times the first row to the third row:" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "A1:=addrow(A,1,3,-2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 469 "Note I assigned the result to A1 so I w ould be able to refer to it in the next step. An alternative approach \+ is to use the ditto operator, %, but it is risky to use except within \+ the same line, because it refers to the previous expression evaluated, which may not be the previous expression on your worksheet if you hav e done a lot of editing. Here's an example of using the % operator. I \+ stack up two commands on one line, so I will not have to worry what % \+ points to." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 39 "addrow(A1,2,1,2); A2:=addrow(%,2,3,-5);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "mulrow(A2,2,-1); A3:=mulrow(%,3,-1/ 19);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "addrow(A3,3,1,-9); \+ A4:=addrow(%,3,2,3);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 120 "We did not have to swap any rows here, but the command for that is swaprow. Here is an example using again our matri x A." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "swaprow(A,1,3);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 64 "Consider now a system of the form \+ Ax=b, using again or matrix A." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "b:=[2,7,-5];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "soln:=linsolve(A,b);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 239 "Maple re turns a list of values. The underscore t sub 1 is a parameter. You ass ign it arbitrary values to obtain all the solutions. If you find the e xpression difficult to read you can always substitute something more a greeable, for example" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "soln:=linsolve(A,b,rnk,s);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 182 "N ote the parameter name has to appear as the fourth variable, so we had to insert a third variable, rnk. It turns out that linsolve stuffs th e rank of A into the third variable. Thus" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 4 "rnk;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 49 "One can pick out the individual component s easily" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "soln[1]; soln[2]; soln[3]; soln[4];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 55 "We can also sol ve directly by row reduction of course -" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "M:=augment(A,b); R:= rref(M);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 216 "Here we can read the solution easily. Moreover, we get t he canonical form of the solution, with the free variable as the param eter. This is not the form that Maple returned above (though it is equ ivalent, of course)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "for k from 1 to 3 do x[k]:=R[k,5]-R[k,4]* s; od; x[4]:=s;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 135 "For more complicated situations this could get out \+ of hand and linsolve may be preferable, even if it returns a non-canon ical solution." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 143 "Note we do not have to use linsolve to find the rank of \+ a matrix. Maple has a command called rank. Let's generate a random mat rix to illustrate" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 19 "B:=randmatrix(5,7);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "rank(B);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 124 "Actually, it turns out that for a 5 \+ by 7 random matrix the probability of rank 5 is 1. In other words, it \+ is nearly certain!" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 24 "Consider now the vectors" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "u:=[2,1,-3,1]; v:=[-1,3,5,0]; w:=[2,-1,1,-3]; b:=[-16 ,17,37,3];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 242 "We wish to write b as a linear combination of u, v, w if possible. First we form the matrix with columns u, v and w. Then we s olve the system of linear equations with this matrix as the coefficien t matrix and with b as the inhomogeneous term." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "B:=augment( u,v,w); linsolve(B,b);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 82 "We see b = -3u + 6v -2w. What happens if there is no solution? Here's an example:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "C:=matrix(2,2,[1,1,1 ,1]); b:=[1,2];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "linsolve (C,b);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "rref(augment(C,b) );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 61 "There is no solution and therefore Maple returns no response." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 253 "We hav e discussed matrix multiplicatio a little bit in class already. In Map le the notation for matrix multiplication is &*. It looks strange, bu t the ampersand warns Maple's symbolic simplification routines that th is multiplication is non-commutative." }}{PARA 0 "" 0 "" {TEXT -1 22 " Here's a few examples:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "A:=randmatrix(3,3); B:=randmatrix(3 ,3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "evalm(A &* B); eval m(B &* A);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 236 "Notice I had to force Maple to evaluate these expression s. The default behavior is to return the product unevaluated. This is \+ very useful behavior in some cases where intermediate results are inco nveniently large or not actually needed." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 27 "Consider now three vectors:" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "c1:=vector([1,2,3]); c2:=vector([0,1,4]); c3:=vector([1,3,7]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 83 "Are they linearly independent? We row reduce the matrix with columns \+ c1, c2 and c3." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 30 "C:=augment(c1,c2,c3); rref(C);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 215 "Since C \+ has only 2 pivotal columns the vectors c1, c2 and c3 are linearly depe ndent. Suppose we want to solve the system Cx=b. We know that there wi ll be a compatability condition on b. Let's try it with b symbolic." } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "b:=vector([b1,b2,b3]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "linsolve(C,b);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 62 "No response! Wise, but not useful. Let's try an other approach." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 19 "rref(augment(C,b));" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 327 "That's strange. This r esult implies no solutions at all, yet there certainly is a solution i f b = 0 for example. The problem is that Maple simplifies expressions \+ such as z/z to 1 when z is symbolic. Thus Maple's answer is actually c orrect in the sense that there is no solution which is a rational expr ession in b1, b2 and b3. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 210 "One way out of the impasse is to note tht we can \+ keep track of the coefficients of b1, b2 and b3 during row reduction b y keeping them in separate columns. Thus we augment C by an identity m atrix and row reduce." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "augment(C,IE(3)); R:=rref(%);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 133 "T here is no pivot in the first 3 columns in the last row, so the remain ing part of the last row yields a compatability condition on b" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "evalm(submatrix(R,3..3,4..6) &* b) = 0;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 190 "Now we can read of th e solutions easily. At this point you know enough about Maple to check your answers to all of the homework problems for the material covered so far in class. Try it out!" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 271 "One comment - Maple commands are pol ymorphic. Their behavior depends on the number and type of parameters \+ that you feed to them. Thus even though lists and vectors are differen t data types in Maple, the linear algebra routines for the most part d o not care which you use." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " > " 0 "" {MPLTEXT 1 0 55 "a:=[1,2,3]; b:=vector([1,2,3]); c:=matrix(1, 3,[1,2,3]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 61 "type(a,vecto r); type(a,list); type(a, array); type(a,matrix);" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 60 "type(b,vector); type(b,list); type(b,array); type(b,matrix);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "type(c, vector); type(c,list); type(c,array); type(c,matrix);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 131 "If you g et really mysterious results try thinking hard about your data types. \+ Sometimes a lack of clarity in thought will bite you!" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 118 "Another thing to watc h out for is 0. When Maple multiplies a symbolic expression by 0 the r esult is 0. But which zero?" }}{PARA 0 "" 0 "" {TEXT -1 1 " " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "0*p;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 45 "This behavior can cause problems. For example" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "N:=matrix(2 ,2,[1,2,3,4]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "0*N; eval m(3*N);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 180 "Ouch! Our 2 by 2 matrix became a scalar when we multipli ed by 0. Some very strange error messages could result later! Here the solution is to use the scalar multiplication function" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "scalar mul(N,0); scalarmul(N,3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 278 "Of course, it is rare for people to be so careful all the time. T he key is to think about your results, to understand what is going on \+ and to add the right level of precision to guarantee your results. Eve n with computer algebra systems there is no substitute for understandi ng." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 20 "Ha ve fun with Maple!" }}}}{MARK "79 3 0" 102 }{VIEWOPTS 1 1 0 3 2 1804 }