Main content

### Course: Linear algebra > Unit 1

Lesson 7: Null space and column space- Matrix vector products
- Introduction to the null space of a matrix
- Null space 2: Calculating the null space of a matrix
- Null space 3: Relation to linear independence
- Column space of a matrix
- Null space and column space basis
- Visualizing a column space as a plane in R3
- Proof: Any subspace basis has same number of elements
- Dimension of the null space or nullity
- Dimension of the column space or rank
- Showing relation between basis cols and pivot cols
- Showing that the candidate basis does span C(A)

© 2024 Khan AcademyTerms of usePrivacy PolicyCookie Notice

# Introduction to the null space of a matrix

Showing that the Null Space of a Matrix is a valid Subspace. Created by Sal Khan.

## Want to join the conversation?

- i still don't understand what a homogenous equation is(6 votes)
- it's just an equation in the form

Ax=0

where A is a matrix, x is a vector written in matrix form, and 0 is a zero vector written in matrix form

nonhomogenous would be Ax=b, and b is a vector written in matrix form(14 votes)

- 6:50should be v_2 not v^2(8 votes)
- Yes, you are right.(7 votes)

- Do I understand correctly that if a null space is for a zero matrix, then all possible vectors are members of that null space, and if a null space is for a non-zero matrix, then the null subspace only consists of a zero vector?(5 votes)
- Given a matrix A we can consider the vectors "x" such that Ax=0. We say that these vectors are in the null space of A. It only makes sense to talk about a null space associated to a given matrix. The zero matrix (the one whose only entries are 0) has the property that Ax=0 for any vector x which I think is what you meant.

For other matrices it is more complicated. For example, the identity matrix (with 1's on the diagonal) has the property that Ax=x so if Ax=0 then x=0 so the null space is just the zero vector. But what about the matrix whose rows are (1,0) and (0,0). If we multiply by (0,1) or any scaler multiple of that vector we get zero so the null space consists of all the vectors that look like (0,k) for some number k.

In general the nullspace of a matrix can be lots and lots of different things depending on the matrix. You will learn a lot more about it as you keep doing linear algebra.(10 votes)

- hey.. here somebody said in starting posts that The set { (0,0) , (1,1) } of vectors in R² contains the zero vector but it is certainly not closed under addition, therefore it's not a subspace. but by adding these two vectors i get (1,1) which belongs to r-2 .. so it ios not closed under addition?(2 votes)
- It's not closed under addition because you need to cater for the possibility of adding one vector to itself. Here, if you add (1,1) and (1,1) you get (2,2) which is not in the set. Therefore the set is not closed under addition. Hope that helps.(11 votes)

- When proving that it is closed under addition, shouldn't we be adding just v1 + v2 rather than Av1 + Av2?(4 votes)
- We should be checking that v1+v2 is in the nullspace. What it means to be in the nullspace is that A(v1+v2) should be the zero vector. But A(v1+v2)=Av1+Av2 (because matrix transformations are linear). Now if we assumed v1 and v2 are in the nullspace, we would have Av1=0 and Av2=0. So A(v1+v2)=Av1+Av2=0+0=0. So v1+v2 is indeed in the nullspace, so the nullspace is closed under vector addition.(6 votes)

- What's the difference between a subspace, a span, and a plane?(3 votes)
- Let S be a set of vectors { v_1, ... ,v_n }.

Span:

The span of S are all the vectors that a linear combination of the vectors inside S can represent. If S is linearly independent, the vectors inside S span R^n. If one of the vectors is a multiple of the other, then S will span R^(n - 1).

Subspace:

Loosely speaking, a subspace is a "part" of R^n. It can be represented by the span of a set of vectors. Anything a set of vectors can span, is a subspace.

Plane:

A plane is a two dimensional space, just like the cartesian plane (xy plane).(6 votes)

- What is a zero vector?

And what is a subspace?

I would appreciate a reply

Thanks(1 vote)- See the earlier videos for the definitions(7 votes)

- Hi, got a question might sound a bit stupid...

To call some set a subspace, mustn't there be a reference? Here, doesn't mean that we are trying to prove if the vector X set is a subspace to the R^n range? Or to the matrix A?

BTW,

At7:15, sal writes: AV1+AV2=0, but it does not mean V1+V2 is closed in vector set X, right? Same how to prove any c times v1 would also be closed in vector X set?

If answers are no, how can we say Vector X set is sub space?

Thanks a lot in advance!(3 votes)- a subspace is a subset of a vector space which itself is also a vector space

vector spaces are closed by vector addition and scalar multiplication

this is by definition(2 votes)

- Isn't it redundant to say that the zero-vector must be a member of the subspace because doesn't the criteria 'closed under multiplication' cover this already? If the arbitrary number multiplied with the vector is zero then the vector is the zero vector..(2 votes)
- Yes you are correct, if you can show it is closed under scalar multiplication, then checking if it has a zero vector is redundant, due to the fact that 0*v*=
**0**. However, there are many subsets that don't have the zero vector, so when trying to disprove a subset is a subspace, you can easily disprove it showing it doesn't have a zero vector (note that this technique of disproof doesn't always work, in which case you would have to check vector addition and scalar multiplication closures).(3 votes)

- So, the solutions (vectors x) to Ax = 0 is a subspace (obeys the three properties of subspaces) called the nullspace.(3 votes)
- Yep, and the linear dependence of A plays a part in what exactly the nullspace is.(0 votes)

## Video transcript

Let's review our notions
of subspaces again. And then let's see if we can
define some interesting subspaces dealing with
matrices and vectors. So a subspace-- let's say that I
have some subspace-- oh, let me just call it some
subspace s. This is a subspace if the
following are true-- and this is all a review-- that the 0
vector-- I'll just do it like that-- the 0 vector,
is a member of s. So it contains the 0 vector. Then if v1 and v2 are both
members of my subspace, then v1 plus v2 is also a member
of my subspace. So that's just saying that
the subspaces are closed under addition. You can add any of their two
members and you'll get another member of the subspace. And then the last requirement,
if you remember, is that subspaces are closed under
multiplication. So that if c is real number,
and it's just a scalar. And if I multiply, and v1 is a
member of my subspace, then if I multiply that arbitrary real
number times my member of my subspace, v1, I'm going
to get another member of the subspace. So it's closed under
multiplication. These were all of what
a subspace is. This is our definition
of a subspace. If you call something
a subspace, these need to be true. Now let's see if we can do
something interesting with what we understand about matrix
vector multiplication. Let's say I have the matrix
a-- I'll make it nice and bold-- and it's an
m by n matrix. And I'm interested in the
following situation; I want to set up the homogeneous
equation. And we'll talk about why
it's homogeneous. Well, I'll tell you
in a second. So let's say we set
up the equation. My matrix a times vector x
is equal to the 0 vector. This is a homogeneous equation, because we have a 0 there. And I want to ask
the question-- I talked about subspaces. If I take all of the x's--
if I take the world, the universe, the set of all of
the x's that satisfy this equation, do I have
a valid subspace? Let's think about this. I want to take all of the x's
that are a member of Rn. Remember, if our matrix a has
n columns, then I've only defined this matrix vector
multiplication. If x is a member of r, and if
x has to have exactly n components, only then
is it defined. So let me define a set of all
the vectors that are a member of Rn where they satisfy the
equation a times my vector x is equal to the 0 vector. So my question is, is
this a subspace? Is this a valid subspace? So the first question is, does
it contain the 0 vector? Well in order for this to
contain the 0 vector, the 0 vector must satisfy
this equation. So what is any m by n matrix
a times the 0 vector? Let's write out my matrix
a-- my matrix a, a[1,1] a[1,2] all the way to a[1,n] and then this, as we go down
a column, we go all the way down to a[m,1] and then as we go all the
way to the bottom right, we go to a[m,n] and I'm going to multiply that
times the 0 vector that has exactly n components. So the 0 vector with n
components is 0, 0, and you're going to have n of these. The number of components here
has to be the exact same number of the number of columns
you have. But when you take this product, this
matrix vector product, what do you get? What do we get? Well, this first term up here
is going to be a[1,1] time 0, plus a[1,2] times 0, plus each of
these terms times 0. And you add them
all up. a[1,1] times 0, plus a[1,2] plus a[1,2] times 0, all the way to a[1,n] and times 0. So you get 0. Now this term is going
to be a[2,1] times 0, plus a[2,2] times 0, plus a[2,3] times 0, all the way to a[2,n] times 0. That's, obviously,
going to be 0. And you're going to keep doing
that because all of these are, essentially,-- you can kind of
view it as the dot product of-- I haven't defined dot
products with row vectors and column vectors, but I think you
get the idea-- the sum of each of these elements,
multiplied with the corresponding component
in this vector. And, of course, you're just
always multiplying by 0 and then adding up. So you're going to get nothing
but a bunch of 0's. So the 0 vector does satisfied
the equation. A times the 0 vector is
equal to the 0 vector. And this is a very
unconventional notation. I'm just writing it like that,
because I don't feel like bolding out my 0's all the time
to make you realize that that's a vector. So we meet our first
requirement. The 0 vector is a member
of the set. So let me define my set here. Let me define it n. And I'll tell you in a second
why I'm calling it n. So we now know that
the 0 vector is a member of my set n. Now let's say I have two
vectors, v1 and v2 that are members-- let me write this. So let's say I have two factors,
v1, and v2, that are both members of our set. What does that mean? That means that they both
satisfy this equation. So that means that a-- my matrix
a-- times vector 1 is equal to 0. This is by definition. I'm saying that they're a member
of the set, which means they must satisfy this. And that also means that
a times vector 2 is equal to our 0 vector. So in order for this to be
closed under addition, a times vector 1 plus vector 2, the
sum of these two vectors should also be a member of n. But let's figure out
what this is. The sum of these two vectors
is this vector right here. This is equal to--
and I haven't proven this to you yet. I haven't made a video
where I prove this. But it's very easy to prove just
using the definition of matrix vector multiplication,
that matrix vector multiplication does display
the distributive property. And maybe I'll make a video on
that, but literally, you just have to go through the mechanics
of each of the terms. This is equal to a[v,1] plus a[v,2] And we know that this is
equal to the 0 vector. And this is equal
to the 0 vector. And if you add the 0 vector to
itself, this whole thing is going to be equal
to the 0 vector. So if v1 is a member of n, and
v2 is a member of n, which means they both satisfy this
equation, then v1 plus v2 is definitely still
a member of n. Because when I multiply
a times that, I get the 0 vector again. So let me write that
result, as well. So we now know that v1 plus
v2 is also a member of n. And the last thing we have to
show is that it's closed under multiplication. Let's say that v1 is a member
of our space that I defined here, where they satisfy
this equation. What about c times v1? Is that a member of n? Well let's think about it. What's our matrix a times
the vector-- right? I'm just multiplying this
times the scale. I'm just going to get
another vector. I don't want to write
a capital v there. Lowercase v, so it's a vector. What's this equal to? Well, once again, I haven't
prove it to you yet, but it's actually a very straightforward
thing to do, to show that when you're dealing
with scalars, if you have a scalar here, it doesn't
matter if you multiply the scalar times the vector before
multiplying it times the matrix or multiplying the matrix
times the vector, and then doing the scalar. So it's fairly straightforward
to prove that this is equal to c times our matrix a-- I'll make
that nice and bold, times our vector v. That these two things
are equivalent. Maybe I should just churn out
the video that does this, but I'll leave it to you. You, literally, just go
through the mechanics component by component. And you show this. But clearly, if there's is true,
we already know that v1 is a member of our set, which
means that a times v1 is equal to the 0 vector. And so that means this will
reduce to c times the 0 vector, which is still
the 0 vector. So c[v,1] is definitely a member of n. So it's closed under
multiplication. And I kind of assumed
this right here. But maybe I'll prove that
in a different video. But I want to do all this to
show that this set n is a valid subspace. This is a valid subspace. It contains a 0 vector. It's close under addition. It's close under
multiplication. And we actually have a special
name for this. We call this right here, we call
n, the null space of a. Or we could write n is equal
to-- maybe I shouldn't have written an n. Let me write orange in there. Our orange n is equal to-- the
notation is just the null space of a. Or we could write the null space
is equal to the orange notation of n, and literally,
if I just give you some arbitrary matrix a, and
I say, hey, find me n of a, what is that? Literally, your goal is to find
the set of all x's that satisfy the equation a times
x is equal to 0. And I'm going to do that
in the next video.