Bigger examples
> E := matrix(3,3,[1,2,3,4,5,6,7,8,9]); F := matrix(3,4,[1,2,3,4,5,6,7,8,9,10,11,12]);
> Pro := matrix(3,3,[1/14,2/14,3/14,2/14,4/14,6/14,3/14,6/14,9/14]); Mag := matrix(3,3,[8,1,6,3,5,7,4,9,2]);
> nullspace(E); nullspace(F); kernel(Pro); kernel(Mag);
Since the first two matrices have rank 2, the dimension theorem says that the nullities (dimensions of nullspaces) are respectively 3-2 = 1 and 4 - 2 =2. Notice that the vectors in the column space and the nullspace of matrix F don't even have the same numbers of components. Remember, the column space is related to the vector b on the right side of A x = b , while the nullspace is related to the unknown vector x on the left.
The projector Pro takes any vector and projects it on the direction of the vector
Hence the null space consists of the plane perpendiular to this vector. There are different choices for the basis of the plane, and Maple has sown her usual preference for 0s and 1's.
The magic-square matrix Mag has a non-zero determinant. It is invertible and therefore the null space consists only of the zero vector. Maple just gives empty braces for the basis of this zero-dimensional vector space.
The solutions "by hand." Well almost. As before, we'll get Maple to help with some routine calculations.
Matrix E . Let's solve for this with the augmented matrix:
> AugE := matrix(3,4,[1,2,3,0,4,5,6,0,7,8,9,0]);
> pivot(AugE,1,1);
> pivot(%, 2,2);
Aha! A row of zeroes! That means there is a solution with an arbitrary value of the third component. When we backsolve, we find that the general solution is:
> solve({1*x + 2*y + 3*z = 0,4*x + 5*y + 6*z = 0, 7*x + 8*y + 9*z = 0}, {x,y,z});
That is, any multiple of
Matrix F . We can proceed as before. The dimension theorem clues us in that we will find two linearly independent solutions.
> AugF := matrix(3,5,[1,2,3,4,0,5,6,7,8,0,9,10,11,12,0]);
Let's cut to the chase this time:
> gausselim(%);
This time the row of zeroes indicates that two components of the matrix are arbitrary, and we can backsolve to get a general solution with two free parameters - two dimensions. If the solution has components (x,y,z,w), we find that z and w are arbitrary, and that y=-2 z - 3 w, x = z + 2 w. the general vector in the null space is of the form
This happens to be the same bais as Maple found, but there are other choices.
b) suppose we insist on an orthogonal basis. As before, we can project to take the previous basis and replace it with an orthogonal basis.
> b1:= vector([1,-2,1,0]); b2:= vector([2,-3,0,1]);
> NewBasVec := b2 - (dotprod(b2,b1)/dotprod(b1,b1) )*b1;
> evalm(NewBasVec);
We can simplify this with a factor to
and if we wish, we could scale these basis vectors to have length 1.
Matrix Pro . We have two approaches to finding the nullspace in this case.
I. If we recognize that Pro is the projection matrix for the vector
then we know that the nul space is the plane passing through the origin and perpendicular to this line. We can describe that null space as the set of (x,y,z) such that
x + 2 y + 3 z = 0
or we can use a basis, consisting of any two independent vectors perpendicular to
.
For instance,
Or if we want a pair of orthogonal basis vectors, we could use
and the cross product of this vector with
.
II. If we are not so fortunate as to recognize that Pro is a special kind of matrix, we can solve A x = b as in the other examples.
Matrix Mag . Once again, this matrix in invertible, so we immediately know that the only vector in its nullspace is 0 .