#------------------------------------------------------------------------------ # # Math 2270 sec. 3 Laboratory Assignment 4. # # Treibergs Due Nov. 2, 1998 # #------------------------------------------------------------------------------ # # Create a document in which you answer the following questions, using a mixture # of MAPLE computations and textual insertions (using "#" or text mode or handwrit- # ten text to comment .) Print out a copy and hand it in. Remember to put your name # and section number on your paper. # # # Subspaces and bases associated to linear transformations. # # Enter the following instructins MAPLE. (This file is not MAPLETEXT.) > with(plots):with(linalg): # # I.1. We begin by plotting the domain to be mapped. > P1:=conformal(z,z=-1-I..1+I,grid=[9,9],color=gold): # Plots the square [-1,1]x[-1,1] > unitvecs:=[[0,0],[1,0],[0.75,0.25],[1,0], [0.75,-0.25],[1,0],[0,0],[0,1]]: # List of points for arrow. You can soup this up if you wish. > P2:= plot(unitvecs,style=line,color=blue,thickness=3): # Plots the unit vectors (1,0),(0,1) and puts an arrowhead at (1,0). > display({P1,P2},scaling=constrained); # Displays the plots together. # # I.2. Enter two vectors. # The transformation g will map (1,0) to v1 and (0,1) to v2. > v1:=vector([0.3,0.9,1]); > v2:=vector([-1.1,-0.3,0.8]); > A:=augment(v1,v2); # Makes a matrix whose columns are the vectors. > g:=v->convert(evalm(A &* v),list); # Transformation acts by matrix multiplication. "Convert" changes vector to # list so graphics routines work correctly. # # I.3. Now plot the image under g of the square in R^3. > P1:=plot3d(g(vector([s,t])),s=-1..1,t=-1..1,grid=[9,9],color=gold): > P2:=polygonplot3d(map(g,unitvecs),color=blue,thickness=3): > P3:=textplot3d([[1,0,-0.2,X],[0,1,-0.2,Y],[0.2,0.2,1,Z]],color=black): > display3d({P1,P2,P3},axes=normal,scaling=constrained); # # # II.1. Bases of vector spaces associated to a matrix. > A:=matrix([[ 1 , 1 , 1 , 2 , 6 ], [ 2 , 3 , -2 , 1 , -3 ], [ 3, 5 , -5 , 1 , -8 ], [ 4 , 3 , 8 , 2 , 3 ]]); # To find a basis for the space spanned by the rows. > rowspace(A); # Give a basis for the range=space spanned by col vectors: > colspace(A); # Observe that the dimensions of these spaces is the same and equals the rank. > rank(A); # Finds a basis for the nullspace: > kernel(A); # # II.2. Here is another way to choose a basis for the column space. # This time we find the basis for the column space of A among the column # vectors. We pick off the column vectors. > vx:=col(A,1);vy:=col(A,2);vz:=col(A,3);vu:=col(A,4);vv:=col(A,5); > basis({vx,vy,vz,vv,vu}); # Finds a basis for the space spanned by the given set of vectors. # # II.3. Here is a way to extend the set of vectors to a basis. # Suppose that we're given a set of two vectors in R^4 which we wish to extend # to a basis of R^4. > v1:=vector([6,1,4,3]);v2:=vector([5,-2,-8,-6]); # Form a matrix with these as columns. Then augment with the identity and row # reduce. > EE:=band([1],4); > augment(v1,v2,EE); # The column space of this matrix certainly spans R^4. > rref("); # Since the pivots occur in columns 1,2,4 and 5, a basis for R^4 extending # {v1,v2} is {v1,v2,[0,1,0,0],[0,0,1,0]}. # # III. Fundamental theorem of linear algebra. # # Many authors call the following fact about m x n matrices A the # fundamental theorem of linear algebra: # colspace(A) and kernel(A^T) are orthogonal complements in R^m, # rowspace(A) and kernel(A) are orthogonal complements in R^n. # Two subspaces M,N in R^p are orthogonal complements if the union of M and N # spans R^p and all vectors of M are orthogonal to all vectors of N. # It suffices to check that union of the bases of M and of N span (why?) # and that all basis elemets of M are orthogonal to all basis elements # of N (why?) # # III.1. Suppose we wanted to verify the kernel of the transpose of A is a # space orthogonal to the range of A. # This follows already from the fact that A^T y =0 for y in the kernel of A^T. # (why?) But more generally, suppose we were given a basis for a pair of sub- # spaces, how could we check that each basic vector from one basis is orthogonal # to each basic vector from the other basis? For example, a basis for the kernel # of the transpose is a set of vectors basKT > basKT:=kernel(transpose(A)); # Form a matrix whose columns are the basic vectors. > KT:=transpose(matrix(convert(",list))); # A basis for the column space=range of A is basR. > basR:=colspace(A); # Form a matrix whose rows are the basic vectors from the second space. > RR:=matrix(convert(basR,list)); # Now matrix multiplication forms the inner products of each of the rows of the # first matrix with each column of the second > evalm(RR &* KT); # If this is the zero matrix, then all pairs of inner products vanish. # # III.2. Suppose we wanted to show that the union of these bases span R^4. # Take the union as a set of vectors. > basS:=basKT union basR; # Form a matrix whose rows are the vectors. > SS:=matrix(convert(basS,list)); # To see that the four rows span R^4? We can see that the four rows are # independent and thus span R^4 if there are no zero rows in > rref(SS); # Any other test here will do, such as >rank, >rowspace or >det # to see that SS rows span R^4. # # Questions # # 1a. Pick two vectors v1, v2 in R^3 which are linearly independent. Find a # linear transformation g : R^2 -> R^3 which sends (1,0) to v1 and (0,1) # to v2. Using MAPLE, make a plot of g([-1,1]x[-1,1]) which shows the range # of g. Label g(1,0) and g(0,1). Using the mouse, rotate your # plot to show the key features clearly. # # b. Answer 1a. for two dependent vectors v1, v2 instead. Describe the # differences in the two plots. # # 2. All questions deal with this m x n = 8 x 10 matrix A. # # [ 1 2 2 1 1 3 4 5 1 4 ] # [ 1 0 -1 1 0 0 -2 -2 -2 3 ] # [ 6 8 6 6 4 12 12 16 0 22 ] # A = [ 0 2 2 1 1 1 1 2 0 1 ] # [ 3 -2 -5 2 -1 -1 -7 -8 -6 8 ] # [ 1 1 1 1 2 2 0 -4 1 1 ] # [ 5 -10 -14 0 -2 -4 -17 -31 -7 5 ] # [ 4 -2 -5 3 2 0 -11 -21 -5 6 ] # # a. Find a basis for the range = column space. Then find a basis # consisting of column vectors. What is the dimension of the column space? # # b. Find a basis for the row space. Find a basis for the row space consisting # entirely of row vectors. What is the dimension of the row space? # # c. Check by finding rank(A). # # d. Find a basis for the null space of A. What is the dimension of the null # space (the nullity). Check that the nullity + rank = n. # (This is Theorem 6.7 of Kolman.) # # e. Find a basis for the kernel of the transpose of A. Check that its # dimension is m - rank(A). # # f. Show that the union of the null space of A and the row space of A # span R^n. # # g. Show that the union of the null space of A^T and the column space of # A span R^m. # # h. Show that all vectors of the null space of A are orthogonal to all # vectors of the row space of A. Show that all vectors of the null space # of A^T are orthogonal to all vectors of the column space of A. # (f-g-h demonstrate the Fundamental Theorem of Linear Algebra.) # # 3. Let v1=[1,2,3,4,5,6,7], v2=[9,8,7,6,5,4,3], v3=[7,13,-1,2,5,8,11]. # Find vectors v4, v5, v6, v7 so that {v1,...,v7} is a basis of R^7. # (You don't necessarily have to follow my algorithm, if you explain # your answer!)