Skip to main content

Someone wanted to learn this too, so Grasp built them a personal learning path.

You can keep exploring this one or create your own

Linear Independence, Span, Basis, and Dimension

Introduction

In our previous lesson, we went under the hood of matrix multiplication, implementing it from scratch to understand its mechanical core. This gave us a practical feel for how vectors and matrices are manipulated computationally. Today, we elevate our perspective from computation to conception. We will introduce four of the most fundamental concepts in linear algebra: linear independence, span, basis, and dimension.

These terms form the essential vocabulary for describing vector spaces. Understanding them is not an abstract mathematical exercise; it is the prerequisite for grasping core ideas in both graphics and AI. Concepts like the "rank" of a matrix, the nature of solutions to linear systems, and the principles behind dimensionality reduction all rest on this foundation. Our goal is to move from simply calculating with vectors to reasoning about their relationships and the spaces they define.

Linear Combinations and Span: The Building Blocks of a Space

At the heart of linear algebra are two operations you already know: vector addition and scalar multiplication. A linear combination is simply the act of scaling a set of vectors and adding them together. For a set of vectors and a set of scalars , a linear combination is the resulting vector :

This is the most fundamental way of constructing new vectors from old ones. To build a strong visual intuition for this, let's turn to an excellent video from 3Blue1Brown.

Linear combinations, span, and basis vectors | Chapter 2, Essence of linear algebra

This video, "Linear combinations, span, and basis vectors," provides a superb geometric interpretation of these concepts.

First, watch the segment that introduces linear combinations and basis. The video reframes vector coordinates as scalars that stretch or squish special vectors called basis vectors. Then, watch the next segment which defines and visualizes the span. Pay close attention to how the "span" of two vectors in 2D can fill the entire plane, or be confined to just a line if the vectors are collinear.

As the video illustrates, the span of a set of vectors is the set of all possible vectors you can create through their linear combinations. It answers the question: "What parts of space can I reach using only these vectors and the operations of scaling and adding?"

  • The span of a single non-zero vector is a line through the origin.
  • The span of two non-collinear vectors is a plane through the origin.

This idea extends naturally into higher dimensions. In 3D space, what do you think the span of two non-collinear vectors would be?

It would again be a plane, but this plane is now a "slice" of 3D space.

A set of vectors \(\{\mathbf{a}_1, \mathbf{a}_2, \mathbf{a}_3\}\) lies on a plane H passing through the origin. The span of these vectors is the plane H itself, as any linear combination of them will remain on that plane.

What happens when we introduce a third vector? The situation becomes more interesting.

Linear combinations, span, and basis vectors | Chapter 2, Essence of linear algebra

Let's continue with the 3Blue1Brown video to see how span behaves in 3D.

Watch the segment from span in three dimensions. Notice the two distinct possibilities: either the third vector lies within the plane spanned by the first two, adding nothing new to the span, or it points in a new direction, allowing the span to fill all of 3D space.

This brings us to a crucial distinction: the difference between vectors that add new "reach" to our span and those that are redundant.

Linear Independence: The Concept of Non-Redundancy

As we just saw, sometimes adding a vector to a set doesn't expand its span. This happens when the new vector is already a linear combination of the existing ones. This idea of redundancy is formalized by the concept of linear dependence.

A set of vectors is linearly dependent if at least one vector in the set can be written as a linear combination of the others. In the 3D example, if the third vector lies in the plane spanned by and , the set is linearly dependent.

Conversely, a set of vectors is linearly independent if no vector in the set can be written as a linear combination of the others. Each vector adds a new direction, or a new dimension, to the span.

For a deeper and more formal understanding, let's look at the mathematical definition. A set of vectors is linearly independent if the only way to get the zero vector from their linear combination is by using all zero scalars:

If you can find a set of scalars where at least one is non-zero that makes the combination equal to the zero vector, the vectors are linearly dependent.

From your systems programming perspective, this abstract definition has a very concrete computational interpretation. If we arrange a set of column vectors into a matrix , the equation above is simply . So, asking if the vectors are linearly independent is identical to asking: "Does the equation have any non-trivial solutions?" In other words, is the null space of limited to only the zero vector?

Professor Gilbert Strang provides a masterclass on this connection.

9. Independence, Basis, and Dimension

In this classic lecture from MIT OpenCourseWare, Prof. Strang provides the formal definitions and connects them directly to matrix properties.

First, watch his definition of linear independence. He builds from simple geometric examples to the formal definition involving the zero vector. Then, pay very close attention to the crucial segment from linking independence to the null space. He shows that the columns of a matrix are independent if and only if its null space contains only the zero vector. This directly ties the abstract concept to the matrix properties we've been working with.

Basis and Dimension: Describing a Space Efficiently

We now have two key concepts:

  1. Span: A set of vectors spans a space if their linear combinations can reach every vector in that space.
  2. Linear Independence: A set of vectors is linearly independent if it contains no redundant vectors.

When a set of vectors has both of these properties, it is called a basis for that space.

A basis is a linearly independent set of vectors that spans the space.

Think of a basis as a "perfect" set of vectors for describing a space. It's:

  • Complete: It spans the whole space, so no part is unreachable.
  • Minimal: It's linearly independent, so there are no wasteful, redundant vectors.

The standard basis in is composed of the vectors , , and . It's easy to see they are linearly independent and that their combinations can form any vector . However, a space can have infinitely many different bases. For example, any three non-coplanar vectors in form a basis for .

An illustration of various subspaces within \(\mathbb{R}^3\). The blue line is a 1D subspace, while the gray, green, and yellow planes are 2D subspaces. Each has its own basis. A basis for the blue line would be any single vector along it. A basis for any of the planes would be any two non-collinear vectors within that plane.

While the bases themselves can vary, they all share one remarkable property: they have the same number of vectors. This fundamental number is an intrinsic property of the space itself. We call it the dimension of the space.

The dimension of a vector space is the number of vectors in any of its bases.

  • A line is a 1-dimensional space.
  • A plane is a 2-dimensional space.
  • is an n-dimensional space.

Prof. Strang's lecture continues to clarify these final, crucial definitions.

9. Independence, Basis, and Dimension

Let's continue with the MIT lecture to formalize the definitions of basis and dimension.

Watch the section where he formally defines a basis, providing examples in \mathbb{R}^3, including the standard basis and another made of arbitrary invertible matrix columns. Finally, watch his explanation of dimension. The key takeaways here are that every basis for a given space has the same number of vectors, and this number defines the dimension of the space. He concludes by tying everything together: the dimension of a matrix's column space is its rank, and the dimension of its null space is the number of free variables (n-r).

For a quick textual review of these definitions, you can consult these slides.

[PDF] Linear algebra - CS425 - Computer Graphics I - Fabio Miranda

These slides from a computer graphics course provide concise definitions.

Review the definitions for linear independence (slide 8), what it means to span a space (slide 10), and the definition of a basis (slide 11). The examples on slide 12 are particularly useful for testing your understanding.

Conclusion

In this lesson, we have established the foundational vocabulary of linear algebra. You now understand the key concepts that allow us to describe and reason about vector spaces.

Our key takeaways are:

  • Linear Combination: The fundamental operation of scaling and adding vectors.
  • Span: The set of all reachable vectors from a given set of vectors using linear combinations. It defines the subspace they "live" in.
  • Linear Independence: A property of a set of vectors with no redundancy; each vector contributes a new dimension to the span. Computationally, this is linked to the null space of a matrix containing only the zero vector.
  • Basis: A minimal, complete set of vectors that is both linearly independent and spans the space. It provides a unique "coordinate system" for that space.
  • Dimension: The number of vectors in any basis for a space. This is an intrinsic, constant property of the space.

These ideas are not just abstract. The dimension of a matrix's column space is its rank, a concept we will explore deeply. The dimension of the null space tells us about the number of solutions to a linear system. These are the tools that unlock the deeper, more powerful aspects of linear algebra.

In our next lesson, we will return to the properties of matrices themselves. We will explore the determinant, a single number that reveals a great deal about a matrix, including a beautiful geometric interpretation as the factor by which a transformation scales area or volume.

Can't find a good explanation? Sign up and we'll make it for you

Sign up