### Create a StudySoup account

#### Be part of our community, it's free to join!

Already have a StudySoup account? Login here

# 552 Class Note for MA 30100 at Purdue

### View Full Document

## 26

## 0

## Popular in Course

## Popular in Department

This 76 page Class Notes was uploaded by an elite notetaker on Friday February 6, 2015. The Class Notes belongs to a course at Purdue University taught by a professor in Fall. Since its upload, it has received 26 views.

## Similar to Course at Purdue

## Popular in Subject

## Reviews for 552 Class Note for MA 30100 at Purdue

### What is Karma?

#### Karma is the currency of StudySoup.

#### You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 02/06/15

Chapter 1 Systems 11 On Line In this introductory section we will pose no exercises but instead will detail how to use Maple to solve problems in linear algebra For the novice Maple user this section is essential reading and reference For the experienced Maple user this section can be examined for evidence of any new tips and ideas for working with Maple In addition this section will reveal the working style guiding the solutions in the rest of this manual Maple is a symbolic as well as a numeric language For users with ex perience in numerical computation Matlab BASIC FORTRAN 7 etc there are differences in thinking that accompany calculating in Maple The presence of symbolic variables adds a dimension missing in strictly numeric languages For one thing Maple is capable of computing answers in exact symbolic form so round off error need not be an issue in didactic ex periments For another it really helps to have a vision as to how to mix symbolic and numeric calculations lest operations performed numerically impinge 011 the operations which will be later performed symbolically We illustrate some sample Maple calculations beginning with simple arithmetic As we present the Maple syntax for various calculations we will explain the Maple Release 4 interface as it appears under Windows 011 a PC Release 4 has been engine red to have the same functionality 011 all major platforms Macintosh P NIX so only local differences in file structures and networks might possuly differ Enter Maple syntax at the prompt the gt at the left edge of the screen gt 23 57 2 11 llaple On Line Lines entered into Maple must have terminal punctuation typically the semicolon Simple arithmetic is done automatically A new prompt is generated upon execution of the command and that follows upon pressing the ENTER key Spaces are generally ignored by Maple and are used here to improve readability gt x2x Maple applies the rules of algebra to symbolic expressions and some of the simpli cations are immediate thers must be requested by a variety of special commands Assignments are made using the two characters colon 7 and equal two characters that must not be separated by a space gt f x 2 We have just entered an 11quot sign or formula and assigned it to the name 139 To evaluate this CXpI39LbblOIl at x 3 use the subs command to substitute x 3 into 139 gt subsx3f We next articulate Lopez s Large Law see the article Tips for Instructor aplc IL 01 3 NO 2 1996 published by DirkLa x which state never use 011 the left of an assignment a variable in use some where 011 the right Thus it is not a good idea to make the assignment x z x 1 Although this is an extremely common construction in numeric languages it is most unwise in a symbolic language Moreo gtr Lopez s Large Law precludes assigning values to the 7 working variables x y z etc A strict distinction between the letters being used for names 011 the left and 7 variables 011 the right makes Maple more user riendly ince we have demonstrated how to make an assignment to the name 71 we next show how to erase that assignment First erasing consists of assigning l39 to its 7 letter value which is what the single quotes accomplish Second entering interrogates Maple for what it knows about that name Maple echoes the contents of that name It is possible to create unfathomable Maple Worksheets Violations of Lopez s Large Law can lead to such dif culties and so can misunderstand 11 llaple On Line 3 ing Maple s file management For eXample suppose Lopez s Large Law has been violated by gt x3 Much later in the Worksheet the variable X is used symbolically as in gt f xsinPix What happened Why didn t the formula 1 sin 7r 1 appear Since X has been assigned the value 3 Maple computed 5in3 7r and got 0 Violating Lopez s Large Law indeed has consequences It is not enough to er X Once the assignment to l39 is the number 0 it remains the number 0 Having a clear strategy for working with Maple prevents needless l39rustration The neXt timebomb is more subtle Suppose that f has the value 0 from the above calculations And suppose that all record of the eX1stence of l39 in the Worksheet is removed by deleting the appearance of 139 from the Worksheet The letter 1 is still assigned the value 0 In fact it s worse than that If another blank Worksheet is opened via the menu options FileNew this new Worksheet will still have 139 assigned the value 0 This is because both Worksheets share the same memory and what is known to Maple in one W39orksheet is known to the other On some platforms with the right initialization of Maple each Worksheet can have its own attached memory Unless you know for sure how your copy of Maple is installed it is best to assume that all Worksheets share a single memory and always under all circumstances remember that merely removing the appearance of an assignment from a Worksheet does not remove that assignment from Maple s memory Suppose at this point in your eXperiments with a Worksheet you have eXcised the last inputoutput pair and the bottom of your Worksheet no longer contains the neXt prompt How do you generate a new prompt Place the cursor in an input line Simultaneously press the keys TRL and k to insert a prompt above the cursor and TRL and to insert a new prompt below the cursor If you eXamine the Insert menu the EXecution Group corresponds to a new prompt Having toyed with the menu bar observe the Help menu The best ad vice a Maple user can receive is to begin with Help ontents The resulting document that opens is hyperlinked to all sorts ol39inl39ormation about Maple 4 11 llaple On Line and it is left to the user to navigate through instructions 011 the interface and 011 Maple itself However to get help on a command whose name you know you can use the question mark gt subs Help commands don t need terminal punctuation At the bottom of most help screens is a section of Examples Look there rst Examples can be copied and pasted back into your Worksheet for experimentation The exercises for each section in this manual begin with the instruc tion to restart Maple This means to issue the restart command which clears all variables This command does not erase anything visible in the Worksheet so if a Worksheet has become confused and entangled issuing a restart and then working from the top down reexecuting all the entered commands is a way of beginning at the beginning and retracing the thought process in the Worksheet gt restart gt i We next illustrate some algebraic simpli cations gt q 1x 1y gt q1 simplifyq ommands in Maple typically take parentheses around the argument or arguments The letter q makes a handy label because it is easy to find 011 the keyboard Reassigning a new version of a name to itself is actually a violation Lopez s Large Law and should be avoided Thus gt q simplifyq is not a syntax error but is just plain bad worksmanship If parts of the Worksheet are reexecuted which version of q is being referenced Is it the unsimplilied version or the simplified version So use unique names for each meaningful Maple output to avoid confusion when experimenting since that usually requires editing changing reexecuting moving up and down throughout the Worksheet If the same letter has multiple meanings throughout the Worksheet chaos results Maple crashes It is a fact of life that Maple inexplicably and explicably crashes It is exceedingly frustrating to have spent an hour or more 011 an assignment in Maple only to lose it all because Maple crashed There is only one piece of advice that makes sense here and that is Save gtarly and save often The rst time a Worksheet is saved FileSave or the diskette 11 llaple On Line 5 icon 011 the toolbar Maple prompts for a file name and a destination for the saved file Thereafter clicking the diskette icon 011 the toolbar or entering CONTROL 3 fI39OHl the keyboard saves work to that same file Save early and save often That advice cannot be repeated too frequently Maple is both a symbolic and a numeric language Thus there is a difference between 1 and 10 in Maple The first is the exact integer 1 while the second is the decimal version of the number 1 Converting the exact syinbolic representation of a number is done with the evalf evaluate floating point command gt q 1sqrt2 gt evalfq Note that Maple inunediately rationalizes And note further that Maple can provide many more than the default 10 digits gt evalfq20 The next thing useful to know about Maple is how to reference parts of answers it generates Consider the following solution to a quadratic equation gtqx 23x10 gt solveqx Maple has returned a sequenee of two roots which can be referenced if a tag had been assigned to the solve conunand Thus the better working strategy is gt q1 solveqx Now the roots can be referenced by the bracket notation gt q11 gt q12 Thus there are three data structures Maple uses that are worth under standing Maple uses sequen s lisls and sels In a sequence items are separated by commas A list is a sequence enclosed by square brackets abc A set is a sequence enclosed by curly braces abc The list preserves order and replicas The set does not gt abaac gt abaac G 11 llaple On Line Each structure re ects valid mathematical usage and Maple has com mands for manipulating each data structure properly Although repetitive tasks can be implemented in Maple by copying and pasting input lines a l39orloop is the appropriate way to repeat similar instructions In this manual the l39orloop is entered as a single input as follows gt for k from 1 to 3 do xk k 2 0d All three input lines are connected to the one prompt by entering all lines but the last with SIIIFT ENTER rather than simply ENTER In Release 4 this is now more aesthetic than practical but if the three lines of code above are entered into Maple V Release 4 with just the ENTER key the first line will generate a complaint about 7 incomplete a complaint that disappears when the terminating 0d 7do 7 spelled backwards is entered In previous versions of Maple failure to keep the lines ol39a l39orloop together could lead to terrible consequences if changes were made to individual lines of the loop In Release 4 this is no longer such a problem One advantage of the notation X1 X2 X3 is that such objects can be referenced collectively by gt x13 For large collections of similar objects this turns out to be a handy device for saving repetitive and tedious typing We will be concerned primarily with Maple s functionality in linear al gebra Maple s code is modularized bundled into related groups called packages There are some 32 packages in Release 4 all of which are present in every properly installed version of Maple The command gt 7packages brings up the list of packages and the names of the packages are hyper linked to more information about the individual package39 The package we will use most is the linalg package tsell39 containing more that 100 commands for manipulating vectors and matrices The linalg package is loaded into Maple via the command gt withlinalg Notice that the terminal punctuation here is the colon which sup presses output This package will be loaded for every exercise set and we will want to suppress the listing of the more than 100 commands made present by this package First we enter the matrix A K 11 llaple On Line gt A matrix221234 It appears easier to provide the Inatrix command with a single list of entries letting Maple wrap them according to the dimensions given first The alternative is to give the Inatrix command a list of lists the sublists being the rows of the matrix Thus gt matrix12 34J We will use Maple s randnlatrix command to generate matrices at ran dom Maple s random number generator will generate the same sequence of random numbers each time it is initialized by starting or restarting Maple The advantage here is that results are then reproducible even if random matrices have been used There is a way of setting the starting point for the random number generator but that is not used in any of the exercises The help file for rand the random number generator accessed by Yrand will mention the global variable Ed which can be assigned values student s SSN Y thereby making unique assignments for each student That is not done in these exercises gt B randmatrix22 Matrix and vector arithmetic is most easily done by applying evalln evaluate matrix to the desired arithmetical commands gt 2A 439 3B A39Z gt evalm2A 3B A 2 In the first instance merely the names are manipulated by Maple In the second the actual entries of the matrices are manipulated There are times and places for each approach but only the second is used in these exercises Next we address matrix multiplication a process that is known in math ematics to be noncommutative Thus for numbers 23 i but for ma trices A B rarely equals B A Hence Maple distinguishes between the use ol39 7 l39or commutative multiplication and amp for the noncommutative multiplication of matrices In Release 4 Maple will warn specifically that AB l39or matrices must be changed to A amp B In earlier versions the user had to be prescient gt evalmA B gt evalmA amp B evalmB amp A Surprisingly vectors will take more discussion than matrices First of all enter the vector V 2 1 with the following syntax In a newly 1 8 11 llaple On Line installed copy of Maple V Release 4 the output will be as you see below gt V vector25 Throughout this manual the output will instead appear as gt V vector25 Why the difference and how do we get Maple to render vectors as columnlike rather than Wowlike And are such vectors column vec tors or row vectors First no matter how we get Maple to print the vector it is always a column vector Second to get your Maple session to print the vectors as columns enter the following instructions gt withshare readsharepvac system These two commands cause Maple to load from its Share Library a file called pmc printvectorascolumn the effect of which is to change the way vectors are printed If for some reason this functionality is to be switched off enter the command gt pvac false gt printV gt pvactrue gt printV In addition to noting how to turn this display feature 011 and off observe that it takes print or evalrn to get Maple to display the contents of a vector or matrix For the adventurous from outside Maple examine the file structure of the Maple V4 directory There is a subl39older called Shani in which the contents of the Share Library are stored A further subl39older Syslmn contains another subl39older called ch In the PMC l39older there is a file I vacmpl a file containing the code for the display l39eature being discussed If this file can be rendered as a pure text le it can be made into an initialization file so that the code will load automatically every time Maple is launched The author of this manual has had this code running as an initialization file in both Release 3 and Release 4 a span of more two years It has worked perfectly and has never given any trouble whatsoever To obtain a text version of the file pvacmpl launch a text editor such as Word etc From within the text editor locate the file pvacmpl and open it Perform a Save As save the file as t x 7 give it the name Mapleini for the PC 011 the Macintosh use MapleInit and for UNIX use mapleinit 11 llaple On Line 9 Be sure that your text editor does not add a hidden txt or other such extension Quit the editor and drop the initialization file into the Lib subl39older ol39 the Maple V4 folder for the PC drop it into the Maple V4 folder for the Mac and experiment with where to put it 011 a UNIX system Relaunch Maple and you will automatically have launched the pun code To verify that a Maple vector behaves as a column vector no matter what it looks like try the following experiments gt printAV gt evalmA amp V This is exactly the product you should obtain from the product A V done by hand treating V as a column vector Now ask Maple to convert V to a matrix gt VC convertVmatrix gt typeVvector typeVCvector gt type Vmatrix type VC matrix gt vc11 gt vc12 gt vc21 The matrix VC does not have a second column It has two rows 1139 the vector V is converted to a matrix data structure it gets converted to a 2 x 1 column matrix Maple thinks of the vector V as a column thing even if its default print style is to make it look like a row thing Moreover the transpose of V il39 converted to a matrix has all the characteristics of a l x 2 row matrix gt VR converttransposevmatrix gt VR11 gt VR12 gt VR21 The matrix VR does not have a second row Maple thinks of the trans pose of V as a row thing no matter how it prints it In fact it is a great tragedy that the Maple programmers have decided that the default output to the transpose command is gt transposeV 10 11 llaple On Line The evidence has already been presented that Maple understands the transpose It is sad indeed that so ne a program as Maple should have such anomalous behavior when displaying the transpose of a vector V that so obviously has the inherent properties of a column object Incidentally this means that there is no way per se to enter a row vector into Maple You enter a column vector the default vector object then transpose the column vector And yes you live with not being able to see the display of the transpose as a rowlike object aution It is tempting to sidestep this issue of row and column vectors with the belief that instead row and column matrices will be used This is not a good idea There are commands in Maple that specifically demand vectors not matrices For example if you had de ned not V but VC a column matrix and wanted to live your Maple life with only matrices you d run afoul of gt dotprodVC VC So you cannot live without vectors and if you cannot live without vectors you must then face the issue of row and column vectors Sorry but to reap the bene ts of Maple you have to put up with a few quirks Kind of like life in general There is one final issue to face about linear algebra in Maple To perform operations 011 vectors one must map the operator onto the vector For example to simplify a vector use the following syntax gt V vector1x1y 1x1yJ gt simplifyV Obviously not the right syntax gt mapsimplifyV The operator simplify has to be mapped onto the vector As another example il39V is a function ol39t and you want its derivative you use the following syntax gt V vectorsint cost gt diffVt Obviously the wrong syntax gt mapdiffVt Additional parameters to the mapped operator go at the end Unfortunately there are two exceptions to the rule Map things onto vectors and matrices 12 llaple On Line 11 gt V vectorPi2Pi gt evalfV gt mapevalf V Well that seems to work Why raise that as an exception The coin inand evalf can take an integer as a second argument changing the number of digits returned gt evalfPi20 But if you try that for the vector V it fails gt mapevalfV20 Nonsense is returned The method that works is gt evalfopV 20 A second exception is substitution gt V vectorxx 2 gt subsx1V gt mapsubsVx1 The syntax that works is gt subsx1opV Hence the rule is 7 Map all operators except subs and evalf For those don t Inap but use op around the vector If you use Inap don t use op When op is needed you don t use Inap 7 12 On Line The exercises of this section explore the concept of span 7 by visualizing randomly generated members of the s an of a set of vectors Begin by loading both the linalg and plots packages gt withlinalg withplots 12 12 llaple On Line Exercise 1 Enter into Maple the following four points For most purposes points can be represented as lists a data structure denoted by square brackets gt P111J P211 P311 P411J The plots package makes available a pointplot command that will plot a list of points There are a number of options to this command that will vary the look of the graph and by using the toolbars associated with the graph many characteristics of the plot can be adjusted To obtain help 011 this command enter gt Ypointplot To plot these points enter gt pointplotP 1 v 01 Exercise 2 Enter the vectors A 1 and B gt Avector11 Bvector 23 Using the pointplot command plot these two vectors as points in the plane Note the additional parameter view which sets a viewing window for the graph gt pointplotABJ view0 30 31 Produce several different linear combinations of A and B Appropri ate syntax for doing this would be as follows gt eva1m2A 3B b Use Maple s random number generator to create several random lin ear combinations ol39 A and B First define a function l39 which generates random l39ourdigit numbers in the interval 11 This is done with Maple s rand function as follows The evalf command changes exact fractions to decimals gt f evalfrand1000O 100001000O Then invoke the function f with the syntax For example create c one random linear combination with the syntax gt cevalmfAfB 12 llaple On Line 13 c Plot enough points in the span of A and B to get a discernible geo metric gure Begin with 100 random linear combinations and using the pointplot command plot them as points in the plane Maple s seq com mand will produce a sequence of similar objects from a pattern provided to it Terminate the command with a colon to suppress the output Then feed the resulting sequence to the pointplot command remembering to enclose the sequence in square brackets since pointplot requires a is of points or vectors gt qseqevalmfAfB k1 v 100 gt pointplot q d The plot in part c is only part of the span the portion being determined by our use of random numbers in the interval ll Rather than redefine the function 139 try multiplying the vector A by 2 creating another plot of at least 200 random linear combinations with A multiplied by 2 Exercise 3 Describe in words the set of points corresponding to the collection of linear combinations de ned by the sum 9 A 13 where both 9 and I lie in closed intervals of the form 22 Plot the resulting set of linear combinations as points in the plane using a different color than used in Exercise 2 See the online help for how to specify color in the pointplot command Exercise 4 In Exercise 9 ol39 the noncomputer problems it was stated that each element x y in the span of z 1 l X l andY 3 satis es5 c3y 2z0 l 2 Write C a X b Y the expression for the general linear combina tion of A and Y Then show that the components of the vector C satisfy the equation of the plane declared above This is most effectively accomplished as follows gtX vector111 Y vector132 gt C evalmaX bY M l31aple On Line gt q5x3y2z0 gt q1 subsxC1 yC2 zC3 q b Plot as points in R3 a few hundred elements of this span This requires use of Maple s pointplot3d command the 3d analog ofpointplot Begin by forming via seq a sequence of random vectors in the span of X and Y The function f defined for Problem 1 can again be used to provide the random coellicients gt qseqevalmfXfY k1 100 The syntax for pointplot3d is similar to that of pointplot However there are several additional parameters whose use makes for a better graph Since all 3d plot packages attempt to plot a 3d object 011 a 2d sheet of paper or computer screen there is a need for a reference frame that provides the sense of depth Try putting a box around your graph either interactively via the toolbars or via options to the plot command itself Having clear and highly visible labels 011 the axes is equally useful Thus the following syntax could be used to plot the vectors randomly generated above gt pointplot3d q colorblack axesboxed labels x yz labelfont TIMES BOLD 14 Observe that in Maple 3d graphs can be rotated 011 the screen by ma nipulation with the mouse lick 011 the plot to make it li Then click and hold down the mouse button dragging the bounding box that now replaces the graph This bounding box is rotated as the mouse is moved When released the bounding box has a new orientation and the graph is redrawn by clicking the R redraw 011 the toolbar Try to rotate your graph to demonstrate that the plotted points lie 011 a plane 13 On Line Maple Release 4 permits more than one worksheet to be open at the same time On some platforms Maple can be put into the multiple kernels mode in which each worksheet is attached to its own kernel or memory state In this mode variables declared in one worksheet will not be known to any other worksheet opened simultaneously However the default setting for Maple might be the shared kernel mode in which all open worksheets share the same memory state In this case variables declared in one worksheet have the same value in every other worksheet opened simultaneously The potential here for grave confusion 13 llaple On Line 15 is very high Since in Release 3 only one worksheet could be attached to a kernel this con ict betw e11 multiple worksheets never arose In Release 4 it is essential that this otcha be understood A simple precaution in the shared kernel world is starting every new worksheet with a restart a Maple command which clears memory and resets all variables The use ol39the restart command at the beginning of each new worksheet is highly recommended Here we both restart Maple and load the linalg package gt restart gt withlinalg Exercise 1 4 2 3 Obtain X 0 5 1 1 0 as the general solution to the 0 0 1 equation gr 21 3 z 4 Maple s linsolve command the general linear system solver will give the general solution to systems of equations We begin by creating a matrix the coef cient matrix whose entry is the coef cient of the th variable in the i th equation You can either type in the coef cient matrix A directly or use the gennlatrix command giving a list of equations and a list of variables as parameters Thus for the preceding linear equation we could enter gt q x2y3z 4 gtA genmatrixq xyz This extracts the coef cient matrix for the system Next the coef cient matrix and the constants 011 the right side of the equations are entered into linsolve We express the constants as a list which in this case has only one entry gt X linsolveA 4 The arbitrary constants that Maple has introduced are 11 and 12 The lead character is the underscore not a minus sign and the numbers 1 and 2 are subscripts To address these constants in Maple use the syntax tl and t2 Setting these constants alternatively equal to 0 and 1 will extract the basis vectors in the general solution After defining u the translation vector it is essential to subtract u from X when extracting the vectors v and w the multipliers of 11 and 12 16 l31aple On Line gt u subst10 t20 opX v subst11 t20 evalmXu w subst 1O t 21 evalmXu To get Maple to write the general solution in the vector form given in the statement of the problem adroit use of the evalrn command is necessary Unless evalrn is applied to the vector v the screen will merely display the name v gt Xg evalmu sevalmv tevalmw With the vectors v and w declared as above or typed in afresh from the pencilandpaper solution form C the general element in the span of v and w gt C evalmav bw b Show that F u C solves the given equation 1 2 y 3 z 4 gt F evalmuC gt q gt subsxF1 yF2 zF3 q This shows that the general solution of the given equation is the span of the vectors v and w translated by the vector u c Substitute the vector 7 into the given equation and describe the result What should you conjecture from this result Can you prove it Exercise 2 Repeat Exercise l for the system U from Section 13 The essential ques tion to be ultimately resolved is Does the conjecture made in Exercise 1 still hold Can you then prove your answer is correct Begin by entering the system U being careful to clear the variable w that was used in Exercise 1 using the command 7 w w all your equations ql q2 q3 and q4 Use genrnatrix to form A the coef cient matrix for the system U gt A genmatrix q 1 JD xyzw Use linsolve to obtain the general solution of system U using a list for the values 011 the right hand sides of the equations gt x linsolveA 1012 Extract the translation vector u and the basis vectors v and w as in Exercise 1 Form C the general element in the span of v and w 14 llaple On Line 17 gt C evalmav bw b Show that F u C satis es the system If This can be done by repetitive typing by typing once and using copypaste or by a forloop that does repetition automatically gt F evalmu C gt for k from 1 to 4 do subsxF1 yF2 zF3 WFE4J qk 0d c Substitute 7 into each equation in the system If in an attempt to determine if the conjecture made in Exercise 1 is still viable If you still believe your conjecture is true can you prove it 14 On Line Alter restarting Maple and reinitializing by loading the linalg package we examine the reef command for putting a matrix into its reduced row echelon l39orm Consider the matrix A de ned by gt A matrix4e 1113oe2226o7111121441936 Subject A to the reef operator gt rref A The result just obtained is exact since Maple obtained it by doing ra tional arithmetic There is no truncation error introduced by a conversion of integers to decimal form and there is no roundoff error produced by a numerical algorithm This is the result that would be obtained working with a pencil and paper This is ol39course wonderful We can in princple do every computation with total accuracy At first glance then it seems then we should never again need to round off an answer Unlortuately life is not so simple Suppose for example we want MAPLE to compute 104857720 We enter gt 10485771000000 20 Maple s response is a 121 digit integer divided by an equally large power of 10 Imagine now what would happen if we attempted to perform a calculation which required say addition and multiplication several hundred such numbers The number of digits our computer would need to store would become astronomical and the speed would be reduced to a snail s 18 14 llaple On Line pace Furthermore in an actual application the number 1048577 would probably represent the result of some measurement which itself might be accurate only to within the given number of digits Thus the vast majority of the digits that our compter is so laboriously computing and saving are totally meaningless The moral is that the perils of numerical computations must be faced Exercise 1 We first examine how to convert the matrix A to oating point decimal form then look at the same row reduction done numerically instead of symbolically The conversion can be done by tom39crling each element to oating point form Inap the convert operator onto the matrix A via gt A1 mapconvertAfloat Row reduce to reduced echelon form the oating point form of matrix A gt rrefA1 For the matrix A there is no difference in the reduced echelon form when working numerically This will not always be the case In fact we can inves tigate Maple s numerics by a stratagem used 011 any numerical calculating device Compute the value of 99 l and successively append 9 s both inside and outside the brackets Eventually there will be enough 9 s so that the numeric calculation will no longer yield 0 That gives an indication of how accurate the computing device is To force Maple to evaluate the ex pressions in oating point form make one of the numbers a decimal For example use l0 rather than just 71 in the numerator of the fraction To see the difference between working numerically and symbolically in Maple change the numerator from l0 to just 1 Then Maple will eval uate the expression symbolically and produce 0 The roundoff error only appears when working with floating point numbers It is possible to vary the number of digits with which Maple computes This is done via the Digits variable as follows gt Digits 12 Test Maple s numeric behavior 011 the floating point calculation above that failed to yield 0 Notice that with more digits availabl Maple escaped the effect of roundoff in a computation that failed with just the default 10 digits 14 llaple On Line 19 The price one pays for increasing the number of working digits is com putation time since these extra digits are being simulated by the Maple sol39tware Reset the number of digits back to the default 10 via gt Digits 10 Exercise 2 Use the reef command to find all solutions to the system in Exercise 5g Section 13 First enter the equations of that system all your equations ql q2 q3 qnd qd Next get Maple to write the augmented system matrix The gennla trix command converts the equations into matrix form and the additional parameter ag signals Maple to include the numbers 011 the right side of the equations Incidentally the parameter can be any character or word that is not already a reserved word in Maple gt Agenmatrixq 1 JD xyzw flag Apply the reef command gt A1rrefA To obtain solutions from the rrel39 form of the matrix A apply the process of back substitution Start with the bottommost nonzero row of rrel39A and interpret it as an equation defining the value of z Solve that equation for the value of z and substitute that value into the equation above Solve the resulting equation for the value of y so determined Substitute both the value of y and z into the remaining equation which is then solved for it Check your work by invoking Maple s builtin backsub command gt backsubA1 Exercise 3 The rank of a system of equations is the number of equations left after eliminating dependent equations This number does not depend 011 which equations were kept or eliminated Hence it is plausible that the rows in the reduced row echelon form of the system s matrix re ect the distinct equations that would survive an elimination of dependent equations Hence the rank of the system should be the number ol39nonzero rows in the reduced row echelon form of the matrix for the system 20 14 llaple On Line Check this conjecture experimentally by creating 4 x 5 matrices Al A2 A3 and A4 with ranks respectively l 2 3 4 In particular insure that no matrix has a zero entry A process for creating a random matrix of prescribed rank is based 011 l39orming rows that are themselves linear combinations of other rows Begin by defining l39 a function returning a random integer in the closed interval l0l0 This is done with the rand command gt f rand1OH10 We begin by constructing a matrix Al 0139 rank l This requires that the rows ol39Al be linear combinations of a single row Begin by constructing a l x 5 matrix Ml by using the function f in conjunction with the randnlatrix command to guarantee that the random matrix has entries that are integers in the interval l0l0 gt M1 randmatrix15entriesf From Ml build a 2 x 5 matrix M2 in which the rows are multiples of the single row in Ml Maple s stack command assembles a rows or vectors into a new matrix making the buildingblocks into the rows of the new matrix gt M2 stackM1evalmfrowM11 From M2 build a 3 x 5 matrix M3 in which the rows are random linear combinations of the rows in M2 A single row in M2 can be referenced by the row command as illustrated below gt M3 stackM2evalmfrowM21frowM22 Finally build the required 4 x 5 matrix Al by taking linear combina tions of the rows of M3 gt A1 stackM3evalmfrowM3 1 frowM32 frowM33 Test that Al has rank l by invoking Maple s builtin rank command gt rankA1 The process for constructing random matrices of rank 2 is similar The only difference is that we start with a random 2 x 5 matrix produced using the randnlatrix command instead of a l x 5 matrix Similarly for a rank 3 matrix we would begin with a random 3 x 5 matrix and for a rank 4 matrix we would begin with a random 4 x 5 matrix The rank of the matrices Al A2 A3 and A4 can be corroborated by reducing each to reduced echelon form The following loop implements the required calculations 14 llaple On Line 21 gt for k from 1 to 4 do rrefAk 0d In each case the number of distinct nonzero rows exactly matches the known rank of the matrix These row reductions are exact without round olf error since Maple computes symbolically unless told otherwise How ever all computing devices when computing with oating point numbers can experience di iculties attributable to roundoff and truncation errors Examine this issue in Maple gt for k from 1 to 4 do rrefmapconvertAkfloat 0d For the matrices created in this session remember we are using a ran dom process rrel39A3 is wrong The n ef command declares that a small number which ought to be seen as zero is not zero Hence it suggests the rank of A3 is four ne defense against such numeric errors is the gausselinl command which row reduces a matrix but does not make the diagonal elements 1 By not dividing by the diagonal elements this command is less likely to err in numeric computations Let B3 be the oating point version of A3 obtained by mapping the process of conversion to oats onto A gt B3 mapconvertA3float Now apply gausselinl gt q gausselimB3 The small entries in the fourth row should be taken as 0 s These are the numbers that rrel39 sees as nonzero leading to errors In Maple we can apply the fnorrnal command to set to zero numbers smaller than a given tolerance As with all operations applied to matrices and vectors the fnorrnal command is mapped onto the matrix 01 gt mapfnormalq 10 Exercise 4 Row reduce the transposes ol39 the matrices Al A2 A3 and A4 constructed in Exercise 3 The Maple command for the transpose is 7 transposeA What do you notice about the rank of the resulting matrices Exercise 5 Define vectors X Y and Z as indicated below gt X vector12543 Y 2 V66t0r613982103 Z vector51219241 22 1311aple On Line Determine whiCh ol39 the veCtors U and V below is in the span of X Y and Z Solve a determining system of equations by using the n ef command gt U vector52341468J v vector22o22o34 The question requires solving a X b Y C Z U and a X b Y C Z V for constants a b and C Both sets of equations Can be solved at the same time if the following augmented matrix is formed gt q augmentXYZUV Row reduCing via the rrel39 Command gives solutions to both systems of equations at the same time b Imagine that you are the head of an engineering group and that you have a Computer teChniCian working for you who knows absolutely nothing about linear algebra other than how to enter matriCes and Commands into Maple You need to tell your teChniCian how to do problems similar to part above SpeCiliCally you will give the teChniCian an initial set of three veCtors X Y and Z from R3 You will then provide an additional veCtor U and you want the teChniCian to determine whether U is in the span of X Y and Z Write a brief set ol39instruCtions whiCh will tell your teChniCian how to do this job Be as expliCit as possible Remember that the teChniCian Cannot do linear algebra You must provide instruCtions 011 how to ConstruCt the neCessary matriCes what to do with them and how to int gtrpret the answers The final output to you should be a simple W s or No You don t want to see matriCes C ne of your assistant engineers Comments that it would be easier for the teChniCian in part b to use Maple s rank Command rather than l l ef What does your assistant have in mind 15 On Line Alter Clearing Maple s memory by issuing a restart Command and re initializing by loading the linalg paCkage enter the matrix A and the veCtor X gtA matrix34 1213572213443 gt X vector1324J Obtain the produCt B A X You should Consult On Line SeCtion 11 for a disCussion of matrix produCts in Maple 15 llaple On Line 23 gt BevalmAampX Exercise 1 The matrix multiplication A X just obtained represents a linear combi nation of the columns of A with coef cients taken from the vector X Implement this notion and show the result is the vector 13 found in the Introduction olumns of A can be referenced with the col command and elements of the vector X can be referenced as Xk Hence the brute force way of obtaining the required linear combination would be with the following syntax gt evalmcolA1X1 colA2X2 colA3X3 colA4X4 Since the columns of A are referenced in numerical order with an ill dex that is repeated when referencing the components of X it should be possible to form the same linear combination of columns with some sort of summation process Maple has a sum command that replicates xactly the mathematical sigma notation 22 Ah X16 There is one syntactical quirk to overcome however The col command requires a value for the index before the sum command can provide it so naive use of the notation will result in a syntax error The trick is to put single forward quotes 011 the col command thereby preventing it from demanding priority in getting a value of the index before the sum command is ready to provide it gt evalmsum colAk Xk k1 4 Exercise 2 Solve the system A X B for X Keep in mind that B was formed by multiplying A against X This exercise seeks to determine whether or not X can be recovered from B One method of solution consists of row reducing the augmented matrix AB then using back substitution implemented in Maple via the backsub command gt C rrefaugmentAB gt X1 backsubC By inspection determine a value of the parameter 11 that makes the general solution in X1 become precisely X Remember this parameter is a subscripted quantity and can be addressed in Maple via the syntax tl 24 1311aple On Line Exercise 3 Another method for finding the general solution first obtained in Exercise 3 is predicated on finding a basis for the null space ofA This basis can be found via the Maple command nullspace as shown below gt q nullspaceA Observe that the nullspace command returns a set of vectors Here there is but one member in the set a single vector that can be addressed via the syntax gt Zq1 Verification that Z is indeed in the null space of A resides in the product A Z gt evalmA amp Z The general solution for the system A X B is then Xg X t Z where t is an arbitrary parameter Form Xg and show that it satisfies the equation A Xg B By inspection determine a value of the parameter t in Xg for which Xg becomes exactly X1 the first form of the general solution found above Exercise 4 Enter the matrix A and the vector 13 as shown below gt A matrix461761327641946332579552461061996689 36321eo3271o4 gt B vector1745589 Determine the rank of A From this information determine how many free variables the system A X 0 will have b How many spanning vectors will the null space of A contain c Using Maple s nullspace command find a spanning set for the null space of A Since this command returns a set of vectors extract all the vectors from this set naming them wl w2 etc gt q nullspaceA gt for k from 1 to 4 do wk quJ 0d d By inspection find a vector X satisfying the equation A X B Verify that your guess indeed satisfies the equation e If F is a general linear combination of the vectors W1 w2 W4 show that C X F is still a solution to the equation A X 13 Note 15 llaple On Line 25 You might need Maple s print command as well as evalrn to force Maple to display the results of your computations 139 Explain the statement 7 The general solution to A X B is the vector Xo W Y where W is the matrix whose columns are W1 W2 W3 and W4 and Y is any vector in R4 Hint omputationally it would be useful to form the matrix W with the augment command form the vector Y with four parameters for components and to find the general solution to A X 13 via the linsolve command This solution should match Xo W Y g Find a basis for the null space of A by solving the equation A X 0 for the general solution X This is easily done in Maple by using the linsolve command This command takes as arguments the matrix A and a vector or list of zeros as the righthand side values Maple will deliver a linear combination of the vectors W1 W2 W4 that were found by the nullspace command h Find a basis for the null space of A this time solving the system A X 0 by augmenting A with a column of zeros and using the n ef and backsub commands The solution will not be readily recognized as a linear combination of the vectors W1 W2 W4 i Verify that the basis found in part h is equivalent to the basis W1 W2 W4 show that the set of equations 1 W1 6W2 t W3 1 W4 v16 has a solution for each mg in the basis found in part h This is most easily done by augmenting W with the general solution found in part h and using the rrel39 command to show the equations are consistent for any values of the parameters in that general solution 26 15 llaplc On Linc Chapter 2 Dimension 21 n Line Restart Maple to clear its memory of all variables and reinitialize by loading the linalg package Exercise 1 Given the matrix A entered below gt A matrix43123451321111 find the reduced row echelon form of A How can you tell just from this reduced form that the columns of A are independent Relate your answer to Theorem 1 Exercise 2 Let A be a random matrix with more rows than columns State a gen eral rule for using rrel39A to decide whether or not the columns of A are independent Demonstrate your condition by producing a 5 x 4 matrix A with no nonzero entries and with independent columns and by b producing a 5 x 4 matrix with no nonzero entries and with dependent columns In each case obtain rrel39A Prove your condition using Theorem 1 Exercise 3 Let A be the matrix entered below 27 28 22 llaplc On Linc gt A matrix5e126814324185131491oo32112 14571111199 Use the rref command to find the pivot columns of39 A Write them explicitly as columns Then express the other columns of39 A as linear com binations of39 the pivot columns See Example 4 in the text You should discover that the first three columns of39 A are the pivot columns Exercise 4 If Ak represents the kth column of39 the matrix A defined in Exercise 3 form the matrix B Whose columns are the columns of39 A in the following order B A4 Ag Al Ag Ag A5 This is most easily done by using the augment and col commands Find the pivot columns of39 B by using the rref command Do you obtain a different set of39 pivot columns Use rref39B to express the other columns of39B as linear combinations of39 the pivot columns Could you have derived these expressions from those in Exercise 3 If so how Exercise 5 Find a matrix 7 whose columns are just those of39 A listed in a different order such that the column of39 T which equals A5 and the column which equals Al are both pivot columns Is it possible to find such a 7 Where Ag is a pivot column as well If so find an example If not explain Why it is not possible 22 On Line Restart Maple to clear its memory of39 all variables and reinitialize by load ing the linalg package In addition use the command 7 withstudent to load the sludcnl package in order to access its equate command Exercise 1 Let A be the matrix entered below gt A matrix563912639839143241398539139314 399 3910 0 3 392 391 12 39 14571111199 22 llaple On Line 29 Part a Find the rank of A via the rank command Using only the value of the rank explain why the statements 139 and ii given below are true i The reduced form of the augmented matrix for the system A X 0 has three free variables Recall that in a previous 011 Line section it was noted that the rank is the number of nonzero rows in the reduced form ii The null space of A has dimension 3 Hint How many spanning vectors are there in the general solution to A X 0 Part b Show that each of the vectors X1 X2and X3 given below satisfy A X 0 gt x1 vectorlt5131o231 x2 vector3611125 X3 vector479516 Note Since verifying that A XC 0 is a repetitive task it can be done in a forloop Part By computing the rank of the matrix X1 X2 X3 prove that X1 X2 and X3 are linearly independent Recall that the maximal number of linearly independent columns equals the rank Part 1 How does it follow that the dimension of the null space of A is 3 How does it follow that the XC constitute a basis for the null space Part e Using Maple s nullspace command find a basis for the null space of A Express each vector in this basis as a linear combination of the Xk s from part d Hint Given two bases for this null space showing that they are equivalent requires showing that any vector in one can be found as a linear combination of the vectors in the other Hence a set of equations of the form a X1 b X2 c X3 wk must be solved for each k l 2 3 This can be done by forming the augmented matrix X1 X2 X3 W1 W2 W3 and row reducing In row reduced form this matrix will indicate whether or not these equations are solvable and if so how to express the nonpivot 30 23 llaple On Line vectors in terms of the pivot vectors See Theorem 1 and Example 4 in Section 21 Part f In part e what made us so sure that the first three columns would be the pivot columns Why couldn t for example the pivot columns be columns 1 3 and 4 Hint Think about what this would imply for the reduced form 0139 XL X2 X3 Part g In part you expressed the vectors wk in terms of the vectors X16 In this part now express the XC in terms of the wk This would complete the demonstration that the XC and the wk are equivalent spanning sets for the null space of A Hint Use the technique in part Part 11 a Find by inspection a vector T which solves the equation A X HHAH Part 7 Let 8 be an arbitrary element of R3 and let Z T r X1 s X2 1 t X3 where T is as found in part h ompute A Z Explain why you get what you get Find constants u v and w such that Z T u W1 v w2 w W3 What theorem does this demonstrate Note A11 ellicient eay of doing this is to use the equate command from Maple One might first enter the two proposed expressions for Z as follows gt q1 evalmaugmentXv13ampvectorrst q2 evalmaugmentwv13 We can equate these two vectors with the equate command from the sludcnl package and then solve for the required constants using the following syntax gt 13 equateq1q2 gt 14 solveq3uvw q5 solveq3rst 23 llaplc On Linc 31 23 On Line Restart Maple to clear all variables and reset its memory then initialize by loading the linalg package Exercise 1 Using Maple s randnlatrix command construct M a random 3 x 5 matrix What do you expect for the rank of M heck using the rank command Is it conceivable that the rank could have turned out otherwise Why is it unlikely Finally retain this matrix for use in the other exercises of this section Exercise 2 Form two different random linear combinations of the three rows of M then append these two rows to M thereby creating a 5 x 5 matrix It helps to use rand to define a function f as a generator for the random coellicients needed for the linear combinations Then the sum and row commands simplil39y constructing the linear combinations of the rows of M Finally the stack command appends rows to the bottom of M See Exercise 3 from the On Line exercises for Section 14 Using both rank and rref test the rank of the enlarged matrix What is the maximal number of linearly independent columns in the new matrix Exercise 3 For the 5 x 5 matrix created in Exercise 2 find a set of columns which forms a basis for the column space Express the other columns as linear combinations of these columns Use the technique of Example 3 in Section 21 Exercise 4 In this exercise you will explore Maple s ability to obtain the reduced row echelon l39orm numerically In Exercise 3 the reduction is found symbolically using exact arithmetic and the result suffers no loss of accuracy from round off error A oating point evaluation of this exact answer will serve as the target answer that we will expect Maple to deliver numerically First apply the evalf command to the reduced row echelon matrix found in Exercise 3 Next by mapping the converttolloat operation onto it convert the 5 x 5 matrix of Exercise 2 to oating point l39orm See 32 23 llaple On Line Exercise 1 in the On Line exercises for Section 14 Then obtain the reduced row echelon form of this numeric matrix Observe that the result is wildly wrong In fact it shows the matrix to be of rank 4 whereas the matrix is known to have rank 3 gt mm mapconvertMMfloat gt mm1rref mm The reason for the error can be seen by row reducing the matrix to an uppertriangular form without dividing the diagonal elements to make them l s This will prevent division by possible small numbers This row reduction can be accomplished via the gausselinl command gt q gausselimmm So although the work was done numerically the only dif culty that has surfaced is the small positive value 011 the main diagonal a value that in exact arithmetic would be zero To get Maple to render such small values as zeros map the fnornlal command onto the matrix The fnornlal command takes as additional parameter an integer specifying the number of digits to which the rounding is to be performed gt rref mapfnormal q 9 This result now matches what was obtained when the exact solulion was converted to oating point form Exercise 5 Find a basis for the column space of the 5 x 5 of Exercise 2 by row reducing its transpose and invoking the NonZero Rows Theorem Express each of the basis columns found in Exercise 3 as linear combinations of the basis columns found by this technique Exercise 6 Create four random 4 x 4 matrices of rank 1 2 3 and 4 respectively See Exercise 3 from the On Line exercises for Section 14 Determine the null space and the dimension of the null space called nullin in some texts for each matrix Relate the rank the nullity and the number of rows in the matrix Chapter 3 Transformations 31 Section 31 On Line Restart Maple to clear all variables then load the linalg and plots packages The exercises in this section deal with transformations in the plane Hence constructing several different types of graphs needed in this section requires the plots package Exercise 1 Create a 2 x 11 matrix F whose 11 columns are the coordinates of certain points in the plane These points are the endpoints of line segments that constitute a letter of the alphabet Because it might be tedious to con struct the letter 7 7 with line segments feel free to select some more easily constructed letter such as T Sketch the letter of your choice 011 a piece of paper using a minimum number of arcs and a maximum number of line segments Pick an endpoint of some segment as the origin and assign coordinates to each of the other endpoints Sketching the letter 011 a sheet of graph paper might make this easier Enter into the matrix F the coordinates of the endpoints of the segments making up your letter Each column represents an endpoint Start at an extremity and use contiguous columns to represent points connected by a line segment 1139 your letter requires you to retrace a segment this happens with the arms in letters like E and F list the coordinates of any endpoints in the order in which they are traversed For example a recognizable letter F can be represented by the matrix 33 34 31 llaplc On Linc 200 221 Hum 00 02 where the origin has been taken at the base of the vertical stroke Save the worksheet in which you have entered your matrix F since it will be used in the remaining exercises Exercise 2 Since you will need and want to plot your letter create the following Maple function that takes as input the name of the matrix of your letter and returns a plot of the letter The effort required to type in this function will more than pay for itself as you experiment with these exercises gt f x gt pointplot seqconvert colx k list k1 t t coldimx styleline axesboxed scalingconstrained Obtain a plot of your letter by applying the function f to the variable F associated with the data for your letter gt fF Exercise 3 Example 1 iron g iction 31 contains a matrix M which represents a 7 shear along the xa 39 all this shear matrix Say and apply it to the letter stored in F by forming the matrix product Sag F Plot the image of the sheared letter Exercise 4 Construct the rotation matrix corresponding to a counterclockwise rotation of 20 degrees Apply this rotation matrix to your letter and plot the result Since you will need other rotations it will be more ef cient if you build R a rotation matrix generating function that accepts as input the num ber of degrees counterclockwise through which the rotation is to take place and returns the matrix for this rotation Maple s arrow notation for building functions is appropriate here An appropriate syntax would be gt R x gt matrix22cosxsinxsinxcosx gt R20 R20Pi180 31 llaplc On Linc 35 Rotate your letter by multiplying it by R20 and plot the rotated letter by invoking the plotting function f built in Exercise 2 Exercise 5 Create another letter reduce it to a matrix ofcoordinates and store it in an appropriate variable For example the letter E can be created by a simple modification of the matrix representing the letter F and its matrix stored in the variable E Plot the new letter Then in anticipation of plotting the combination F E determine a way to plot the result of shifting E three units to the right all your shifted letter TE Hint Since the translate of E three units to the right would have each xcoordinate increased by 3 you want to find a simple way to add 3 to each element in the first row of the matrix E The Maple syntax 337 writes a sequence of seven 3 s separated by commas Hence the following matrix has row of threes and a row of zeros gt T matrix27 3707 Next plot the combination FE The utility function f which we built for graphing letters is not sophisticated enough to accept multiple inputs the way the standard plot functions in Maple will Hence create plots of each letter and combine the resulting graphics objects with the display com mand Assign the plot of each letter to a variable being sure to terminate each command with a colon Then invoke display gt p1fTE gt p2fF gt display p1 p2 Exercise 6 Let S be the transformation of R2 to itself wherein 3X is a shift of X one unit to the right Show graphically that S is not linear Specifically use the letter created in Exercise 1 to show that 32 X 9E 2 3X Exercise 7 For each of the following find a matrix M for which multiplication would accomplish the indicated transformation In each case validate your matrix by applying it to the letter created in Exercise 1 36 32 llaple On Line Part a Ma ips a letter upside down Part 1 Mb ips a letter lel39ttoright Part 6 Mc rotates a letter by 20 degrees counterclockwise Part d Md is a shear along yaXis Exercise 8 Plot the effect of each of the following transl39orinations applied to the letter created in Exercise 1 Part a A shear along the XaXis followed by rotation of 20 degrees counterclockwise Part 1 Rotate 20 degrees counterclockwise then shear along the XaXis Part c Shear along the Xaxis followed by shear along the yaXis Part d Shear along the yaXis followed by a shear along the XaXis 32 llaple On Line 37 32 On Line Restart Maple to clear its memory of all variables then reinitialize by loading both the linalg and plots packages These exercises will continue the study the geometric aspect of transfor mations in R3 For this work it will be useful to again define the function f used in On Line Section 31 In that section the function took in a matrix representing a plane figure and returned a plot of the figure Exercise 1 In place of the letters of the alphabet that were used in the exercises of Section 31 use line segments to create the outline of a car Draw the outline 011 a piece of paper even a sheet of graph paper pick for the origin the endpoint of one segment and find the coordinates of the endpoints of all the line segments Enter these coordinates as columns of a matrix 7 Hence you might have a matrix such as the following gt c matrix01325600 1 52 20 O representing the car whose shape is given by the following graph gt fC For the reader who believes this car looks more like a flatiron we give the data points for a car that is significantly better looking The interested reader can enter the data into an appropriate matrix and run the experiments in these exercises with the improved image 6 540 1 164e1 1612 1425 2237 2124 2336 2513 2461 3187 3158 3472 3553 3912 3684 4611 3783 5674 3783 6373 3783 6716 3684 6891 3388 7262 3191 7366 2961 7469 2763 7876 2599 8264 2566 8394 2368 8472 2672 8497 1612 513 8497 1283 8497 1020 26e2 1053 Transform your plane image into a 3d object by altering the matrix T as follows Add a middle row of zeros by first adding a third row of zeros then swapping the second and third rows This can be done in Maple by first stacking T with a row of zeros then using the swaprow command to interchange the new row of zeros with the original row 2 gt d swaprowstackc06 23 Since several 3d plots will be required it is very useful to define a function f3 that will take in a matrix representing a 3d object and return a 3d plot of the object so represented 38 32 llaplc On Linc gt f3 ugt pointplot3dseqconvertcoluk list k1 v coldimu styleline axesboxed scalingconstrained colorblack labelsxzy labeliont TIMES BOLD 14 Having defined the function 13 apply it to the matrix d which represents a first version of a 3d car Since this is a 3d plot it can be rotated in Maple by clicking 011 the image and then using the mouse to 7grab and 7rotate the bounding box flicking 011 the R in the toolbar redraws the graph gt f3d Exercise 2 Further dimension can be added to the image of the car by adding 14 to each element in row 3 of the matrix d then augmenting the matrix d with the altered version e ne way to do this is to assemble via stack the first row of d the altered second row and then the third row gt e I stackrowd 1 evalmrowd214 rowd3 gt F augmentde Test the ef cacy of these improvements by plotting using the function 13 Exercise 3 Add some substance to the car by sketching in diagonal lines 011 each of the narrow faces This requires alternating the columns of the augmented matrix P so that the first column comes from d the second from matrix e etc In effect build a new matrix FF by augmenting pairs of columns of the form clC ck This is accomplished in Maple via the syntax gt FF augment F seqop coldk cole k k1 v v coldimC The validation of the manipulation is in the plotting gt f3FF Exercise 4 Some of the transformations that will be applied to the car include rota tions To keep the rotated car in the viewing window it will help to move the origin to the center of the car Deduce the coordinates of this center and move the origin to that point by subtracting appropriate constants 33 llaplc On Linc 39 from the first and third rows of the matrix FF Remember that the first row records xcoordinates the second row zcoordinates and the third row ycoordinates Form this new matrix by altering the appropriate rows and reassembling them into a new matrix gt FFF stackevalmrowFF 13 rowFF2 evalmrowFF332 Next rotate the figure counterclockwise 30 degrees about the xaxis then rotate that image 20 degrees counterclockwise about the zaxis This is most easily done by building functions that yield the appropriate three dimensional rotation matrices Exercises 10 11 and 12 in Section 31 then invoking the functions for the required angles See Exercise 4 in the On Line section for Section 31 Exercise 5 Obtain a single matrix whose action under multiplication reproduces the two successive rotations implemented in Exercise 4 Validate your single matrix by again plotting the rotated car Exercise 6 What image would you see if you transformed the matrix FFF by a rank 2 transformation Create a random rank 2 matrix and test your guess After printing graphs of the transformed and untransformed images attempt to label several points where the transformation is manytoone The entries in the transformation matrix should be random numbers in the range 11 lest the scale of the car be altered completely Exercise 7 What image would you see if you transformed the matrix FFF by a rank 1 transformation Create a random rank 1 matrix and test your guess Again be sure to restrict the entries in your random matrix to the range 11 33 On Line Restart Maple to clear its memory of all variables then reinitialize by loading the linalg plots and 110110015 packages 40 33 llaple On Line Exercise 1 Create M a random 2 x 3 matrix with rank 1 See Exercise 3 in Section 14 If M is interpreted as the matrix of a transformation acting 011 R3 what should the dimension of the image of this transformation be Verify this by creating 100 random points in R3 transforming them under M and plotting the points Next generate P a matrix containing 100 random points in R3 A moment s thought about how the transformed points will be plotted will determine the optimum strategy for generating and plotting the points If the points are stored as columns of a matrix they can be plotted by apply ing the pointplot command to the matrix Hence let P be of dimension 3 x 100 so the product M P will be 2 x 100 reate P by juxtaposing via augment 100 vectors generated by randvector Terminating the com mands with a colon signals Maple not to print the rather large outputs to the screen Finally anticipating Exercise 2 where this plot will be re quired store the plot data structure in a variable say pl so later other images can be superimposed 011 it gt P augmentseqrandvector3 k1 100 gt S evalmMampP gt p1 pointplots gt p1 Exercise 2 The plot generated in Exercise 1 should show the span of any nonzero column of M Demonstrate this by choosing a column of M and plotting 011 the graph from Exercise 1 100 random points in the span of this column Define the function f which generates a random integer in the closed interval 500500 Then using the seq command give to pointplot a sequence of 100 random multiples of the first column of M olor the points red and assign the plot data structure to a variable say p2 After viewing the graph merge it with the plot from Exercise 1 by use of the display command Assign this composite graph to a variable say p3 for use in Exercise 3 gt f rand500500 gt p2 pointplotseqevalmcolM1fk1400 Color red p2 gt p3 displayp1p2 p3 34 llaple On Line 11 Exercise 3 Using information and insights from Exercises 1 and 2 find a specific vector 13 in R2 for which the equation M X B is no solvable and b a vector C in R2 for which the equation M X C is solvable Indicate these vectors 011 the composite graph produced in Exercise 2 Verify your answers by computing via L39L39ef the reduced row echelon forms of the augmented matrices MB and MC Exercise 4 Plot 100 random elements from the null space of M Maple s nullspace command will provide a basis for the null space of M This basis is returned as a set of vectors which can be extracted from the set with the bracket notation The seq command can be used to generate a sequence of 100 random linear combinations of these basis vectors a sequence which can then be plotted in R3 with the pointplot3d command The 3d graph so generated can be rotated onscreen by grabbing and rotating the bounding box It should then be possible to observe the nature of that portion of the span so generated Finally explain how this plot relates to the RankNullity Theorem Exercise 5 Randomly generate a rank 2 matrix M of dimension 3 x 3 Repeat Exercises 1 through 4 suitably modified to account for the different dimensions Speci cally this means you are to generate M Then in imitation of Exercise 1 the matrix P containing 100 random point in R3 and plot the product M P In imitation of Exercise 2 plot 100 random linear combina tions of the columns of M In imitation of Exercise 3 find vectors B and C for which the systems M X B and M X C are not solvable and solvable respectively Verify your choices of B and C computationally Fi nally in imitation of Exercise 4 plot 100 randomly chosen elements from the null space of M When you are done don t forget to relate your findings to the Rank Nullity Theorem 42 34 llaple On Line 34 On Line Restart Maple to clear its memory of all variables and reinitialize by loading the linalg and sludcnl packages Maple contains a variety of solvers l39or equations of various types For example the standard symbolic solver for one or several equations linear and nonlinear alike is solve The standard numeric solver for such equations would be fsolve oating point solve Differential equations are solved by dsolve difference equations are solved by L39solve recursive solve and Diophantine equations are solve by isolve integer solve In the linalg package if a set of linear equations is captured in the matrixvector format A X B then linsolve can be used Both solve and linsolve return general symbolic solutions when applicable In fact linsolve will even return solutions in terms of arbitrary parameters Other approaches to the solution of linear systems include the use of gausselinl followed by backsub or reef also followed by backsub Maple s com mand structure is rich enough that nearly any undergraduate mathematics that can be articulated in standard mathematical notation can probably be implemented in the context of Maple s builtin commands There are two cautions to observe when using Maple to solve linear sys tems First if the calculation is done in oating point arithmetic Maple is as liable to roundoff and truncation errors as any other numeric utility Second when working symbolically exact expressions for numbers can get dauntingly large thereby consuming memory and time Hence Maple can not solve symbolically systems as large as some strictly numeric utilities can solve by working in oats Exercise 1 Let A be the matrix from Exercise of Section 34 Solve the system A X B where 21 B 32 then convert the answer to oating point l39orm 14 Next convert both A and B to oats by mapping the convert oat operator onto them Resolve the system and compare the two oating point results See Exercise 4 in Section 23 34 llaple On Line 13 Exercise 2 In many applications of linear algebra numerical data comes from mea surements which are susceptible to error Suppose the vector 13 in Exercise 1 was obtained by measuring a vector Ba whose actual value is Ba 210 11 321 Compute the solution to the equation A Xa Ba 440 Measure error is the absolute value of the difference between the com puted value and the actual value It can be computed in Maple with the following command gt e mapabsevalmXXa Which component of the solution X computed in Exercise 1 has the largest error It might hepl to convert your answer to lloting point form In terms of the magnitude of the components of the inverse At l explain why this is the largest to be expected Maple computes the inverse of a matrix with the inverse command Which component of Ba would you change in order to produce the greatest change in Xa Why Back up your answer with a numerical example or with a symbolic calculation where the increments in Ba are parameters successively appearing in each component How much error could you tolerate in the measured values of the components of B if the absolute value of the error in any entry of X is to be at most 001 Exercise 3 Let A and B be as de ned below gt A matrix3311213121314131415 gtB vector8346 32 Find the solution to A X B As in Exercise 2 suppose the vector 13 was obtained by measuring a vector Ba whose actual value is Ba 8290 11 4007 Solve the equation A Xa Ba What is the percentage 3130 error in the least accurate entry of X How much error could you tolerate in the measured values of the components of B if the absolute value of the error in any entry of X is to be at most 001 44 34 llaple On Line Exercise 4 Exercises 2 and 3 demonstrate that the process of solving a system of equa tions can magnil39y errors in disastrous ways One quantitative measure of the inaccuracy of a calculation is the ratio of the percentage error in the final answer to the percentage error in the input data But what do we mean by the percentage error in a vector such as X in Exercises 1 and 2 in which every component might have errors of different magnitudes For vectors in R3 this question has a geometric meaning Think of X1 and X2 as representing points in R3 The distance d between these points is one measure of the error 1139 X1 1 yl z f and X2 12 12 A22f then 4m 2 11 WV 21 22V In Maple this can be computed as norm X1 X2 2 The additional 72 represents the 2norm 7 wherein differences are squared and the square root of the sum taken 1139 X1 is the computed answer and X2 is the actual answer we define the percentage error to be P 100 norm X1 X2 2norm X1 2 Let 13 Ba X and Xa be as in Exercise 2 Use the given formula to compute the percentage error in 13 ii the percentage error in X and iii the ratio of the percentage error in X to that in B This is the inac curacy ol39 the calculation of X from B Assuming that accuracy is desired do we want the number I to be large or small Explain b Compute the inaccuracy of the computation of X from B in Exercise 3 c For each n x n invertible matrix A there is a number condA the condition number of A such that the inaccuracy in solving the system A X B is at most condA regardless of B and regardless of the amount of error in B This means that if say condA 20 and the error in B is 001 then the computed value of X will have at most 20 x 001 02 error In general 1 g condA This says that we cannot expect the answer to be more accurate than the input data Maple has a builtin command for the condition number Since the condition number is constructed from a norm 7 of the matrix A we need to specify the version of the condition number we want according to the type of norm we want used Hence we will use the syntax condA2 In addition the 2norm of a symbolic matrix can be a very large and complex expression For this reason we will only compute the condition number based 011 the 2norm of matrices of oating point numbers 35 llaple On Line 15 Compute the condition numbers for the coeficient matrices in Exercise 1 and 3 Use this to explain the difference in accuracies obaine in these exercises Matrices with large condition numbers are called illconditioned If the coeflicient matrix of39 a system is illconditioned then we must be extremely suspicious of39 answers obtained by solving the system since any slight error in the input data can make the solution very inaccurate Notice that these inaccuracies are not related to roundoff error Illconditioning is intrinsic in the matrix and not in the method of39 solution 35 On Line Restart Maple clearing its memory of39 all defined variables Then re initialize by loading the firmly and sludcnl packages These exercises will explore LUdeconlp Maple s builtin command for obtaining the LL39 decomposition of39 a matrix The LL39decomp command can return seven different items namely L L39 a factorization of39 L7 into 391 and R a permutation matrix P the determinant of39 El and the rank of39 A We will not need all of39 these outputs and will restrict explorations to just L L39 and P The syntax for a multireturn Maple function is tedious Each variable that is to have a return assigned to it must be included in the command surrounded by single quotes Since the actual return of39 the LUdeconlp command is L39 we will not need to make a specific request for L7 to be returned Thus to obtain L L39 and any permutation P needed to complete the decomposition the appropriate syntax would be u LUdecomptA L l P p Of course if39 only L and L7 were desired then the command could be shortened to u LUdecompA L 1 Exercise 1 Enter the Matrix A from Example 1 of39 the text then obtain the LL39 de composition by using the LUdeconlp command Assign the output of39 this command to the variable u and let 1 be the lower triangular factor This 46 35 llaple On Line matrix will not need a permutation P so it can be omitted from the com mand Finally verify that A l u You may need to use either print or evalrn to view the contents of 1 Exercise 2 Before examining the consequences pivoting has 011 the LL39 decomposition we study the notion of a matrix factorization When we demand that A be l39actored into the product LL39 with L being a lowertriangular and I being an uppertriangular matrix we are asking for the solution of a set of equations For example if A is a given 3 x 3 matrix then finding matrices L and If such that ALU is equivalent with solving a system of nine equations where each equations is obtained by setting one entry of A equal to the corresponding entry 0139 LL39 In this exercise we investigate this system for the matrix A of Exercise 1 Begin by forming L and 1 3x3 matrices of indeterminates Lij and Uij Maple s Inatrix command with appropriate il39statements as an option will create the desired matrices gt L matrix33ijgt if iltj then 0 else Lvivj ii U matrix33 ijgt if igtj then 0 else U ivj fi Multiply L and 17 forming a template of indeterminates which we then demand reduce to the entries ol39A l39rom Exercise 1 above This gives a set of nine equations in twelve unknowns since there are six unknowns in each of L and If The solution of this set of equations will not be unique suggesting that we can impose an additional three conditions on the factorization gt LU evalmL amp U The product LL39 and the matrix A can be equated via the equate com mand from the sludcnl package This command returns a set of equations formed by equating corresponding entries of each matrix gt q equateLUA Typically the solve command needs a set of equations and a set of variables If no variables are suggested to Maple it will attempt to deduce what the unknowns ol39 the problem actually are That is convenient here since it would be tedious to enter the names of all the variables in these equations gt q1 solveq It is clear that we did not get a unique solution for the entries ol39L and If arel39ul inspection shows there are three indeterminates in the answer 35 llaple On Line 17 This becomes more evident if we substitute these solutions into the matrices L and L7 gt L1 subsq1opL U1 subsq1opU Exercise 3 Change the definition of the matrix L used in Exercise 2 Since there are three free parameters in the solution for the factors L and 1 choose to have the diagonal elements of L all be l s This can be done with an appropriate il39statement in the Inatrix command that defines L The matrix L7 will be the same as used in Exercise 2 Repeat the formation of nine equations in nine unknowns obtaining unique l39actors L and L7 for the matrix A in Exercise 1 Display the resulting matrices L and If and show that they are exactly the factors produced by the LUdeconlp command in Exercise 1 Exercise 4 In this exercise you will explore the concept of a permutation matrix P whose rows are a permutation of the rows of the identity matrix It a matrix A is multiplied by P the rows of PA will be permuted in the same way that the rows the identity were when forming P Let P be a permutation of the rows of the 4x4 identity This can be done in Maple by stacking a sequence of rows from the identity Create A a random 4x4 matrix and examine A PA and P gt Id diag14 gt P stackseqrowldk k 243311 gt A randmatrix44 gt PA evalmP amp A gt printAPAP Finally observe that for a permutation matrix P the inverse is the transpose gt printinverseP transposeP 48 35 llaple On Line Exercise 5 We wish to study the effect of pivoting 011 the LU decomposition For this we need a matrix A that forces a pivot If the LUelement of A were to be zero a pivot would have to be performed immediately since the rowreduction process by which we obtain L and U is basically gaussian elimination Create A a random 4x4 matrix and then reassign its 11 element the value zero Use the LUdecornp command to obtain the LU decomposition this time including parameter P p so that a permutation matrix p will be returned To have Maple display p l and u sidebyside use the print command gt 11 LUdecompAL l P p printplu Use the print command to display sidebyside the product lu the matrix A and the product plu You should observe that the product lu does not reproduce A That is the effect of pivoting Whenever rows must be interchanged during the factorization these interchanges are recorded in the matrix P The resulting LU factorization is then a factorization of Phi A not A resulting in the equality Phi A LU Thus A PLU not just LU Chapter 4 Orthogonality 41 On Line Restart Maple to clear its memory of all de ned variables and reinitialize by loading the linalg 11015 511116711 and 110110015 packages Given the vectors Ql we will generate a 11 and 2 coordinate grid corresponding to a space in which Ql and 2 are the ba sis vectors VVe will plot the skewed grid lines in red atop a standard coordinate system in black gt Q1 vector11 Q2 vector12 The vector equation of a line through the tip of the vector Ql and parallel to the vector 2 is given by Rtt 1 t 2 To form parallel lines through the tip of 2 1 3 1 etc we need to form the vectors k Ql t 2 with k an integer in some interval Alternatively the equations of lines parallel Ql through the tip of 2 2 2 etc we for the vectors k 2 t 1 In every case we let t the parameter of the line range over an interval bb Maple s seq command can be used to generate an appropriate sequence of vector representations of the grid lines Plotting them in red will product the desired grid A template for the vector form of each set of grid lines is obtained as gt P1 evalmkQ1tQ2 P2 evalmkQ2tQ1 Sequences of equations of the skew grid lines are formed with the seq command 49 50 41 llaple On Line gt 51 seqP11P12t55k55 2 seqP21P22t55k The plot of the grid lines is assigned to the variable 11 so that it can be used again in one more activity We include the scaling parameter in the plot command A 11 scaling can also be imposed interactively from the toolbar A view window is also set in the plot command gt f1 plotsl 52 colorred scalingconstrained View 6 66 61 For a finishing touch we use the arrow command from the 110110015 package to draw Ql and 2 the basis vectors of the skew coordinate system We plot the first in green and the second in blue superimposing both 011 the skewed red grid gt a1 arrow00 1 2 2 4 2colorgreen a2 arrow 00 1 1 2 display f1 al a2 Exercise 1 Modify the commands in the Introduction to produce red grid lines corre l I i Q l 2 anc 2 7 2 produce a graph showing the skewed grid lines and the basis vectors in green and blue Assign this graph to a variable so that it can be reused in Exercise 4 sponding to the basis vectors Ql In addition Exercise 2 The curve de ned implicitly by the equation 1 2 g l is a hyperbola that will be plotted in Exercise 3 Here show that in the basis of Exercise 1 with coordinates u and v the equation of this hyperbola is 411 v 1 Begin by deducing the equations of the transformation The point ma trix M is constructed with columns Ql and 2 Letting X 1 and U the transformation equations are X M U The vectors X and M U can be equated with the equate command from the student package The equation X M U de nes the change of basis from rycoordinates to tuxcoordinates Once these equations are obtained Maple s subs command can be used to impose this change of coordinates 011 the equation of the hyperbola An appropriate syntaxt might be gt q1 equateX MU 42 llaple On Line 51 gt 12 x 2 y 24 1 gt 13 subsq1q2 gt 14 simplifyq3 Exercise 3 Use Maple s iniplicitplot command from the plots package to obtain a graph in the xycoordinates system of the original hyperbola Assign the graph to a variable so that in Exercise 4 it can be reused Be sure to use ll scaling so that no distortion is introduced by the computer screen gt g3 implicitplotq2x10 t 10y10 t 10colorblack scalingconstrained g3 Exercise 4 Use Maple s display command to superimpose 011 the skewed grid lines of Exercise 1 the graph of the hyperbola l39rom Exercise 3 Then use Maple s digitizer click 011 the graph click 011 a point in the graph read the coordi nates in the window at the topleft ol39 the graphics toolbar to approximate the coordinates of some point 011 the hyperbola By counting and esti mating infer the corresponding uvcoordinates Show that to within the accuracy of the digitizer your coordinates satisfy the equation of the hy perbola in the ry system and in the uv system For exampl the point 24 appears to be almost 011 the hyperbola The digitizer gives 2 35 The same point appears to be 2 01 in the skew grid Hence gt subsx2y35q2 gt subs u2v 1 q l 42 On Line Restart Maple clearing its memory of all de ned variables Then re initialize by loading the linalg and sludcnl packages You are working for an engineering rm and your boss insists that you find one single solution to the following system 2x3y4z3w 129 52 42 JIaple On Line 4c7y Gz 839w 7l 6clOy 2z 5w59 You object noting that The system is clearly inconsistent the sum of the first two equations contradicts the third b You need at least four equations to determine four unknowns uniquely Even if the system were solvable you couldn t produce just one solution The boss won t take no for an answer oncerning the boss points out that the system was obtained from measured data and any inconsis tencies can only be due to experimental error Indeed if any one of the constants 011 the right sides of the equations were modified by 1 units in the appropriate direction the system would be consistent oncerning b the boss says Do the best you can We will pass this data 011 to our customers and they wouldn t know what to do with multiple answers After some thought you realize that projections can help with the ill consistency problem The given system can be written in vector format as 2 3 4 3 129 1 4 y 7 z 6 10 8 71 6 10 2 5 59 You realize that this system would be solvable if the vector 011 the right side of the above equation were in the space spanned by the four vectors 011 the left Using Maple s rank command you quickly compute as 2 the rank of the system matrix A 2 3 4 3 A 4 7 G 8 6 10 2 5 showing that these four vectors in fact span a plane all this plane W 129 Your idea is to let Bw be the projection of B 7l onto W 59 Since the system is so nearly consistent Bw should be very close to 13 Furthermore the system A X Bw should certainly be solvable and one of the solutions should be what the boss is looking for Your point b will require some further thought However you do eventually come up with an idea which will be described in the exercises which follow 42 llaple On Line 53 Before going 011 to the exercises it will be useful to enter the data of this system of equations Enter the matrix A and the vector 13 Convert B to exact rational fOI39Hl and call that vector b Compute the rank of A verifying that it is indeed 2 gt A matrix34234347 6398610 392 395 gt B vector1297159 gt b mapconvertBrati0na gt rankA Exercise 1 Find an orthogonal basis for the column space ofA use the Fourier Theorein to obtain Bw the projection of 13 onto W the column space of A Then solve A X Bw expre ing the solution in parainetric fOI39Hl Write X as a sum of a 7 translation vector and vectors in the null space of A Show that the translation vector Maple finds is not orthogonal to the null space of A First obtain an orthonormal basis for the span of the column space of A Since the columns of A are not linearly independent A has rank 2 determine via L39L39ef which two columns of A to take as independent and pass those two vectors to Maple s GraInSchInidt command for orthogo nalization This command returns a list of lists not vectors so map the converttovector operator onto this output You will now have a list of two orthogonal vectors A11 appropriate syntax might be gt q mapconvertGramSchmidtcolA1colA2 vector Next apply the Fourier Theorein to get Bw the projection of 13 onto W the column space of A Work with b the exact version of the vector 13 The formula in the Fourier Theorein is implemented in Maple much as it is written inatheinatically Reference the basis vectors as ql and q2 coinpute dot products with Maple s dotprod command and norms with Maple s IlOl IIl conunand being sure to compute the 2nor1n Next solve the system A X Bw Maple s linsolve command will yield the general solution This general solution can be put into the fOI39Hl X T a v1 3 v2 where the vectors v1 and v2 are in the null space of A These vectors can be extracted fI39OHl this general solution by an adroit use of substitution via the subs conunand 54 42 llaple On Line Exercise 2 bjection b amounts to this If the system is inconsistent there is no solution If the system is consistent there are many solutions Even the use of projections in Exercise 1 has yielded a general solution that is not unique Perhaps your first thought was to report the translation vector as the solution But there is nothing special about this vector and the Translation Theorem says the general solution can be expressed using any particular solution not just the translation vector Your next idea however is sound With T as the translation vector let Tn be its projection onto the null space of A Report to your boss the solution X T Tn Why is this X a solution Use Maple s nullspace command to find a basis for the null space of A Then use the Fourier Theorem to obtain the projection of T onto this null space Finally l39orm T Tu and explain why this is a solution Note however that the Fourier Theorem assumes an orthogonal basis for the space into which the projection occurs Hence you will need to apply Maple s GraInSchInidt command to the basis for the nullspace Remem ber though that GraInSchInidt returns a list of lists requiring us to convert the sublists back to vectors an was done in Exercise 1 Exercise 3 Try computing X in Exercise 2 by starting with a solution other than T You should get the same X Why It can be shown that the X found in Exercise 2 is the solution of minimal length Exercise 4 Show that of all solutions to A X Bw the one with minimal length is the solution X computed in Exercise 3 For this let ql be the general solution found by Maple in Exercise 1 considered as a twoparameter family of vectors Compute the 2norm and use calculus to minimize this norm The resulting solution should be the same X that was computed in Exercise 3 Hint Use the subs command to repace the free parameters tl and t2 used by Maple with a and b calling the result Xg Now obtain the 2norm ol39 the vector Xg Since Xg is a symbolic vector Maple returns the norm with absolute values thereby making it dif cult to differentiate and set derivatives equal to zero Simplify the norm of Xg adding the parameter symbolic to coax Maple to simplify the absolute values 43 llaple On Line 3v u gt f simplifynormXg2symbolic Differentiate with respect to a and 7 Use Maple s solve command to solve the system obtained by setting these partials equal to zero as follows Finally substitute these values into Xg and cmpare with X gt fa difffa fb difffb solvefafb ab gt 6161 Exercise 5 Maple would have found the least squares solution of minimal norm with its builtin leastsqrs command Verify that this command yields the solu tion X found in Exercise 2 Note the inclusion of the parameter oplimizc which signals Maple to find the solution of minimal length Without this parameter the leastsqrs command will return the general solution found in Exercise 1 as the vector in ql gt leastsqrsAboptimize gt leastsqrs Ab Exercise 6 Alter giving the boss your answer you delete all your data except for A and X A month later the customer calls saying WV know that there must be other solutions Could you please provide us with the general solution 7 Show how the general solution can be reconstructed from A and X with a single Maple command 43 On Line Restart Maple to clear its memory of all previously defined variables Then reinitialize by loading the linalg and plots packages In addition enter the following lines of Maple code This code written by Dr Mike Monagan of Simon Frasier University in Burnaby British olombia Canada creates a function that will generate the periodic extension of a function The code first appeared in the article Tips for Maple Users and Programmers illaplrtT IL VOL 3 NO 3 1996 published by Dirkmus PE 7 procl39 drange subsT l39 L lhsd D rhsdlhsd procxalgebraic local y y lloorxLD FxyD end end 56 43 llaple On Line These lines of code can be entered into a separate Maple worksheet and that worksheet saved Later it the code is again needed that worksheet can be opened and the lines copied and pasted into the active worksheet There are of course other ways of saving code and making it accessible more easily but some aspects of that process are platl39orin dependent and will not be discussed here Exercise 1 Figure l of Section 66 in the text depicts a sawtooth function called a rasp Plot the first fourth and tenth Fourier sine approximations to this function The rasp is generated by the periodic extension of the function l39x x for x in the interval 11 To get Maple to plot the periodic extension of l39x use the function PE de ned in the Introduction above First be sure to define l39x with Maple s arrow notation thereby making 139 a function not an expression gt fxgtx De ne the function whose name is rasp as the periodic extension hence PE 0139 the function whose name is 139 Do this by applying the PE operator to 139 being sure to terminate the command with a colon since the output will look strange and probably unintelligible The arguments to PE are the function to be extended and the domain of the function being extended gt rasp PEf11 Obtain a graph of the rasp 011 the interval 33 assigning the plot to a variable for use later The plot option disconl rue signals Maple to observe the discontinuities in the function and tells it not to connect across the uinps gt f1plotraspxx3 3 disconttrue colorblack scalingconstrained thickness3 f1 Obtain the Fourier sine series coef cients 0 5in L L Here I l and l39x x An integral can be entered into Maple with the Int command which stores the integral as an unevaluated symbol 139 instead the integral is entered with the int command the evaluation of the integral is immediate Here Int is used so that the integral will be displayed coinpletely gt q 2IntxsinnPix xO v 1 43 llaple On Line Cl 1 To evaluate an integral that has been entered with Int apply Maple s value command to the integral gt q1 value q We wish to simplify this expression For example mm 7r is zero when ever 11 is an integer We will tell Maple that n is an integer with its assume command However that will cause Maple to attach a tilde V to each n it prints thereal39ter Suppressing the attachment of the tildes can be done either interactively from the Options menu Options Assumed Variables No Annotation or from the command line with the following interface command gt interfaceshowassumed0 Now use the assume command to tell Maple that n is an integer gt assumeninteger If the Fourier coef cients are now simplified they will appear much like they would if the calculation were done 7 by hand quot Note how in the interest of simplicity we assign the result to the name b and not to something that tries to re ect the dependence 011 n gt b simplifyq1 The Fourier approximations are simply partial sums of the Fourier se ries The first approximation pl is just 1 sintirx and the tenth one is 210 210 0 mm 726 We can obtain these expressions in Maple by using its sum command gt p1sumbsinnPix n1 v 1 p4sumbsinnPix n1 p10sumbsinnPix n1 v 10 Finally these three partial sums can be plotted with a single plot com mand by grouping the functions in a list olors can be assigned to the functions by the option color with matching colors being listed in the order of the functions to which they are being ascribed Assigning the plot to a variable allows merging via the display command of the plots package the approximations with the graph of the rasp created above gt f2 displayf1f2 plotp1 p4p10 x3 3colorred green blue A 58 43 llaplc On Line Exercise 2 1 gr lt 0 4 Let g c l 0 lt t a p1ecew1se defined function btain Fourier s1ne approximations withil 8 and 20 sine functions The periodic extension of gx is called a square wave Note the ear like peaks which appear in the graph of the partial sums at the discontinu ities of fx These peaks are referred to as the ibbs phenomenon They are quite pronounced even after twenty terms of the Fourier series Their existence shows that it takes a very high fidelity amplifier to reproduce a square wave accurately For this reason square waves are sometimes used to test the fidelity of an amplifier Begin by defining gx as a piecewise function 011 the interval 11 Use Maple s piecewise function which permits the definition a function with multiple formulas Define g as a function by using the arrow notation gt g x gt piecewisexltO1xgt01 Check the behavior of gx by plotting it again using the plot option disconl rue so that jumps in the function are not connected gt plotgxx1 1disconttrue color black Define G as the periodic extension of the function g Use the PE code detailed in the Introduction Again end the command with a clon since the echo will probably not make much sense to the typical student of linear algebra Plot G 011 the interval 33 assigning the plot to a variable for use later As in Exercise 1 the Fourier sine coeflicients 0 are computed by inte grating gx Enter the defining integral using int and gtx The presump tion here is that the interface and assume commands are still operative from Exercise 1 If not reexecute those commands Exercise 3 Obtain the thirtieth partial sum of the Fourier sine series for the function 1 1 g gr g 1 then graph the periodic extension of fx and the Fourier approximation Explain why the graphs don t agree See Exercises 6 and 7 of Section 66 Exercise 4 Obtain a Fourier cosine series for the function in Exercise 3 Plot the first fourth and eighth partial sums 44 llaplc On Linc 59 44 On Line Restart Maple to clear its memory of all de ned variables and reinitialize by loading the linalg and plots packages Let be the matrix of a counterclockwise rotation around the r axis and through an angle of radians Let RA be the matrix of a counterclockwise rotation around the y axis and through an angle of radians Let A Egg Since the product of two orthogonal matrices is orthogonal A is orthogonal The purpose of these exercises is a demonstration that A de nes a rotation about a fixed axis and through a particular angle See Figure 5 in Section 44 of the text Points on this axis remain fixed under the rotation Thus if X is 011 the axis of rotation it will satisfy AX X or equivalently A IX 0 Exercise 1 Construct the matrix A as the product of the matrices and Egg Exercise 2 Find an X 011 the axis of rotation by using the equation A IX 0 Thus X is in the null space of A I Such an X can be found by applying Maple s nullspace command to A I which Maple lets us form via the syntax A l The nullspace command returns a set of vectors so X will have to be extracted from this set Exercise 3 Plot the line segment from X to X If we parametrize this line segment as tX we can plot it with the spacecurve command letting t lie in the interval 11 Assign this plot to a variable so it can be used in a later exercise gt Hi evalmtX gt f1 spacecurvetXt1 v v 1 colorblack axesboxed scalingconstrained labels x y z labelfont TIMES BOLD 14 f 1 60 44 llaplc On Line Exercise 4 The plane P through the origin perpendicular to X is called the 7 plane of rotation Since this plane contains the origin it is a subspace of R3 If the vector X is converted to a 1 x 3 matrix Maple s nullspace command will produce a basis for the plane P the null space of the matrixl39orm of X Why btain this basis nameing its elements N1 and N2 Plot line segments through N1 and N2 as was done in Exercise 3 Join this plot with the one from from Exercise 3 with display3d from the plots package and assign the merged graphs to a variable for use later in Exercise 4 Be sure to use a 11 aspect ratio so that orthogonal vectors appear orthogonal The conversion of X to a matrix is accomplished by Maple s convert command with matrix as the parameter This will be a 3 x 1 matrix which the nullspace command will reject Apply the transpose operator to produce a l x 3 matrix to give to the nullspace command Maple s nullspace command does not yield normalized vectors After obtaining the basis of the null space normalize the vectors with Maple s normalize command Show that the basis vectors are not necessarily orthogonal to each other They are orthogonal to X Use Maple s dotprod command to compute the dot products of vectors Exercise 5 The expectation should be that multiplication by A rotates elements within the plane orthogonal to the axis of rotation To test this hypothesis mul tiply both N1 and N2 by A Then use Maple s angle command to find the angle between N1 and A N1 and between N2 and A N2 A second multiplication by A should rotate A N1 and A N2 by the same amount Verify this Exercise 6 Continue to explore by visual means the idea of rotations in the plane P Create a plot of 15 successive applications of the matrix A to the basis vectors found in Exercise 2 If each application of A rotates these basis vectors through a fixed angle and if they remain in P their collective image should show 7 the plane P Since working with exact expressions can lead to memoryconsuming expression swell it is wise to convert the computations to the numeric 45 llaple On Line 61 domain Map the convert operator with the oal option onto the ma trix A and the vectors N1 and N2 coining new names for these numeric versions For example we might call the floating point versions of these quantities B NNl and NNZ respectively Multiplication of NNl by B ktimes produces BkNNl We can pro duce the desired plots using Maple s seq command as follows Finally use display3d to merge these plots with the plot from Exercise 4 gt51 seqevalmtB k amp NN1k115 2 seqevalmtB k amp NN2k1 15 gt f4 spacecurveslt0 1colorblue f5 spacecurves2t0 1colorgreen Exercise 7 Determine in the plane P the angle of rotation caused by multiplication by A Use Maple s angle command but express the answer in degrees as a oating point number 45 On Line Restart Maple to clear its memory of all defined variables and then re initialize by loading the linalg and plots packages Exercise 1 Imagine that you are an astronomer who is investigating the orbit of a newly discovered asteroid You want to determine what is the closest the asteroid will come to the sun and b what is the furthest away from the sun the asteroid will get To solve your problem you will make use of the following facts Asteroids have orbits which are approximately elliptical with the sun as one focus b In polar coordinates an ellipse with one focus at the origin can be described by a formula of the form H c lasin lzcos9 G2 45 llaple On Line where a b and t are constants You have also collected the data below where 7 is the distance from the sun in millions of miles and 0 is the angle between the vector from the sun to the asteroid and a fixed axis through the sun The data is of course subject to experimental error 0 0 6 18 14 21 32 54 7 32927 3138 31949 31091 32788 37491 36749 Your strategy is to use the given data to find values of a b and t which make the formula for the ellipse to agree as closely as possible with the given data This will involve setting up a system of linear equations in a b and C and solving the normal equation Give the augmented matrices for both the original system and the normal equation You will then graph the given formula and measure the desired data from the graph Note Once you have found values ol39a b and c you will need to plot the orbit of the asteroid This can be done with the following command where r is the function that defines the ellipse gt p3 plot rt tO v 2Pi coordspolar Retrialk As stated this is an inherently nonlinear problem which we solve using linear equations There are more accurate techniques based 011 inultivariable calculus These techniques are also considerably more coinplecated than our solution Exercise 2 Maple has a leastsqrs command from the linalg package that is easier and better for solving least squares problems than simply solving the normal equations Use this command to solve the overdetermined linear system developed in Exercise 1 An appropriate syntax is as below where A is the coef cient matrix for the system and F is the vector of constants 011 the right side of the equations gt leastsqrs AF Chapter 5 Determinants Determinants are extremely useful in many contexts You will for example use them constantly when you study eigenvalues and eigenvectors later in the text In addition you will see them used to write formulas for the solutions to many applied problems In particular determinants are used extensively in the study of differential equations and in the study of advanced calculus Determinants are also used extensively in studying the mathematical foundations of linear algebra omputers however do not generally use determinants for computations Much faster and more ef cient numerical techniques have been found Thus we will not provide any computer exercises for this chapter The reader should be aware however that Maple will compute deter minants The appropriate command is detA Incidentally Maple uses the methods of the next section to compute determinants rather than the methods already described 63 64 51 llaplc On Linc Chapter 6 Eigenvectors 61 On Line Restart Maple to clear its memory of all variables and reinitialize it by loading the linalg package In the On Line section for Section 51 we commented that virtually anything you might use determinants for a computer would do otherwise This includes finding eigenvalues Algorithms for computing eigenvalues are very sophisticated and will not be described in this text However we will point out that the techniques do not involve finding the characteristic polynomial and determining its roots In fact the numeric recipes for finding eigenvalues are so good that they are often used to find roots of polynomialsl The exercises in this section explore this idea Exercise 1 l b a polynomial is A2 a A 0 Use this to construct a matrix Al which has 1 A A2 7 A l as its characteristic polynomial Check that your matrix has the correct characteristic polynomial using Maple s charpoly command Note The charpoly command requires that you name the variable to be used in the characteristic polynomial Thus an appropriate syntax might be If A is the matrix 1 show by hand that the characteristic gt p1 charpoly A lambda Also Maple uses cletM I Ap clet l I as the definition 65 66 61 llaplc On Linc ol39 the characteristic polynomial The relation between the two is that if A is n x n then the characteristic polynomial we compute in the text is 11 Use Maple s eigenvals command to compute the eigenvalues of Al and hence the roots ol39pl A Note A11 appropriate syntaxt for the solve command is gt solvep1 01ambda Exercise 2 0 l 0 Compute the characteristic polynomial for the matrix A 0 0 l c b a Use this result to obtain the roots of the polynomial le A3 8 A2 17 A 10 Test the roots by substitution back into Exercise 3 Let A1 be the matrix obtained in Exercise 3 Obtain the eigenvectors of Al normalizing them so the first element in each is 1 What do you then notice about these eigenvectors Use the pattern you articulate to give a general prescription of the eigenvectors of an n x 11 matrix of the form A Prove your answer The eigenvactors for Al may be computed using the following command gt q eigenvectsA2 Note that there are three lists in q and in each list there are three members The first member of each list is the eigenvalue The second member of each list is the algebraic multiplicity the number of times that eigenvalue is a root of the characteristic equation The third member of each list is a set of eigenvectors Here each such set contains a single eigenvector Hence these eigenvectors can be referenced as follows gt v1 q1 3 1 v2 q2 3 1 v3 q3 3 1 Exercise 4 Find a 4 x 4 matrix A whose characteristic polynomial is A43 A2 5 A 7 Obtain the roots of this polynomial by finding the eigenvalues of the matrix A Check your result with Maple s solve command 62 llaple On Line 67 The matrix whose characteristic polynomial is is known in math ematics as the companion matrix Maple has the builtin command corn panion for finding the companion matrix for a polynomial Maple gener ates a companion matrix that is the transpose of what you might find in some differential equations texts gt p x 4 3x 2 5 7 gtA transpose companion p x Find the eigenvalues of A gt eigenvalsA Maple has expressed the roots of the characteristic polynomial with its Rootlquot7 notation This is a shorthand for what could be large and complex expressions for the exact value of the roots There are several options available at this point First apply the allvalues command to the RootOl39 structure This will return the eigenvalues as exact values containing complicated expressions involving radicals gt q eigenvalsA gt q1 allvaluesq These expressions are too unwieldy to work with onvert them to oating point numbers with the evalf command gt eva1fq1 Another alternative is to include at least one oating point number in the matrix A When eigenvals sees the oat it will compute the eigenvalues numerically gt A1 mapconvertAfloat gt eigenvalsA1 Finally solve the equation 0 numerically by using the fsolve command For polynomial equations this command accepts the parameter complex to indicate that all roots both real and complex are to be found gt fsolve 1 complex 62 On Line Restart Maple to clear its memory of all variables then reinitialize by loading the linalg package G8 62 llaple On Line Create your own eigenvalue problem by constructing a 3 x 3 matrix A with prescribed eigenvalues and eigenvectors The eigenvalues are the diagonal elements in a diagonal matrix D while the eigenvectors are the columns of a 3 x 3 matrix P A simple way to construct the eigenvector matrix P is as a random matrix Hence define l39 a function which generates random integers in the interval 1010 gt f rand1OH10 Let P be a random 3 x 3 matrix with entries determined by l39 gt P randmatrix33entriesf Let the eigenvalues be 2 2 and 3 in that order Create a diagonal matrix with these elements 011 the diagonal but assign the matrix to the name d not D The letter 7D in Maple is reserved for one form of the differentiation operator and Maple will not let you assign to it gt d diag223 The matrix A PDPVU will have eigenvalues 2 2 and 3 in that order and will have the columns of P as eigenvectors in corresponding order gt A evalmP amp d amp inverseP Exercise 1 By computing A X for each column X of P verify that each column of P is an eigenvector of A Columns 0139 P can be referenced by Maple s col command learly A X A X must hold for each eigenpair ol39 eigenvector X and eigenvalue A Exercise 2 Verify that the diagonal elements of D are the eigenvalues of A by using Maple s eigenvals command to determine the eigenvalues of A directly from A itself There is however no canonical ordering for the results of this command so Maple need not order the eigenvalues as 2 2 3 gt eigenvalsA 62 llaple On Line 69 Exercise 3 By applying Maple s eigenvects command to A again verify that the columns of P are the eigenvectors The eigenvects command returns lists with three members in each list These three members are first the eigen value second the algebraic multiplicity of the eigenvalue the number of times the eigenvalue was a root of the characteristic equation and third a set of eigenvectors associated with the eigenvalue in the list Extract the eigenvalues and eigenvectors by adroit use of the selector bracket notation See Exercise 3 in the On Line exercises for Section 61 Again there is no canonical ordering for the lists produced or for the eigenvectors associated with an eigenvalue of multiplicity greater than 1 Executing the eigenvects command 011 different occasions can result in a different ordering each time The eigenvectors computed by the eigenvects command may not 7 look like the columns of P The columns of P may be constant multiples of the corresponding vectors or in the case of multiple eigenvectors the columns of P could simply be a different basis for the eigenspace associated with the repeated eigenvalue Compare the third column of P with the eigenvector Maple found for the eigenvalue 3 determining any multiplicative factor needed to make the eigenvectors match exactly To show two bases P1 P2 and v1 by are equivalent you need to show that linear combinations of one set of basis vectors yield the other basis vectors Use the L39L39ef command 011 a matrix containing as its columns the first two columns of P and the eigenvectors Maple found for the eigenvalue 2 How will this show the equivalence of the bases Exercise 4 For the n x 11 matrix A the characteristic polynomial has been defined in this text as cleffl AI Some texts use clefAI A thereby making the two definitions differ by a factor of 1 Maple s builtin charpoly command for generating the characteristic polynomial uses the latter convention The advantage of Maple s definition is that for an n x 11 matrix the highest order term In Maple compare these two methods for obtaining the characteristic polynomial The charpoly command takes as arguments the matrix A and a variable to be used in the output polynomial Maple computes determinants via the let command and also allows the syntax A A as a short form of A A I Finally typing out the name of the Greek letter A causes Maple to print that letter as a Greek letter gt charpolyA lambda 70 63 llaple On Line gt detAlambda Note that the two polynomials are just negatives of each other There is only one degree three polynomial with roots 2 2 and 3 that has A3as its highest degree term What is this polynomial IIint Write it as a product of linear factors and then expand Note that this is the characteristic polynomial ol393A3 as found by Maple 63 On Line Restart Maple to clear its memory of all de ned variables and reinitialize by loading the linalg package In the xerc1ses complex numbers will appear Maple uses the letter 7I 7 l39or so that the complex number z 2 3 iis entered into Maple as z 2 3I It is also useful to remember that if z 2 3 i then 3 2 3139 is the complex conjugate of z Thus the complex conjugate of a real number x is that real number itself since the imaginary part the part with the i is zero Maple s command for conjugating a number is conjugate Its com mands for extracting the real and imaginary parts of a complex number are Re and Im respectively In purely numeric contexts these commands usually need no additional boosts In symbolic and exact contexts these commands generally work only if an additional evalc evaluate complex is applied Thus gt Re2 3I Im2 3I but gt Rex Iy Imx Iy thereby requiring gt evalcRex Iy evalcImx Iy Exercise 1 Ifse Maple s eigenvects command to obtain the eigenvalues and eigenvec l 3 l 1 that the eigenvalues are complex conjugates as are the eigenvectors as well tors of the matrix A 1 from Example 2 of section 53 Notice 63 llaple On Line 71 Exercise 2 A11 11 x 11 matrix A with complex entries is said to be Hermitian if the conjugate of the transpose equals A Thus A is Hermitian if A A A moment s re ection reveals that the conjugate of the transpose equals the transpose of the conjugate that is At Some texts denote the conjugate transpose of A by the symbol Aquot so that Aquot A and A is Hermitian provided A Give an example of a 3 x 3 Hermitian matrix containing as few real numbers as possible and having no entries zero To verify that your matrix is Hermitian you need to take both the transpose and the complex conjugate Maple has the builtin htranspose command for this Apply it to your matrix A and then separately apply the transpose and conjugate commands In Maple the simplest way to do this is to map conjugate onto the transpose of A gt htransposeA gt mapconjugate transpose A ne remarkable property ol39Hermitian matrices is that their eigenvalues are real Apply Maple s eigenvals command to your matrix A in an effort to verify the truth of this claim You will most likely obtain large compli cated expressions for the symbolically exact eigenvalues They might even contain the symbol 1 making it look like the eigenvalues are complex To determine if these eigenvalues are real you want to show that for each the imaginary part is zero After obtaining the exact eigenvalues convert them to oating point numbers by using the evalf command Since eigenvals returns a sequence of eigenvalues you may need to convert this return to a list use before the evalf command works The conversion to decimals of any radicals in your eigenvalues may yield expressions with very small imaginary parts You can instruct Maple to truncate these small numbers to zero by using the fnornial command Instruct Maple to extract and simplify the imaginary part of each eigen value These imaginary parts should reduce exactly to zero Remember to use both evalc and 1111 as well as simplify 011 each exact eigenvalue Obtain the exact real part of each eigenvalue These expressions will be real but complicated The point of the activity is for you to realize that exact values for the roots of cubic equation are unpleasant expressions to work with Just because Maple is able to provide the roots exactly does not mean that these expressions are always useful or simple Finally apply evall39 directly to the exact real parts of the eigenvalues 72 63 llaplc On Linc Compare the values to what you got when oating the unsimplilied com plex version of the eigenvalue Exercise 3 Change one of the entries of A from Exercise 2 making A nonIIermitian Then recalculate the eigenvalues Are they again real Make the change to A in Maple by creating a matrix B via substitution of a new value into the matrix A Reference an element of A say the llelement by All and make a substitution of a new value for such an element into opA not just into A Choosing the new value to be a oating point number will mean that eigenvals will return oating point numbers directly Since Exercise 2 made a thorough study of the complexity of exact calculations work numerically in this exercise Exercise 4 For the matrix A of Exercise 2 compare the action of transpose and htrans pose Is there any difference if these operators are applied to matrices with just real entries Exercise 5 In Maple let A be a real symmetric 3 x 3 matrix with as many ol39its entries as possible distinct btain B I iA where I is the 3 x 3 identity matrix and i Let T I 131 and compute both 7 quot and Cquot 7 Can you prove that what you observe is always true IIint Begin with the equality B Bquot 2 I and multiply by B l 011 the left and by B t llon the right Notes To generate a random symmetric matrix in Maple add the pa rameter sylmnclric to the randnlatrix command gt A randmatrix33symmetric The matrix B can be obtained in Maple it due note is taken of Maple s usage ol39I for the imaginary unit and due care is taken to distinguish between the written symbols I and i standing respectively for the identity matrix and the imaginary unit Since an identity matrix is a diagonal matrix with ust is 011 the diag onal the diag command can be used to create an identity gt B evalmdiag13IA 65 llaple On Line 73 The matrix T likewise requires use of an identity matrix gt C evalmdiag13inverseB2 65 On Line Restart Maple to clear its memory of all variables then reinitialize by loading the linalg plots and 110110015 packages gt restart gt withlinalg withplots withplottools The purpose of this exercise set is to explore the relationship between eigenvalues eigenvectors and the geometry of quadratic forms Exercise 1 Use Maple s inlplicitplot command from the plots package to obtain a graph of the ellipse defined by the quadratic equation 624 12 1 Be sure to use a 11 aspect ratio so that there is no distortion in the scaling Then obtain A the matrix of the quadratic form de ned by this same equation This can be done by typing in A by clever use of partial differentiation or by Maple s hessian command Obtain the eigenvalues and eigenvectors of A gt q x 2 4y 2 1 gt implicitplot qx1 v v 1 y1 v v 1 scalingconstr ained By inspection we can write A l Alternatively we can note that A I W 1 where l39xy is the left hand side of the defining fyx fyy quadratic equation and subscripts denote partial derivatives Thus gt f lhs q gt fxx difffxx fxy difffxy fyx difffyx fyy difffyy The array of second partial derivatives of the form I W 1 is called fyac fyy the hessian matrix and is returned in Maple by the hessian command gt hessiangxy xy 74 65 llaple On Line Hence the matrix of a quadratic form is simply onehalf the hessian matrix The simplest way to get the 12 into the hessian is by including it in the quadratic function Else an evalrn is needed to multiply the hessian matrix by that 12 gt A hessianlhsq2 xy The eigenvalues and eigenvectors can be obtained by use of the eigen vects command We next seek to relate the eigenvalues and eigenvectors to the lengths of the semimajor and semiminor axes From the graph these re 1 and 12 respectively The eigenvalues are l and 4 respectively for eigenvectors that have the directions of the ellipse s axes Hence the scale factors by which to multiply the eigenvectors to get the semimajor and semiminor axes are l where k l 2 m Exercise 2 Using Maple s irnplicitplot command obtain a graph of the function de fined implicitly by the quadratic equation 2 12 1 y 1 2 1 Be sure to use an aspect ratio scaled to 11 It may also be edil39ying to increase the number of points used in the plot by adding the parameter numpoinls 1000 to the irnplicitplot command Assign the plot to a variable so that it can be reused in subsequent exercises Exercise 3 For the quadratic equation in Exercise 2 form the matrix A of the quadratic form de ned by the equation Use Maple s hessian command and check the result by taking partial derivatives of the left hand side of the deliri ing quadratic function Obtain the eigenvalues and eigenvectors of A via Maple s eigenvects command Extract and give unique names to the eigenvalues and eigenvectors btain oating point approximations for the eigenvalues and normalize the eigenvectors to have length l with Maple s nortnalize command Apply Maple s radsinlp command to the 2norm computed via IlOl IIl of each normalized eigenvector to verify that each indeed has length 1 Use the arrow command from the 110110015 package to superimpose the normalized eigenvectors 011 the graph of the ellipse De ne each arrow separately The arrow command takes five parameters a list of coordinates for the tail here the origin a list of coordinates for the point here the entries in the normalized eigenvectors then three sizing parame ters which experiment shows are well chosen as 05 l and 05 Color each 1 CI 65 llaple On Line arrow differently Then use the display command from the plots package to merge the graph of the ellipse and the two arrows into one graph To convert a vector to alist use the convert command with option 13951 Thus if the eigenvectors are named V1 and V2 you might eneter gt a1arrow 0 0 convert V1 list v 05 v 1 05 colorgreen gt a2arrow 0 0 convert V2list v 05 v 1 05 colorblue gt display p1 a1 a2 scalingconstrained Print a copy of this final graph of the ellipse with the normalized eigen vectors Exercise 4 n the plot printed in Exercise 3 draw in the axes determined by the eigenvectors On these axes put tick marks every quarter unit noting that each eigenvector is one unit long Use a ruler to guarantee the accuracy of your tick marks According to the general theory the ellipse should cross the new axes at points whose coordinates in the system determined by the eigenvectors are 30 0 ll 0 where M and A2 are the eigenvalues ol39A Veril39y this by estimating the appropriate coordinates from your graph Exercise 5 Verify in general that the scale factors 7 k l 2 indeed convert nor malized eigenvectors into vectors of precisely the length of the semimajor and semiminor axes Begin by obtaining oating point values 0139 Mix k l 2 Then scale the normalized eigenvectors by these factors Next use Maple s arrow command to build a plot of the ellipse and the newly scaled eigenvectors A plot of the ellipse and these new basis vectors should show that with this scaling the vectors coincide precisely with the semimajor and semiminor axes Exercise 6 Find the equation of an ellipse centered at the origin and for which the major axis is 4 units long and lies along the line determined by the vector 3901 l and for which the minor axis is 2 units long Hint If you 76 65 llaple On Line can gure out the eigenvalues and eigenvectors you then can find matrices Q and D for which A QDQf Where A is the symmetric matrix for the quadratic form corresponding to the ellipse Graph the ellipse and the scaled eig 1vectors for A demonstrating that the proper scaling of the eigenvectors gives them the lengths of the semimajor and semiminor axes Since the axes of the ellipse are orthogonal you need to get a vector orthogonal to the vector L1 This can be done in the plane by interchanging the x and ycoorclinates and negating one component of the resulting vector Even a casual inspection reveals Why this works

### BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.

### You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

## Why people love StudySoup

#### "I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

#### "I made $350 in just two days after posting my first study guide."

#### "Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

#### "It's a great way for students to improve their educational experience and it seemed like a product that everybody wants, so all the people participating are winning."

### Refund Policy

#### STUDYSOUP CANCELLATION POLICY

All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email support@studysoup.com

#### STUDYSOUP REFUND POLICY

StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here: support@studysoup.com

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to support@studysoup.com

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.