DimensionWorksheet by Russell Blyth, revised by Mike May, S.J.restart: with(LinearAlgebra): with(plots): with(plottools):
<Text-field layout="Heading 1" style="Heading 1">Outline</Text-field>The basic objectives are:1) Use Gauss-Jordan elimination to find a basis for the column space of a matrix2) Use Gauss-Jordan elimination to find a basis for the null space of a matrix3) Note a relationship between the dimensions of these two spaces.
<Text-field layout="Heading 1" style="Heading 1">Preparatory Work - Computing the Reduced Row Echelon Form</Text-field>Consider a matrix A, as given below. How do we find a basis for the column space of the matrix? How do we find a basis for the null space of the matrix?Let A be the matrixA:= <<-3,-5,6,-6,6>|<0,-3,0,-2,-2>|<-3,1,6,-2,10>|<-10,-5,-10,8,-11>|<-13,-4,-4,6,-1>|<7,-3,16,-16,15>>;Compute the rank of A:Rank(A);How does the rank of A relate to the dimensions of the vector spaces we are interested in studying? We row reduce A next:RowReducedA := ReducedRowEchelonForm(A);We conclude that:1) The rank of the matrix is 3, so the set of 6 column vectors cannot be linearly independent. The biggest subset of linearly independent vectors has size 3.
<Text-field layout="Heading 1" style="Heading 1">Finding a basis of the Column Space</Text-field>From the work above, we also conclude that: 2) The pivots of the reduced echelon form correspond to independent vectors. Thus the first, second, and fourth columns of vectors in A form a linearly independent set.Let's see how to write the other three column vectors of A as linear combinations of the three columns with pivots. We first break the matrix up into a list of columns for ease of noation. We also produce a matrix B which is composed of the columns we claim span the column space.v1:=Column(A,1): v2:=Column(A,2): v3:=Column(A,3): v4:=Column(A,4): v5:=Column(A,5): v6:=Column(A,6): ColumnList := [v1, v2, v3, v4, v5, v6]; B:= DeleteColumn(DeleteColumn(A,5..6),3); Now we can use LinearSolve to express the other columns as linear combinations of the spanning columns.lc3 := LinearSolve(B,v3): lc5 := LinearSolve(B,v5): lc6 := LinearSolve(B,v6): LinCombList := [lc3, lc5, lc6];We can check that the indicated linear combinations produce the column vectors:testv3 := (lc3[1]*v1+lc3[2]*v2+lc3[3]*v4): testv5 := (lc5[1]*v1+lc5[2]*v2+lc5[3]*v4): testv6 := (lc6[1]*v1+lc6[2]*v2+lc6[3]*v4): testList := [testv3, testv5, testv6];Thus the three columns of A corresponding to the pivots in the reduced row echelon form are a basis for the column space (why are they linearly independent?). The remaining three columns of A are each linear combinations of these three columns. Note that the vectors in the column space are vectors in NiMqJCUiUkciIiY=What is the dimension of the column space of A?It should be noted that Maple will find a basis of the column space with the ColumnSpace command.ColumnSpace(A);
<Text-field layout="Heading 1" style="Heading 1">Finding a basis of the Null Space</Text-field>Now find a basis for the null space of A, that is, for the solution space of AX = 0.The easiest way to solve for the solution space is to note that row reduction does not change the solution space. Thus we can look for the solution space for (RowReducedA)(X) = 0. We can find this with the LinearSolve command using back substitution.Z:=ZeroVector(5): RowReducedA := ReducedRowEchelonForm(A); nullspace:= LinearSolve(RowReducedA,Z,method='subs');Notice that the columns without pivots correspond to free variables in the null space. (In our examples the third, fifth, and sixth columns are not pivots.) The columns with pivots turn into equations where the pivot variable is equal to a linear combination of pivot variables.We turn this into a basis by letting the free variables have values of zero and one in turn. y1:=eval(nullspace,{_t0[1]=1,_t0[2]=0,_t0[3]=0}): y2:=eval(nullspace,{_t0[1]=0,_t0[2]=1,_t0[3]=0}): y3:=eval(nullspace,{_t0[1]=0,_t0[2]=0,_t0[3]=1}): nullBasis := {y1, y2, y3};Looking at the rows corresponding to the free variables, these vectors are clearly linearly independent. We can check that they are also in the null space:[(A.y1), (A.y2), (A.y3)];So {y1, y2, y3} is a basis for the null space of A. Note that the vectors in the null space are in NiMqJCUiUkciIic=. What is the dimension of the null space?What is the sum of the rank (the dimension of the column space) and the dimension of the null space?We can also find a basis of the null space with the NullSpace command:NullSpace(A);
<Text-field layout="Heading 2" style="Heading 2">Exercise:</Text-field>1) Repeat all of the above for the matrix E:= <<-1,3,2,4>|<2,-7,-5,-9>|<0,2,2,2>|<4,0,4,-4>|<5,1,6,-4>|<-3,4,1,7>>;