Testing for Linearity of Vectors in a Subspace

Given a set of vectors in a subspace, how do we test whether the vectors are linearly independent? This page explores geometric visualizations and matrix row reduction techniques to test vector linearity.

Table of Contents

Geometric Visualization of Linearity

We first use vectors in two- and three-dimensional spaces to visualize the concepts of dependence and independence.

Two parallel vectors that are linearly dependent because one is a scalar multiple of the other
Fig. 1: Vectors \( \textbf{v}_1 \) and \( \textbf{v}_2 \) are dependent because they are parallel (\( \textbf{v}_2 = 2\textbf{v}_1 \) or \( \textbf{v}_1 = \frac{1}{2}\textbf{v}_2 \)).
Two antiparallel vectors that are linearly dependent with a negative scalar relationship
Fig. 2: Vectors \( \textbf{v}_1 \) and \( \textbf{v}_2 \) are dependent because they are parallel (\( \textbf{v}_2 = -\textbf{v}_1 \)).
Multiple parallel vectors that are all linearly dependent
Fig. 3: Vectors \( \textbf{v}_1, \textbf{v}_2, \textbf{v}_3, \) and \( \textbf{v}_4 \) are dependent because all are parallel to each other.
Two non-parallel vectors that are linearly independent
Fig. 4: Vectors \( \textbf{v}_1 \) and \( \textbf{v}_2 \) are independent because they are not parallel.
Four linearly dependent vectors showing a linear combination relation
Fig. 5: Dependent vectors, where \( 3\textbf{v}_4 = 2\textbf{v}_1 + 3\textbf{v}_2 + \textbf{v}_3 \).
Three vectors in 3D lying in the same plane, hence linearly dependent
Fig. 6: The 3 vectors \( \textbf{v}_1, \textbf{v}_2, \) and \( \textbf{v}_3 \) lie in the same plane \( P \) and are therefore dependent.
Three vectors in 3D that do not lie in a common plane, hence linearly independent
Fig. 7: The pairs of vectors lie in different planes and are therefore independent.

Formal Definition of Linearity of Vectors

Vectors \( \textbf{v}_1, \textbf{v}_2, \dots, \textbf{v}_n \) are linearly dependent when at least one vector can be expressed as a linear combination of the remaining vectors:

\[ \textbf{v}_1 = r_2\textbf{v}_2 + r_3\textbf{v}_3 + \dots + r_n\textbf{v}_n \]

Rearranging this with zero on the right side yields:

\[ \textbf{v}_1 - r_2\textbf{v}_2 - r_3\textbf{v}_3 - \dots - r_n\textbf{v}_n = \textbf{0} \]

Formal Definition: Given a set of vectors \( S = \{ \textbf{v}_1, \textbf{v}_2, \dots, \textbf{v}_n \} \):

In the examples below, matrices are row-reduced to test for linearity. You can also use the Row Reduce Augmented Matrices Calculator.

Matrix Method: Step-by-Step Procedure

To test whether a set of vectors \( \{ \textbf{v}_1, \textbf{v}_2, \dots, \textbf{v}_n \} \) in \( \mathbb{R}^m \) is linearly independent:

  1. Form the matrix: Construct an \( m \times n \) matrix \( A \) with the vectors as columns: \( A = [\textbf{v}_1 \; \textbf{v}_2 \; \dots \; \textbf{v}_n] \).
  2. Augment with zero: Form the augmented matrix \( [A \; | \; \textbf{0}] \).
  3. Row-reduce: Use Gaussian elimination to reduce the matrix to row echelon form (or reduced row echelon form).
  4. Count pivots: Determine the number of pivot columns.
  5. Conclude:
    • If every column has a pivot, the vectors are linearly independent.
    • If some column lacks a pivot, the vectors are linearly dependent. The coefficients in the non-pivot columns express the dependence relations.

Key Insight: In a non-pivot column, the entries give the coefficients to write that vector as a linear combination of the pivot columns.

Examples with Solutions

Example 1: Testing Linear Dependence in \( \mathbb{R}^2 \)

Show Solution

Are the vectors in the set \( \left\{ \begin{bmatrix} -2 \\ 1 \end{bmatrix}, \begin{bmatrix} 6 \\ -3 \end{bmatrix} \right\} \) linearly independent?


Solution

Let \( \textbf{v}_1 = \begin{bmatrix} -2 \\ 1 \end{bmatrix} \) and \( \textbf{v}_2 = \begin{bmatrix} 6 \\ -3 \end{bmatrix} \).

For vectors with only 2 components, we can easily notice that \( \textbf{v}_2 = -3\textbf{v}_1 \), meaning they are dependent. However, let's use the systematic matrix method applicable to any dimension.

We set up the vector equation \( r_1\textbf{v}_1 + r_2\textbf{v}_2 = \textbf{0} \), which in matrix form is:

\[ \begin{bmatrix} \textbf{v}_1 & \textbf{v}_2 \end{bmatrix} \begin{bmatrix} r_1 \\ r_2 \end{bmatrix} = \mathbf{0} \]

Writing this as an augmented matrix:

\[ \begin{bmatrix} -2 & 6 & | & 0 \\ 1 & -3 & | & 0 \end{bmatrix} \]

Using Gauss-Jordan elimination to row-reduce the matrix:

\[ \begin{bmatrix} 1 & -3 & | & 0 \\ 0 & 0 & | & 0 \end{bmatrix} \quad \text{(I)} \]

Analyzing the reduced system:

  • The second equation gives \( 0r_2 = 0 \), meaning \( r_2 \) can take any real value (free variable).
  • The first equation gives \( r_1 - 3r_2 = 0 \implies r_1 = 3r_2 \).

The solution set is \( \left\{ \begin{bmatrix} 3r_2 \\ r_2 \end{bmatrix} \right\} \) for any \( r_2 \in \mathbb{R} \). Because there are infinitely many solutions, the vectors are linearly dependent.

Quick Matrix Pivot Rules:

  1. Columns with pivots are independent.
  2. Columns without pivots are dependent on the pivot columns.
  3. Coefficients in non-pivot columns indicate the linear dependence relation. In matrix (I), column 2 has no pivot and its coefficient (\(-3\)) shows that \( \textbf{v}_2 = -3\textbf{v}_1 \).

Example 2: Testing Three Vectors in \( \mathbb{R}^3 \)

Show Solution

Are the vectors in the set \( \left\{ \begin{bmatrix} -2 \\ 1 \\ 4 \end{bmatrix}, \begin{bmatrix} 1 \\ 0 \\ 5 \end{bmatrix}, \begin{bmatrix} 1 \\ 2 \\ -1 \end{bmatrix} \right\} \) linearly independent?


Solution

Step 1: Construct the augmented matrix using the given vectors as columns with a zero right-hand side:

\[ \begin{bmatrix} -2 & 1 & 1 & | & 0 \\ 1 & 0 & 2 & | & 0 \\ 4 & 5 & -1 & | & 0 \end{bmatrix} \]

Step 2: Row-reduce the matrix:

\[ \begin{bmatrix} 1 & 0 & 0 & | & 0 \\ 0 & 1 & 0 & | & 0 \\ 0 & 0 & 1 & | & 0 \end{bmatrix} \]

Step 3: Draw conclusions.

All three columns have a pivot. Therefore, all three vectors are linearly independent.

Alternative Check: Since this is a \( 3 \times 3 \) square matrix, we can compute the determinant of the coefficient matrix. If \( \det(A) \neq 0 \), the vectors are independent.

\[ \det \begin{bmatrix} -2 & 1 & 1 \\ 1 & 0 & 2 \\ 4 & 5 & -1 \end{bmatrix} = -2(0 - 10) - 1(-1 - 8) + 1(5 - 0) = 20 + 9 + 5 = 34 \neq 0 \]

Since the determinant is non-zero, the vectors are indeed linearly independent.

Example 3: Finding Dependence Relations in \( \mathbb{R}^4 \)

Show Solution

Are the vectors in the set \( \left\{ \begin{bmatrix} 2 \\ -1 \\ 3 \\ 1 \end{bmatrix}, \begin{bmatrix} 0 \\ 2 \\ -1 \\ 1 \end{bmatrix}, \begin{bmatrix} 4 \\ -8 \\ 9 \\ -1 \end{bmatrix} \right\} \) linearly independent?


Solution

Step 1: Construct the augmented matrix:

\[ \begin{bmatrix} 2 & 0 & 4 & | & 0 \\ -1 & 2 & -8 & | & 0 \\ 3 & -1 & 9 & | & 0 \\ 1 & 1 & -1 & | & 0 \end{bmatrix} \]

Step 2: Row-reduce the matrix:

\[ \begin{bmatrix} 1 & 0 & \color{red}{2} & | & 0 \\ 0 & 1 & \color{blue}{-3} & | & 0 \\ 0 & 0 & 0 & | & 0 \\ 0 & 0 & 0 & | & 0 \end{bmatrix} \]

Step 3: Draw conclusions.

Only the first and second columns have pivots. Therefore, the given vectors are not independent (they are linearly dependent).

The coefficients \( \color{red}{2} \) and \( \color{blue}{-3} \) in the third column express the third vector as a linear combination of the first two:

\[ \begin{bmatrix} 4 \\ -8 \\ 9 \\ -1 \end{bmatrix} = \color{red}{2} \begin{bmatrix} 2 \\ -1 \\ 3 \\ 1 \end{bmatrix} - \color{blue}{3} \begin{bmatrix} 0 \\ 2 \\ -1 \\ 1 \end{bmatrix} \]

Verification:

\[ 2\begin{bmatrix} 2 \\ -1 \\ 3 \\ 1 \end{bmatrix} - 3\begin{bmatrix} 0 \\ 2 \\ -1 \\ 1 \end{bmatrix} = \begin{bmatrix} 4 \\ -2 \\ 6 \\ 2 \end{bmatrix} - \begin{bmatrix} 0 \\ 6 \\ -3 \\ 3 \end{bmatrix} = \begin{bmatrix} 4 \\ -8 \\ 9 \\ -1 \end{bmatrix} \quad \checkmark \]

Frequently Asked Questions

How do you test if vectors are linearly independent?

To test if vectors are linearly independent, form a matrix with the vectors as columns, augment with the zero vector, and row-reduce. If every column has a pivot, the vectors are linearly independent. If any column lacks a pivot, the vectors are linearly dependent.

What is a pivot column?

A pivot column is a column in a row-reduced matrix that contains a leading entry (pivot) of a non-zero row. Pivot columns correspond to linearly independent vectors in the original set.

How do you find the linear dependence relation between vectors?

After row reduction, the coefficients in a non-pivot column express that vector as a linear combination of the pivot columns. These coefficients directly give the linear dependence relation.

Can you determine linear independence using determinants?

Yes, but only for square matrices. For \( n \) vectors in \( \mathbb{R}^n \), if the determinant of the matrix with these vectors as columns is non-zero, the vectors are linearly independent. If the determinant is zero, they are linearly dependent.

What is the maximum number of linearly independent vectors in \( \mathbb{R}^n \)?

In \( \mathbb{R}^n \), the maximum number of linearly independent vectors is \( n \). Any set with more than \( n \) vectors is automatically linearly dependent.

More References and Links