# What is an intuitive explanation for rank of a matrix?

Answer by John Salvatore:

A matrix is a collection of vectors. You can intuitively imagine a vector as a point in space. If you want, you can draw a line from the origin to that point, and put a little arrow on the tip.

Normally, we imagine vectors in 2 or 3 dimensions:

Above, you see the vector [7, 3, 5]. Intuitively, you can imagine an arrow that goes from the origin to the point that's 7 units in the x direction, then 3 units in the y direction, and 5 units in the z direction.

Now imagine just two of these 3D vectors. You can imagine adding these vectors by taking the tip of one, and using it as the origin of the other. That would give you some new vector.

Above, we added the original vector [7, 3, 5]  (now purple) [-2, -1, 5] (blue), and got [5, 2, 10] (red).

You may notice that the new vector lies in the plane of the original two. It's no coincidence. If we scale the original vectors by some constant, we could shorten or increase their lengths. We could even scale them by a negative amount, and point them in the opposite direction. However, they'd still point in the same directions. When you add them, they'd still pick some new point on that same plane.

Above, I scaled the original vector [7, 3, 5] by 1/2, resulting in [3.5, 1.5, 2.5]. Though the new vector after addition is a different point [1.5, 0.5, 7.5], it still lies in the same plane.

Now, imagine you took all possible combinations of the two vectors. The set of all possible points you could reach by scaling and adding these two vectors (including zero of each) is the entire plane that passes through the two vectors and the origin.

When we do this, we are imagining the space that the vectors "span". In this case, it's a plane. Imagine the two vectors we started with were actually pointed in the same direction.

[7, 3, 5] and [-3.5, -1.5, -2.5] are two distinct vectors, but they point in the same direction. No amount of combining these two would ever escape the line they both lie on. Thus, the space "spanned" by the two vectors is a single line, rather than a plane.

In each case, we had two vectors, but the number of independent directions made the difference between spanning a plane vs a line. The "rank" of a matrix is the dimension of that space spanned by the vectors it contains.

If we put the two vectors [7, 3, 5]  and [-2, -1, 5] into a matrix:
$\begin{bmatrix} 7 & -2\\ 3 & -1\\ 5 & 5 \end{bmatrix}$

the rank of the matrix is the dimension of the space that you get by taking all combinations of the vectors. We've already done that, and saw that the space spanned by [7, 3, 5] and [-2, -1, 5] was a plane. In this case, the rank is 2 (because a plane is 2 dimensional).

Let's put the two vectors [7, 3, 5] and [-3.5, -1.5, -2.5] into a matrix:

$\begin{bmatrix} 7 & -3.5\\ 3 & -1.5\\ 5 & -2.5 \end{bmatrix}$

As we already saw, these two vectors span a line. The rank of this matrix would be the same idea: it's the dimension of the space you get by taking all combinations of the vectors. In this case, that space is just a line, so the rank is 1 (because a line is 1 dimensional).

The same idea applies in higher dimensions. It just gets harder to visualize intuitively. However, even in arbitrarily high dimensions, the rank of the matrix is the dimension of the space spanned by the vectors that make up the matrix.

What is an intuitive explanation for rank of a matrix?