§5.1 Introduction
In this lab we will talk about some of the most important concepts in linear algebra: the column and null space of a matrix, linear dependence, and bases of vector spaces. One cannot overstate the importance of these ideas and a solid grasp of them is essential for anyone interested in studying linear algebra. Hopefully this lab will reinforce some of the ideas from the lectures and make you feel more confident in working with matrices and bases.§5.2 Linear Dependence
Recall that the vectors v1, v2, ..., vn are linearly dependent if there are real constants a1, a2 , ..., an, not all zero, such thata1v1+ ... + anvn = 0
Thus the vectors (1, 0)T, (0, 1)T, (2, 1)T are linearly dependent, since (2, 1)T - 2(1, 0)T - (0, 1)T = 0.
Suppose that the vectors v1, v2, and v3 are linearly dependent. This means that there are real constants a1, a2, and a3 not all zero such that
a1v1+ a2v2 + a3v3 = 0
If we solve for v1 then we get
v1 = (- a2/ a1 )v2 - (a3/ a1 )v3
For instance, from the example above we have, (2, 1)T = 2(1, 0)T + (0, 1)T. So (2, 1)T can be written as a linear combination of the other two vectors, which means that it is in the linear span of (1, 0)T and (0, 1)T.
It is also true that the vectors (1, 0)T, (0, 1)T, (3, 1)T are linearly dependent, since (3, 1)T - 3(1, 0)T - (0, 1)T = 0. So we can write (3, 1)T = 3(1, 0)T + (0, 1)T. In fact, the vectors (1, 0)T, (0, 1)T, (a, 1)T are linearly dependent, since (a, 1)T - a(1, 0)T - (0, 1)T = 0. So we can write (a, 1)T = a(1, 0)T + (0, 1)T, where a is any real number.
MATLAB has a function called rank() that could help us compute the dimension of spans of vectors. (The rank of a matrix will be defined in class soon, but for now we are just going to use it to compute dimensions of vector spans.)
§5.3 Column Space and Null Space
Let A be the matrix [1 2 5 ; 4 5 7 ; 2 3 6]. The column space of A is the linear span of the columns of A; that is, the span of the vectors (1, 4, 2)T, (2, 5, 3)T, (5, 7, 6)T. Since rank(A) gives the dimension of the span of the columns of A, it gives the dimension of the column space of A.Consider the following matrix
First, let us find the rank of A and a obtain a basis for the column space of A.
>> A = [1 2 1; 1 2 2];ans =
2
Recall that the null space of A is the set Null(A) = {x : Ax = 0}. MATLAB has a command null(A) that produces a basis for the null space of A. Simply enter:
>> x = null (A, 'r')x =
-2
1
0
Remark 5.1 The parameter 'r' above is used so that MATLAB does not orthogonalize the basis; that is, it does not change the vectors in the basis to be of unit length and perpendicular to each other. You will learn about orthogonalization in a few lectures.
Note that it makes sense that the null space is one dimensional since the rank-nullity theorem states that nullity(A) + rank(A) = dim (R3) = 3
Now let us check that the vector x really does lie in the null space:
>> A*xans =
0
0
So how do we find a basis for the column space? As you probably know from lectures and homework, all we have to do is perform row reduction on A and look which columns contain pivots (i.e. leading ones). Then we simply choose the corresponding columns from the original matrix A .
>> rref(A)
ans =
1 2 0
0 0 1
We see that columns one and three contain pivots. The first and third columns in A are (1, 1)T, (1, 2)T. A moment of reflection should convince you that this is indeed a basis for the column space consisting of columns of A. Note that this result is consistent with our calculations for the rank of A .
Last Modified:
09/20/04