Dimension of the null space or nullity | Vectors and spaces | Linear Algebra | Khan Academy

Dimension of the null space or nullity | Vectors and spaces | Linear Algebra | Khan Academy


Let’s say I have this matrix
B, here, and I want to know what the null space of B is. And we’ve done this multiple
times but just as a review, the null space of B
is just all of the x’s that are a member. It’s all the vector x’s that
are member of what? 1, 2, 3, 4, 5 that are members
of r to the fifth, where B, my matrix B, times any of these
vector x’s, is equal to 0. That’s the definition
of the null space. I’m just trying to find the
solution set to this equation right here. And we’ve seen before, that the
null set of the reduced row echelon form of B is equal
to the null set of B. So what’s the reduced row
echelon form of B? And this is actually almost
trivially easy. Let me just take a couple of
steps right here– to get a 0 here, let’s just replace row
2 with row 2 minus row 1 So what do we get? Row 2 minus row 1. Row 1 doesn’t change, it’s
just 1, 1, 2, 3, 2. And then row 2 minus row 1. 1 minus 1 is 0. 1 minus 1 is 0. 3 minus 2 is 1. 1 minus 3 is minus 2. 4 minus is 2 is 2. We’re almost there. Let’s see, so this is a free
variable right here. This is a pivot variable
right here. We have a 1. So let me get rid of that
guy right there. And I can get rid of that guy
right there, by replacing row 1 with row 1 minus
2 times row 2. So now row 2 is going
to be the same. 0, 0, 1 minus 2, 2. And let me replace row 1 with
row 1 minus 2 times row 2. So 1 minus 2 times 0 is 1. 1 minus 2 times 0 is 1. 2 minus 2 times 1 is 0. 3 minus 2 times minus 2. So that’s 3 plus
4 is 7, right? 2 times this is minus 4 and
we’re subtracting it. And then 2 minus 2 times
2– that’s 2 minus 4– it’s minus 2. So this is the reduced row
echelon form of B is equal to that right there. And then if I wanted to figure
out its null space, I have x1, x2, x3, x4, and x5 equaling–
I’m going to have two 0’s right here. Now I can just write this
as just a set of or a system of equations. So let me do that. I get x1. I’m going to write my pivot
variables in a green color. x1 plus 1 times x2, so plus
x2, plus 0 times x3. Plus 7 times x4. Minus 2 times x5 is equal
to that 0 right there. And then I get my–
this is x3, right? 0 times x1 plus 0 times
x2 plus 1 times x3. So I get x3 minus 2 times x4
plus 2 times x5 is equal to that 0 right there. And then if we solve for our
pivot variables, right? These are our free variables. We can set them equal
to anything. If we solve for our pivot
variables what do we get? We get x1 is equal to– I
should do that in green. The color coding helps. I get x1 is equal to minus x2
minus 7×4 plus 2×5, just subtracted these from both
sides of the equation. And I get x3 is equal to–
we’ve done this multiple times– 2×4 minus 2×5. And so if I wanted to write
the solution set in vector form, I could write my solution
set or my null space, really, is– or all
the possible x’s. x1, x2, x3, x4, x5. This is my vector
x, that’s in r5. It is equal to a linear
combination of these. So let me write it out. The free variables are x2 times
some vector right there. Plus x– is x3, no x3 is
not a free variable. Plus x4, that’s my next free
variable, times some factor. Plus x5 times some vector. I’ve run out of space. Plus x5 times some vector. And what are those vectors? Let’s see. I don’t want to make this too
dirty, so let me see if I can maybe move– nope that’s not
what I wanted to do. Let me just rewrite this. I haven’t mastered this pen
tool yet, so let me rewrite this here. So x3 is equal to
2×4 minus 2×5. Let me delete this right
over here so I get some extra space. Cross that out. I think that’s good enough. So I can go back to what
I was doing before. x5 times some vector
right here. And now what are
those vectors? We just have to look
at these formulas. x1 is equal to minus
1 times x2. So minus 1 times x2. Minus 7 times x4. Plus 2 times x5. Fair enough. And what is x3 equal to? x3 is equal to 2×4. 2×4, right? It had nothing to do with x2
right here, so it’s equal to 2×4 minus 2×5. And then 0 times x2, right? Because it had no x2
term right here. And then what is x2 equal to? Well x2 is just equal
to 1 times x2. And so all of these terms
are 0 right there. And I want you to pay
attention to that. I’ll write it right here. x2 is a free variable, so it’s
just equal to itself, right? 1 and you write a 0 and a 0. x4 is a free variable. And this is the important
point of this exercise. So it’s just equal to
1 times itself. You don’t have to throw in any
of the other free variables. And x5 is a free variable. So it just equals 1 times itself
and none of the other free variables. So right here we now say that
all of the solutions of our equation Bx equals 0, or the
reduced row echelon form of B times x is equal to 0,
will take this form. Or they are linear combinations
of these vectors. Let’s call this v1,
v2, and v3. These are just random
real numbers. I can pick any combination here
to create this solution set, or to create
our null space. So the null space of A, which is
of course equal to the null space of the reduced row echelon
form of A, is equal to all the possible linear
combinations of these 3 vectors, is equal to the span
of my vector v1, v2, and v3. Just like that. Now, the whole reason I went
through this exercise– because we’ve done this multiple
times already– is to think about whether these guys
form a linear independent set. So my question is are these
guys linearly independent? And the reason why I care is
because if they are linearly independent then they
form a basis for the null space, right? That we know that they span the
null space, but if they’re linearly independent,
then that’s the 2 constraints for a basis. You have to span the subspace,
and you have to be linearly independent. So let’s just inspect these
guys right here. This v1, he has a
1 right here. He has a 1 in the second term
because he corresponds to the free variable x2, which is
the second entry, so we just throw a 1 here. And we have a 0 everywhere
else in all of the other vectors in our spanning set. And that’s because for the other
free variables we always wanted to multiply them
times a 0, right? And this is going to
be true of any null space problem we do. For any free variable, if this
free variable represents a second entry, we’re going
to have a 1 in the second entry here. And then a 0 for the second
entry for all of the other vectors associated with the
other free variables. So can this guy ever be
represented as a linear combination of this
guy and that guy? Well there’s nothing that I can
multiply this 0 by and add to something that I multiply
this 0 by to get a 1 here. It’s just going to get 0’s. So this guy can’t be
representated as a linear combination of these guys. Likewise, this vector
right here has a 1 in the fourth position. Why is it a fourth position? Because the fourth position
corresponds to its corresponding free
variable, x4. So this guy’s a 1 here. These other guys
will definitely always have a 0 here. So you can’t take any linear
combination of them to get this guy. So this guy can’t be represented
as a linear combination of those guys. And last, this x5 guy, right
here, has a 1 here. And these guys have 0’s here. So no linear combination of
these 0’s can equal this 1. So all of these guys are
linearly independent. You can’t construct any of
these vectors with some combination of the other. So they are linearly
independent. So v1, the set v1, v2, and v3
is actually a basis for the null space, for the null space
of– Oh, you know what, I have to be very careful. For the null space of B. Just for variety, I defined my
initial matrix as matrix B, so let me be very careful here. So the null space of B was equal
to the null space of the reduced row echelon form of B. It’s good to switch things up
every once in a while, you start thinking that
every matrix is named A if you don’t. And that’s equal to the
span of these vectors. So these vectors, and we just
said that they’re linearly independent. We just showed that because
there’s no way to get that one from these guys, that one from
these guys, or that one from these guys. These guys form a basis for
the null space of B. Now this raises an interesting
question. In the last video, I defined
what dimensionality is. And maybe you missed
it because that video was kind of proofy. But the dimensionality, the
dimension, of a subspace– I’ll redefine it here– is the
number of elements in a basis for the subspace. And in the last video I took
great pains to show that all bases for any given subspace
will have the same number of elements. So this is well defined. So my question to you now is:
what is the dimension of my null space of B? What is that the dimension
of my null space of B? Well, the dimension is just
the number of vectors in a basis set for B. Well this is a basis set
for B right there. And how many vectors
do I have in it? I have 1, 2 3 vectors. So the dimension of the
null space of B is 3. Or another way to think about
it– or another name for the dimension of the null space
of B– is the nullity, the nullity of B. And that is also equal to 3. And let’s think about
it, you know I went through all this exercise. But what is the nullity of any
matrix going to be equal to? It’s the dimension of
the null space. Well the dimension of the null
space– you’re always going to have as many factors here as
you have free variables. So in general, the nullity of
any matrix of any matrix– let’s say matrix A– is equal
to the number of I guess you could call it free variable
columns or the number free variables in, well, I guess we
call it in the reduced row echelon form, or I guess we
could say the number of non-pivot columns. The number of non-pivot columns
in the reduced row echelon form of A. Because that’s essentially the
number of free variables– all of those free variables have
an associated, linearly independent vector with
each of them, right? So the number of variables is
the number of vectors you’re going to have in your basis
for your null space. And the number of free variables
is essentially the number of non-pivot columns
in your reduced row echelon form, right? This was a non-pivot column,
that’s a non-pivot column, that’s a non-pivot column. And they’re associated
with the free variables x2, x4, and x5. So the nullity of a matrix is
essentially the number of non-pivot columns in the reduced
row echelon form of that matrix. Anyway, hopefully you found
that vaguely useful.

48 thoughts to “Dimension of the null space or nullity | Vectors and spaces | Linear Algebra | Khan Academy”

  1. Hi there, I would like to know if I did exactly like you did in the video, except I put in row echelon form instead of a row reduced echelon form. Would I still be able to get the right answer?

  2. Doesn't this mean that the dimension of A is equal to the number of collumns minus the number of rows of A. Since the reduced row echelon form will allways contain a number of pivots equal to the number of rows?

  3. When the pen hovers closely above the tablet, the mouse is responsive. You don't have to be in contact with it. I use one for Photoshop and that's how mine works.

  4. This guys is the best. But let's face it if universities and colleges could hire professors like this guy who can "teach" a concept and "explain" thoroughly then people would not even have to resort to watching his videos as last minute life savers before a test or exam. Just because someone has a PHD in a subject does not necessarily mean they can teach it. They might be a complete expert and genius in that subject but getting other people to learn it and teaching it to them is a completely different story. The institutes should look at Khan's videos as an example how a great teacher should explain concepts and questions to someone rather than looking at whether they have got a PHD or doctorate in a course. 

  5. thank you very much sir , i have final exam in this after one hour
    you really explained everything for me better than that one we called prof in our college

  6. It actually doesn't need to be in RREF btw. REF will work better since it's a time saver.
    Row eschelon form is good enough because the numbers will change but the pivots will not. Since the rank-nullity theorem is dealing strictly with the # of pivots col and # of non-pivots col

  7. Let me ask you a question… is number of non pivot columns the nullity of a matrix and number of pivot columns is the rank of the matrix?

Leave a Reply

Your email address will not be published. Required fields are marked *