As usual start Maple and load all the linear algebra progams. If you still have some topics from previous labs to complete, feel free to work on them too after completing this lab. You can plot points using this command: > plot([[-1,5],[2,4],[3,-1]],style=point, symbolsize=30,colour=blue); The matrix for the exact fit quadratic for this system of equations is > E2:=<<1,4,9>|<-1,2,3>|<1,1,1>|<5,4,-1>>; Find the solutions to this system of equations to get the coefficients of a quadratic polynomial which you can define as > y:= x -> something * x^2 + something *x + something You can then plot this polynomial using: > plot(y(x),x=-1..3); Note that the curve passes through all three points. Check this using: > y(-1); > y(2); > y(3); Repeat with polynomials of degree 3 through these points: [-1,3], [-2,6], [4,-12] the system of equations in this cases is: > E3:=<<-1,-8,64>|<1,4,16>|<-1,-2,4>|<1,1,1>|<3,6,-12>>; Solve for a*x^3+b*x^2 + c*x +d using > LinearSolve(E3,free=t); to see that a=-t, b=t, c=10*t -3, d=8t. You can plot the family of polynomials of degree 3 like this: > with(plots); > p3j:=(-t*x^3 + t*x^2+ (10*t-3)*x + 8*t); > animate( plot, [p3j,x=-3..5], t=-5..5, trace=4, frames=50 ); To animate the plot you click on the image and then press the "play" button that is now in the toolbar at the top. Note how every cubic curve passes through all 3 specified points. When t=0 the cubic curve is actually a straight line, not a quadratic! Pick 5 random points and create the system of equations for a straight line through them as follows: > xv:=RandomVector(5,generator=-6..6); > M:=< xv | <1,1,1,1,1>>; > yv:=RandomVector(5,generator=-3..7); Use this command to plot your points: > plot((xv,yv),style=point, symbolsize=30,colour=red); Predict what slope and intercept you think your line will have. We can now create the best fit straight line as follows: > MTM:=Multiply(Transpose(M),M); > MTy:=Multiply(Transpose(M),yv); Find the solution to MTM times v = MTy, which gives the best fit line, by using RREF, inverses or by using LinearSolve. Find the differences between the polynomial and the data points. Now repeat with the same xv and yv to plot the best fit quadratic to your data and check the differences, and then the cubic. Verify that the sum of the squares of the differences of the quadratic are smaller than the sum of the squares of the differences of the line and both are smaller than those of the cubic. This was the lab test last year; re-assure yourself that you can do this! Note that we used a different room last year. This year you will get a random matrix similarly. We probably wont do eigenvectors this year, maybe inverses, this is just a hint to see who reads all of the text. ==== Unless otherwise specified, you can use any known command to answer.You can check your answers after completion with any commands. Do not look at the work other students are doing or communicate with anyone. I recommend that you SAVE regularly in case your computer crashes. Try to work sequentially, making sure your commands give the shown responses, do NOT erase or correct lines, just redo your calculation on the next line if you get an error. You will not lose marks for errors. To write comments in your worksheet use the # symbol, do this to put your name and registration number at the top of your worksheet: > # James Preen 20152613 Use > # the answer is ... because if any of your lines need further explanation. Save your work in your H:\ directory with your name somewhere in the filename and then please email the file to me at james_preen@cbu.ca Don't close Maple until you are sure I have the correct file. Once I have confirmed receipt you are free to leave. I will also have a flash drive too. Using this diagram, identify which Matrix you will be using: (or ask me where you are) E F D F E ========= b A B C A B o a C D E C r ======= d E A B F B F C D ======= C D E A door Students in the A position: M1 := Matrix(3, 3, [[-10, 2, 4], [-55, -7, 40], [-30, 0, 18]]) Students in the B position: M2 := Matrix(3, 3, [[8, -4, -4], [-12, 0, 18], [6, -3, -3]]) Students in the C position: M3 := Matrix(3, 3, [[24, 6, -24], [-5, 5, 0], [23, 7, -24]]) Students in the D position: M4 := Matrix(3, 3, [[-27, 60, -15], [-15, 34, -9], [0, 6, -6]]) Students in the E position: M5 := Matrix(3, 3, [[7, -4, -2], [3, 6, -6], [4, 8, -8]]) Students in the F position: M6 := Matrix(3, 3, [[8, -54, 28], [4, -9, 2], [6, -9, 0]]) Let M be your Matrix. Q1: (8 marks) Only using the command RowOperation to get an integer solution to M v = z where > z:=Matrix(3,1,[0,0,0]); Q2: (3 marks) Get the other eigenvalues of M using any suitable method. Q3: (6 marks) Find another eigenvector of M using Pivot or RowOperation, call it w. Q4: (3 marks) Multiply MatrixPower(M,2) and w to identify an eigenvalue of the square of M. Why wouldn't MatrixInverse(M) have w as an eigenvector too?