Column and Row Spaces and Rank of a Matrix

We present the definitions of column and row spaces of a matrix using examples with detailed solutions .

Column Space and Rank of a Matrix

Let \( A \) be an \( m \times n \) matrix .

The column space of matrix \( A \), denoted by \( \text{Col} \, A \), is the set of all linear combinations of the columns of matrix \( A \) .

If \( c_1, c_2, \dots, c_n \) are the columns of matrix \( A \), then :

$$ \text{Col} \, A = \text{span} \{c_1, c_2, \dots, c_n\} $$

Note: The columns \( c_1, c_2, \dots, c_n \) may not be linearly independent. Below, we look at examples on how to find the basis of \( \text{Col} \, A \) by selecting the independent columns only .

The rank of matrix \( A \) is the dimension of \( \text{Col} \, A \), which is given by the number of vectors in the basis of \( \text{Col} \, A \) .

Example 1

Find the basis of the column space and the rank of each of the following matrices :

$$ A_1 = \begin{bmatrix} 1 & 2 \\ 0 & 0 \end{bmatrix}, \quad A_2 = \begin{bmatrix} 1 & 0 \\ 0 & 2 \end{bmatrix}, \quad A_3 = \begin{bmatrix} 1 & 0 & -6 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 2 & 0 & -9 \end{bmatrix} $$
View Solution to Example 1

a) Let \( c_1 = \begin{bmatrix} 1 \\ 0 \end{bmatrix} \) and \( c_2 = \begin{bmatrix} 2 \\ 0 \end{bmatrix} \) be the columns of matrix \( A_1 \). Note that \( c_2 = 2 c_1 \), so they are not independent. We need only one column to span \( \text{Col} \, A_1 \). The basis \( B \) is \( B = \{c_1\} = \left\{ \begin{bmatrix} 1 \\ 0 \end{bmatrix} \right\} \). Thus, \( \text{Col} \, A_1 = \text{span} \{c_1\} \) and \( \text{Rank}(A_1) = 1 \) .


b) Let \( c_1 = \begin{bmatrix} 1 \\ 0 \end{bmatrix} \) and \( c_2 = \begin{bmatrix} 0 \\ 2 \end{bmatrix} \) be the columns of matrix \( A_2 \). They are independent, so we need both columns to span \( \text{Col} \, A_2 \). The basis \( B \) is \( B = \left\{ \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \begin{bmatrix} 0 \\ 2 \end{bmatrix} \right\} \). Thus, \( \text{Col} \, A_2 = \text{span} \{c_1, c_2\} \) and \( \text{Rank}(A_2) = 2 \) .


c) Let \( c_1 = \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} \), \( c_2 = \begin{bmatrix} 0 \\ 0 \\ 2 \end{bmatrix} \), \( c_3 = \begin{bmatrix} -6 \\ 0 \\ 0 \end{bmatrix} \), and \( c_4 = \begin{bmatrix} 0 \\ 0 \\ -9 \end{bmatrix} \) be the columns of matrix \( A_3 \). Here, \( c_3 = -6c_1 \) and \( c_4 = -\frac{9}{2}c_2 \). The independent columns are \( c_1 \) and \( c_2 \). The basis \( B \) is \( \left\{ \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix}, \begin{bmatrix} 0 \\ 0 \\ 2 \end{bmatrix} \right\} \). Thus, \( \text{Col} \, A_3 = \text{span} \{c_1, c_2\} \) and \( \text{Rank}(A_3) = 2 \) .

Example 2

Find the basis of the column space and the rank of matrix :

$$ A = \begin{bmatrix} 1 & -2 & 0 & 4 \\ -1 & 3 & 1 & 0 \\ 0 & -1 & -1 & -4 \end{bmatrix} $$
View Solution to Example 2

To find the linearly independent columns, we rewrite matrix \( A \) in row echelon form (REF) :

$$ \text{Applying } R_2 \leftarrow R_2 + R_1 \text{ yields: } \begin{bmatrix} 1 & -2 & 0 & 4 \\ 0 & 1 & 1 & 4 \\ 0 & -1 & -1 & -4 \end{bmatrix} $$ $$ \text{Applying } R_3 \leftarrow R_3 + R_2 \text{ yields: } \begin{bmatrix} \mathbf{1} & -2 & 0 & 4 \\ 0 & \mathbf{1} & 1 & 4 \\ 0 & 0 & 0 & 0 \end{bmatrix} $$

The basis of \( \text{Col} \, A \) is formed by the columns in the original matrix that correspond to columns with pivots (leading ones) in the row echelon form . Since columns 1 and 2 have pivots:

$$ B = \left\{ \begin{bmatrix} 1 \\ -1 \\ 0 \end{bmatrix}, \begin{bmatrix} -2 \\ 3 \\ -1 \end{bmatrix} \right\} $$ $$ \text{Col} \, A = \text{span} \left\{ \begin{bmatrix} 1 \\ -1 \\ 0 \end{bmatrix}, \begin{bmatrix} -2 \\ 3 \\ -1 \end{bmatrix} \right\} $$

The basis has two vectors, so \( \text{Rank}(A) = 2 \) .

Row Space and Rank of a Matrix

Let \( A \) be an \( m \times n \) matrix .

The row space of matrix \( A \), denoted by \( \text{Row} \, A \), is the set of all linear combinations of the rows of matrix \( A \) . If \( b_1, b_2, \dots, b_m \) are the rows of matrix \( A \), then:

$$ \text{Row} \, A = \text{span} \{b_1, b_2, \dots, b_m\} $$

Note: The rows may not be independent. We select independent rows to form the basis . The rank of matrix \( A \) is the dimension of \( \text{Row} \, A \) .

Example 3

Find the basis of the row space and the rank of each matrix :

$$ A_1 = \begin{bmatrix} 4 & 8 \\ -2 & -4 \end{bmatrix}, \quad A_2 = \begin{bmatrix} 1 & 0 & 5 \\ 0 & 2 & 7 \end{bmatrix}, \quad A_3 = \begin{bmatrix} 1 & 0 & -6 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 2 & 0 & -9 \end{bmatrix} $$
View Solution to Example 3

a) Let \( b_1 = (4,8) \) and \( b_2 = (-2,-4) \). Since \( b_2 = -\frac{1}{2}b_1 \), they are not independent. The basis is \( B = \{(4,8)\} \) and \( \text{Rank}(A_1) = 1 \) .


b) Let \( b_1 = (1,0,5) \) and \( b_2 = (0,2,7) \). They are independent. The basis is \( B = \{(1,0,5), (0,2,7)\} \) and \( \text{Rank}(A_2) = 2 \) .


c) Let \( b_1 = (1,0,-6,0) \), \( b_2 = (0,0,0,0) \), and \( b_3 = (0,2,0,-9) \). Zero vectors do not contribute to linear combinations. The independent rows are \( b_1 \) and \( b_3 \). The basis is \( B = \{(1,0,-6,0), (0,2,0,-9)\} \) and \( \text{Rank}(A_3) = 2 \) .

Example 4

Find the basis of the row space and the rank of the matrix :

$$ A = \begin{bmatrix} 1 & -2 & 0 & 4 \\ 1 & 1 & -1 & -8 \\ 2 & -1 & -1 & -4 \\ -3 & 3 & 1 & 0 \end{bmatrix} $$
View Solution to Example 4

Reduce matrix \( A \) to row echelon form :

$$ \begin{bmatrix} 1 & -2 & 0 & 4 \\ 0 & 3 & -1 & -12 \\ 0 & 3 & -1 & -12 \\ 0 & -3 & 1 & 12 \end{bmatrix} \longrightarrow \begin{bmatrix} 1 & -2 & 0 & 4 \\ 0 & 1 & -\frac{1}{3} & -4 \\ 0 & 3 & -1 & -12 \\ 0 & -3 & 1 & 12 \end{bmatrix} $$ $$ \longrightarrow \begin{bmatrix} 1 & -2 & 0 & 4 \\ 0 & 1 & -\frac{1}{3} & -4 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \end{bmatrix} (E) $$

The basis of \( \text{Row} \, A \) consists of the nonzero rows of matrix \( E \) :

$$ \text{Row} \, A = \text{span} \left\{ (1, -2, 0, 4), \, \left(0, 1, -\frac{1}{3}, -4\right) \right\} $$

Since there are two nonzero rows, \( \text{Rank}(A) = 2 \) .

Steps to Determine the Bases and Rank

If \( A \) is an \( m \times n \) matrix :

Example 5

Find the basis of the row space, the basis of the column space, and the rank of :

$$ A = \begin{bmatrix} -1 & 3 & 4 & -2 \\ 1 & 2 & -2 & 0 \\ 2 & -3 & 1 & 0 \\ 0 & 5 & 2 & -2 \end{bmatrix} $$
View Solution to Example 5

Step 1: Obtain the row echelon form \( E \) of matrix \( A \) :

$$ E = \begin{bmatrix} 1 & -3 & -4 & 2 \\ 0 & 1 & \frac{2}{5} & -\frac{2}{5} \\ 0 & 0 & 1 & -\frac{14}{39} \\ 0 & 0 & 0 & 0 \end{bmatrix} $$

Step 2: The basis \( B \) of \( \text{Row} \, A \) consists of the nonzero rows of \( E \) :

$$ B = \left\{ (1, -3, -4, 2), \, \left(0, 1, \frac{2}{5}, -\frac{2}{5}\right), \, \left(0, 0, 1, -\frac{14}{39}\right) \right\} $$

Step 3: The basis \( C \) of \( \text{Col} \, A \) is the set of columns in \( A \) corresponding to the pivot columns in \( E \) (columns 1, 2, and 3) :

$$ C = \left\{ \begin{bmatrix} -1 \\ 1 \\ 2 \\ 0 \end{bmatrix}, \begin{bmatrix} 3 \\ 2 \\ -3 \\ 5 \end{bmatrix}, \begin{bmatrix} 4 \\ -2 \\ 1 \\ 2 \end{bmatrix} \right\} $$

Step 4: Dimensions and Rank :

\( \dim(\text{Row} \, A) = 3 \)

\( \dim(\text{Col} \, A) = 3 \)

\( \text{Rank}(A) = 3 \)

Questions with Solutions

Given matrix \( A \) and its row echelon form \( E \), determine the column space, row space, and rank .

  1. Question 1: \( A = \begin{bmatrix} 1 & 0 & -3 \\ 1 & 0 & -2 \end{bmatrix}, \quad E = \begin{bmatrix} 1 & 0 & -3 \\ 0 & 0 & 1 \end{bmatrix} \)

    View Solution to Question 1

    Basis \( B \) of column space (from pivot columns 1 and 3 of \( A \)) and basis \( C \) of row space (nonzero rows of \( E \)) :

    $$ B = \left\{ \begin{bmatrix} 1 \\ 1 \end{bmatrix}, \begin{bmatrix} -3 \\ -2 \end{bmatrix} \right\}, \quad C = \{ (1, 0, -3), \, (0, 0, 1) \} $$ $$ \text{Col} \, A = \text{span} \left\{ \begin{bmatrix} 1 \\ 1 \end{bmatrix}, \begin{bmatrix} -3 \\ -2 \end{bmatrix} \right\}, \quad \text{Row} \, A = \text{span} \{ (1, 0, -3), \, (0, 0, 1) \} $$

    Rank of \( A \) = 2

  2. Question 2: \( A = \begin{bmatrix} 1 & -1 & 2 & -1 \\ 1 & 0 & 4 & 0 \\ 2 & -2 & 6 & -4 \end{bmatrix}, \quad E = \begin{bmatrix} 1 & -1 & 2 & -1 \\ 0 & 1 & 2 & 1 \\ 0 & 0 & 1 & -1 \end{bmatrix} \)

    View Solution to Question 2

    All 3 columns of \( E \) contain pivots, meaning all 3 corresponding columns of \( A \) form the column basis :

    $$ B = \left\{ \begin{bmatrix} 1 \\ 1 \\ 2 \end{bmatrix}, \begin{bmatrix} -1 \\ 0 \\ -2 \end{bmatrix}, \begin{bmatrix} 2 \\ 4 \\ 6 \end{bmatrix} \right\}, \quad C = \{ (1, -1, 2, -1), \, (0, 1, 2, 1), \, (0, 0, 1, -1) \} $$ $$ \text{Col} \, A = \text{span}(B), \quad \text{Row} \, A = \text{span}(C) $$

    Rank of \( A \) = 3

  3. Question 3: \( A = \begin{bmatrix} 1 & -1 & 0 & 0 & -1 \\ -1 & 2 & 4 & -3 & 2 \\ 2 & -2 & 0 & 1 & -3 \\ 3 & -3 & 0 & 0 & -3 \end{bmatrix}, \quad E = \begin{bmatrix} 1 & -1 & 0 & 0 & -1 \\ 0 & 1 & 4 & -3 & 1 \\ 0 & 0 & 0 & 1 & -1 \\ 0 & 0 & 0 & 0 & 0 \end{bmatrix} \)

    View Solution to Question 3

    Pivots appear in columns 1, 2, and 4 of matrix \( E \). Thus, the column basis uses columns 1, 2, and 4 of matrix \( A \), and the row basis uses the 3 nonzero rows of \( E \) :

    $$ B = \left\{ \begin{bmatrix} 1 \\ -1 \\ 2 \\ 3 \end{bmatrix}, \begin{bmatrix} -1 \\ 2 \\ -2 \\ -3 \end{bmatrix}, \begin{bmatrix} 0 \\ -3 \\ 1 \\ 0 \end{bmatrix} \right\}, \quad C = \{ (1, -1, 0, 0, -1), \, (0, 1, 4, -3, 1), \, (0, 0, 0, 1, -1) \} $$ $$ \text{Col} \, A = \text{span}(B), \quad \text{Row} \, A = \text{span}(C) $$

    Rank of \( A \) = 3

More References and Links