{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 "" -1 256 "Symbol" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE " " -1 257 "Symbol" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 " Symbol" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 259 "Symbol" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 260 "Symbol" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 261 "Symbol" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 262 "" 1 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }1 0 0 0 6 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 2" 3 4 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 0 0 -1 4 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Headi ng 3" 3 5 1 {CSTYLE "" -1 -1 "" 1 12 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }1 0 0 -1 0 0 0 0 0 0 0 0 -1 0 }{PSTYLE "List Item" 0 14 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }0 0 0 -12 3 3 0 0 0 0 0 0 14 5 }{PSTYLE "Title" 0 18 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }{PSTYLE "Exercise" 0 256 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }0 0 0 -12 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 257 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 18 "" 0 "" {TEXT -1 0 "" }{TEXT 262 24 "Linear Al gebra Powertool" }}{PARA 18 "" 0 "" {TEXT -1 33 "Working with and plot ting vectors" }}{PARA 4 "" 0 "" {TEXT -1 11 "On Line 1.2" }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 60 "Worksheet by Micha el K. May, S.J., revised by Russell Blyth." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "restart: with(lin alg): with(plots): with(plottools):" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 7 "Outline" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 92 "This worksheet wo rks through the problems covered in the On Line 1.2 section, pages 28 \+ - 31." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 25 " The basic objectives are:" }}{PARA 14 "" 0 "" {TEXT -1 140 "1) Learn \+ the basic mechanics of entering vectors as lists, and producing linear combinations with either addition or scalar multiplication." }}{PARA 14 "" 0 "" {TEXT -1 38 "2) Learn to plot a set of vectors in " } {XPPEDIT 18 0 "R^2" "6#*$%\"RG\"\"#" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "R^3" "6#*$%\"RG\"\"$" }{TEXT -1 1 "." }}{PARA 14 "" 0 "" {TEXT -1 105 "3) Using a random number generator, see what typical linear comb inations of a pair of vectors look like." }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 11 "Vectors in " }{XPPEDIT 18 0 "R^2" "6#*$%\"RG\"\"#" } {TEXT -1 5 " and " }{XPPEDIT 18 0 "R^3" "6#*$%\"RG\"\"$" }{TEXT -1 1 " :" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 37 "The easiest way to enter a ve ctor in " }{XPPEDIT 18 0 "R^2" "6#*$%\"RG\"\"#" }{TEXT -1 5 " and " } {XPPEDIT 18 0 "R^3" "6#*$%\"RG\"\"$" }{TEXT -1 109 " is as a list. In Maple you separate the coordinates with commas and surround the list \+ with square brackets." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "v1 := [1, 1]; v2 := [1, 3];\nw1 := \+ [1, 1, 1]; w2 := [-1, 3, 2];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 115 " When vectors are entered this way we use normal mathematics notation t o add two vectors or to multiply by a scalar." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "2*v1; v1+v2 ; 2*w1+3*w2;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 72 "Notice that vecto rs need to have the same length before we can add them:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "v1 + w1 ;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 259 "We can also enter vectors i n Maple with the vector command, which is part of the linalg package. \+ When we have used the vector command to enter the vectors, we need to use the evalm (for evaluate matrix) command to see the coordinates of a linear combination." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 83 "a1 := vector([1,1]); a2 := vector([ 1,3]);\na1 + a2; 3*a1;\nevalm(a1+a2); evalm(3*a1);" }}}{EXCHG {PARA 5 "" 0 "" {TEXT -1 0 "" }}{PARA 5 "" 0 "" {TEXT -1 10 "Exercises:" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 305 "1) Use the first 4 digits of your student id number to create tw o vectors, u1 and u2. Use Maple to compute the linear combination 2*u1 + 3*u2. (Be sure to label answers to all exercises. You can either \+ add a comment like \"The answer is ...\" to the Maple worksheet, or wr ite a comment on your printout.)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 115 "2) Pick s ix integers from -10 to 10 (repetitions are allowed) to create two dis tinct nonzero vectors z1 and z2 in " }{XPPEDIT 18 0 "R^3" "6#*$%\"RG\" \"$" }{TEXT -1 66 ". Use Maple to compute 1.0*z1 + 2.0*z2. Compare t his to z1+2*z2." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}} {SECT 1 {PARA 3 "" 0 "" {TEXT -1 24 "Plotting lists of Points" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 100 "We plot points representing vecto rs with the command pointplot, which is part of the plot package. " } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "pointplot(\{v1,v2\});\npointplot([a1,a2]);" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 365 "Notice that we ca n plot either a set of points (sets are enclosed in curly braces and a re unordered) or a list of points (lists are ordered and enclosed in s quare brackets). When plotting a list of points, you may want to use \+ the view option to specify the viewing window of the plot. For the two plots above, letting x and y both range from -5 to 5 is convenient." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 111 "pointplot(\{v1+v2,v2-2*v1\},view = [-5..5,-5..5]);\npointplot (\{evalm(a1-2*a2),evalm(a1+a2)\},view = [-5..5,-5..5]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 22 "If the ve ctors are in " }{XPPEDIT 18 0 "R^3" "6#*$%\"RG\"\"$" }{TEXT -1 13 " i nstead of " }{XPPEDIT 18 0 "R^2" "6#*$%\"RG\"\"#" }{TEXT -1 33 ", we u se the command pointplot3d." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "pointplot3d(\{w1,w2\},color= blue, symbol=circle, symbolsize=15);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 287 "Unfortunately, the default opt ion for 3-dimensional plots in Maple is to hide the axes. This can be fixed by either clicking once on the 3-D plot above and then clicking on the icon for normal axes or by using the axes=normal option. Once again there is a view option for these graphs." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 103 "pointplot3 d(\{w1,w2\},axes=normal,view = [-5..5, -5..5, -5..5],color=blue, symbo l=circle, symbolsize=15);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 92 "Clic k on the graph and rotate the plot to get a good idea of the location \+ of the two points." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 257 "" 0 " " {TEXT -1 10 "Exercises:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 80 "3) Plot the points [1, 1], [2, -2], [- 3, 3], and [4, -4] all on the same graph." }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 122 "4) Usin g the points z1 and z2 you defined in Exercise 2 above, plot z1, z2, z 1 + z2, and 2*z1 - z2 all on the same graph." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 39 "Random number generators and long lists" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 350 "The last part of the On Line section of the text (page 29) deals \+ with using MATLAB to produce a random number between 0 and 1. The syn tax in Maple is a bit different. The rand function in Maple returns r andom integers in a specified range. We can use rand to create functi ons that produce random 3 digit numbers either from 0 to 1 or from -1 \+ to 1." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 74 "rand0to1 := rand(0..1000)/1000.0:\nrandneg1to1 := ran d(-1000..1000)/1000.0:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 158 "With t he first of these functions it is easy to produce a list of 10 random \+ linear combinations of the form A*v1+B*v2, where A and B are both betw een 0 and 1." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 101 "setofpoints := \{seq(rand0to1()*v1+rand0to1()*v 2,i=1..10)\};\npointplot(setofpoints,view=[-5..5,-5..5]);" }}}{EXCHG {PARA 5 "" 0 "" {TEXT -1 0 "" }}{PARA 5 "" 0 "" {TEXT -1 9 "Exercise: " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 343 "5) Use the rand0to1 function to create a list of 500 random l inear combinations of v1 and v2. (You probably want to end the command with a colon rather than a semicolon so the list is not printed out.) Plot the points in the list and describe the geometric figure that t hey make. Include the coordinates of the vertices in your description ." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 43 "When we try the same trick with vectors in " } {XPPEDIT 18 0 "R^3" "6#*$%\"RG\"\"$" }{TEXT -1 176 ", we find that the points all lie in a plane. To see this, rotate the figure below in \+ such a way that the plane is viewed edge-on - that is, so that it app ears to be a line." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 121 "setofpoints := \{seq(rand0to1()*w1+rand0to 1()*w2,i=1..500)\}:\npointplot3d(setofpoints,view=[-1..1,0..4,0..3], a xes=normal);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 85 "When a 3-D plot i s active, you see the present orientation in the second menu bar. " }{TEXT 256 1 "q" }{TEXT -1 92 " gives the angle of view in degrees in the xy-plane around from the positive x-axis, while " }{TEXT 257 1 "f " }{TEXT -1 76 " gives the view angle down from vertical. The defaul t view orientation is " }{TEXT 259 1 "q" }{TEXT -1 10 " = 45 and " } {TEXT 258 1 "f" }{TEXT -1 82 " = 45. Trial and error rotations of the \+ figure above show that an orientation of [" }{TEXT 260 1 "q" }{TEXT -1 2 ", " }{TEXT 261 1 "f" }{TEXT -1 187 "] = [17,65] views the plane \+ containing all the points on edge, while an orientation of [-11, 17] l ooks at that plane from the top so that the set of points looks like a figure in a plane." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 5 "" 0 "" {TEXT -1 0 "" }}{PARA 5 "" 0 "" {TEXT -1 9 "Exercise:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 277 "6) Use the rand0to1 func tion to create a list of 500 random linear combinations of the vectors z1 and z2 that you created in exercise 2 above. Plot the list and fi nd an orientation that looks at the plane from the edge and an orienta tion that looks at the plane from the top." }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}} }{MARK "0 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }