Skip to main content
Home
Calculating...
Home Linear Systems Column_Space

Column Space Calculator: Find Basis for Range of a Matrix

Find the column space (range) of a matrix A: all linear combinations of its column vectors. The column space is a subspace whose dimension equals the rank of A.

Calculator

Enter your matrix below and click "Calculate" to see the step-by-step solution.

Rows (m) =
Cols (n) =
Maximum size: 6ร—6

The column space consists of all vectors that can be written as Aยทx

A Matrix A (m ร— n)

Columns are labeled cโ‚, cโ‚‚, ..., cโ‚™

Computing column space basis...

Enter a matrix A to find its column space (all linear combinations of columns).

The column space dimension equals the rank of A.

Learn About Column_Space

Understanding the concepts behind the calculations.


What is Column Space?

The column space (or range) of a matrix A is the set of all linear combinations of its column vectors.

$$ \boxed{\text{Col}(A) = \text{span}\{\mathbf{a}_1, \mathbf{a}_2, \ldots, \mathbf{a}_n\}} $$

Where aโ‚, aโ‚‚, ..., aโ‚™ are the columns of A. The column space is a subspace of โ„แต (where m is the number of rows).

Alternative Definition

For an mร—n matrix A, the column space is:

$$ \text{Col}(A) = \{\mathbf{y} \in \mathbb{R}^m : \mathbf{y} = A\mathbf{x} \text{ for some } \mathbf{x} \in \mathbb{R}^n\} $$

In other words: all possible outputs of the linear transformation T(x) = Ax.

๐Ÿ’ก Key Insight: The column space tells you what vectors you can "reach" by multiplying A by some x. If b is in Col(A), the system Ax = b has a solution!


Why Column Space Matters

โœ… The Column Space:

  • Determines if Ax = b has a solution
  • Reveals the rank of the matrix
  • Shows the dimension of the output space
  • Essential for least squares problems
  • Foundation of Principal Component Analysis (PCA)

๐Ÿ“ Key Properties:

  • Subspace of โ„แต (codomain)
  • dim(Col(A)) = rank(A)
  • Columns themselves span the space
  • Basis = linearly independent columns
  • Col(A) โŸ‚ Null(Aแต€) (left null space)

๐Ÿ”— Related: The column space is one of the four fundamental subspaces of a matrix. The others are the null space, row space, and left null space.


Finding a Basis for Column Space

The Algorithm (Pivot Column Method)

  1. Compute the RREF (Reduced Row Echelon Form) of A
  2. Identify the pivot columns in the RREF
  3. The corresponding columns in the original matrix A form a basis

Why this works: Pivot columns are linearly independent, and non-pivot columns are linear combinations of pivot columns. The same linear relationships exist in the original matrix!

Important Note

โš ๏ธ Use ORIGINAL columns, not RREF columns! The RREF changes the column space. Always take basis vectors from the original matrix.


Complete Examples

Example 1: Full Column Space (Rank 3)

Matrix:

$$ A = \begin{bmatrix} 1 & 2 & 3 \\\\ 4 & 5 & 6 \\\\ 7 & 8 & 10 \end{bmatrix} $$

Step 1: Compute RREF

$$ \text{RREF}(A) = \begin{bmatrix} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ 0 & 0 & 1 \end{bmatrix} $$

Step 2: Identify pivot columns โ†’ columns 1, 2, 3 are pivots

Step 3: Basis from original matrix:

$$ \text{Basis} = \left\{ \begin{bmatrix} 1 \\ 4 \\ 7 \end{bmatrix},\; \begin{bmatrix} 2 \\ 5 \\ 8 \end{bmatrix},\; \begin{bmatrix} 3 \\ 6 \\ 10 \end{bmatrix} \right\} $$

Result: The column space is all of โ„ยณ (full rank, dimension = 3).

Example 2: Rank-Deficient Matrix (Rank 1)

Matrix:

$$ A = \begin{bmatrix} 1 & 2 & 3 \\\\ 2 & 4 & 6 \\\\ 3 & 6 & 9 \end{bmatrix} $$

Step 1: Compute RREF

$$ \text{RREF}(A) = \begin{bmatrix} 1 & 2 & 3 \\\\ 0 & 0 & 0 \\\\ 0 & 0 & 0 \end{bmatrix} $$

Step 2: Pivot columns โ†’ only column 1 is a pivot

Step 3: Basis from original matrix:

$$ \text{Basis} = \left\{ \begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix} \right\} $$

Result: The column space is a 1-dimensional line through the origin.

Example 3: Rectangular Matrix (3ร—4)

Matrix:

$$ A = \begin{bmatrix} 1 & 2 & 3 & 4 \\\\ 2 & 4 & 6 & 8 \\\\ 3 & 6 & 9 & 12 \end{bmatrix} $$

Step 1: RREF

$$ \text{RREF}(A) = \begin{bmatrix} 1 & 2 & 3 & 4 \\\\ 0 & 0 & 0 & 0 \\\\ 0 & 0 & 0 & 0 \end{bmatrix} $$

Step 2: Only column 1 is a pivot

Step 3: Basis:

$$ \text{Basis} = \left\{ \begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix} \right\} $$

Note: The column space is only 1-dimensional even though the matrix is 3ร—4. The other columns are multiples of the first column.


Column Space vs Other Fundamental Subspaces

๐Ÿ“Š The Four Subspaces

Space Definition Located in Dimension
Column Space {Ax : x โˆˆ โ„โฟ} โ„แต rank
Null Space {x : Ax = 0} โ„โฟ n - rank
Row Space {Aแต€y : y โˆˆ โ„แต} โ„โฟ rank
Left Null Space {y : Aแต€y = 0} โ„แต m - rank

๐Ÿ”— Orthogonality Relationships

  • Col(A) โŸ‚ Null(Aแต€) (left null space)
  • Row(A) โŸ‚ Null(A)
  • โ„โฟ = Row(A) โŠ• Null(A)
  • โ„แต = Col(A) โŠ• Null(Aแต€)

โŠ• means direct sum โ€” every vector can be uniquely written as sum of one vector from each subspace, and they are orthogonal.

๐Ÿ’ก Try These: Use our Null Space Calculator, Row Space Calculator, and Left Null Space Calculator to explore all four subspaces!


Rank and Dimension

The rank of a matrix is the dimension of its column space:

$$ \boxed{\text{rank}(A) = \dim(\text{Col}(A))} $$

The Rank-Nullity Theorem

$$ \text{rank}(A) + \text{nullity}(A) = n $$

Where n is the number of columns.

Special Cases:

  • Full Column Rank (rank = n)
    • Columns are linearly independent
    • Null space = {0}
    • A is injective (one-to-one)
  • Full Row Rank (rank = m)
    • Column space = โ„แต
    • A is surjective (onto)
    • Every b has at least one solution

๐Ÿ”— Related: Calculate the rank and dimension of column space with our Rank Calculator!


Geometric Interpretation

What Column Space Represents

Think of matrix A as a transformation that maps vectors from โ„โฟ to โ„แต. The column space is the image of this transformation โ€” the set of all possible outputs.

$$ \text{Col}(A) = \text{Im}(T) = \{T(\mathbf{x}) : \mathbf{x} \in \mathbb{R}^n\} $$

Visualizing by Rank

  • Rank 0: Point at origin (zero matrix)
  • Rank 1: Line through origin
  • Rank 2: Plane through origin
  • Rank m: Entire โ„แต (full row rank)

Example: A 2ร—2 matrix with rank 2 maps โ„ยฒ onto all of โ„ยฒ. With rank 1, it collapses the plane onto a line (like a shadow). With rank 0, everything maps to the origin.


Real-World Applications

๐Ÿ“Š Data Science & PCA

The column space of the data matrix captures the principal components โ€” the directions of maximum variance. Dimensionality reduction projects data onto this space.

๐Ÿ—œ๏ธ Image Compression

The column space of an image matrix (after SVD) contains the essential features. Keeping only the most important columns creates compressed images.

๐Ÿ“ˆ Least Squares

When Ax = b has no solution, the least squares solution projects b onto Col(A). The projection is the closest point in the column space.

๐ŸŽฎ Computer Graphics

3D transformation matrices map vectors into their column space. The column space reveals which directions the transformation can reach.

๐Ÿ”ง Control Theory

The reachable set of a linear control system is exactly the column space of the controllability matrix.

๐Ÿ’ฐ Econometrics

The column space of the design matrix X determines which linear combinations of parameters can be estimated from data.

๐Ÿ”— Related: Learn more with our Least Squares Calculator and SVD Calculator!


Frequently Asked Questions

Q: How is column space different from row space?

A: Column space is in โ„แต (spanned by columns), row space is in โ„โฟ (spanned by rows). They have the same dimension (rank) but live in different spaces.

Q: Does column space change with row operations?

A: YES! Row operations change the column space dramatically. That's why we use the ORIGINAL matrix columns for the basis, not the RREF columns.

Q: How do I know if a vector b is in Col(A)?

A: b is in Col(A) if and only if Ax = b has a solution. Use Gaussian elimination to check consistency.

Q: Can the column space be the whole โ„แต?

A: Yes! This happens when rank(A) = m (full row rank). The transformation is surjective (onto).

Q: What's the relationship between Col(A) and Null(Aแต€)?

A: They are orthogonal complements in โ„แต. Every vector in โ„แต can be uniquely written as u + v where u โˆˆ Col(A) and v โˆˆ Null(Aแต€).


Practice Problems

Beginner

  1. Find a basis for the column space of:

    $$ A = \begin{bmatrix} 1 & 2 \\\\ 3 & 4 \end{bmatrix} $$
  2. What is the dimension of Col(A) for a 3ร—3 identity matrix?

Intermediate

  1. Find a basis for the column space of:

    $$ A = \begin{bmatrix} 1 & 2 & 3 \\\\ 2 & 4 & 6 \\\\ 3 & 6 & 9 \end{bmatrix} $$
  2. Is the vector b = [1, 2, 3]แต€ in the column space of matrix A from problem 3?

Advanced

  1. For a 4ร—5 matrix with rank 3, what is the dimension of:
    a) Column space?
    b) Null space?
    c) Row space?
    d) Left null space?

Click to reveal solutions

1. Basis: {[1,3]แต€, [2,4]แต€} (both columns are independent)

2. Dimension = 3 (full rank)

3. Basis: {[1,2,3]แต€} (only first column is independent)

4. Yes, because b = 1ยท[1,2,3]แต€

5. a) 3, b) 2, c) 3, d) 1 (since m - rank = 4 - 3 = 1)


Try It Yourself!

Use the calculator at the top of this page to find column spaces:

  1. Enter your matrix (any size up to 6ร—6)
  2. Click "Calculate" to see:
    • The RREF and pivot columns
    • A basis from the original matrix
    • The dimension (rank) of the column space
    • Step-by-step verification

๐Ÿ“ Try these examples:

  • Full rank: [[1,2,3],[4,5,6],[7,8,10]]
  • Rank deficient: [[1,2,3],[2,4,6],[3,6,9]]
  • Rectangular: [[1,2,3,4],[2,4,6,8]]

๐Ÿ’ก Pro Tip: The column space reveals the "reachable" outputs of your matrix. Understanding it is essential for solving systems, data analysis, and compression!

Summary

Key Takeaways

  • Column space = span of columns = all possible outputs Ax
  • dim(Col(A)) = rank(A)
  • Basis: Original columns corresponding to RREF pivot columns
  • Ax = b has a solution โ‡” b โˆˆ Col(A)
  • Orthogonal complement: Col(A) โŸ‚ Null(Aแต€)

๐Ÿ’ฌ Next Steps: Explore Null Space or Row Space to complete your understanding of the fundamental subspaces!