Linear Algebra

4.8 Rank, Nullity, and Fundamental Matrix Spaces

Imron Rosyadi

Rank, Nullity, and Fundamental Matrix Spaces

Introduction: Why These Concepts Matter in ECE

Linear algebra provides the mathematical backbone for many ECE disciplines.

Today, we delve into Rank, Nullity, and Fundamental Matrix Spaces.

These concepts are crucial for:

  • Understanding System Behavior: Stability, controllability, observability.
  • Data Analysis & Compression: Signal processing, machine learning.
  • Solving Linear Systems: Circuit analysis, control algorithms.
  • Optimizing Resource Allocation: Network routing, power distribution.

Important

Key Takeaway: These abstract concepts have tangible impacts on how we design, analyze, and optimize electrical and computer engineering systems.

Review: Row, Column, and Null Spaces

Before diving deeper, let’s quickly recall the fundamental spaces associated with a matrix \(A\):

  • Row Space (Row(\(A\))): The span of the row vectors of \(A\).
    • Subspace of \(\mathbb{R}^n\) (if \(A\) is \(m \times n\)).
  • Column Space (Col(\(A\))): The span of the column vectors of \(A\).
    • Subspace of \(\mathbb{R}^m\) (if \(A\) is \(m \times n\)).
    • Also known as the image or range of \(A\).
  • Null Space (Null(\(A\))): The set of all vectors \(\mathbf{x}\) such that \(A\mathbf{x} = \mathbf{0}\).
    • Subspace of \(\mathbb{R}^n\).
    • Also known as the kernel of \(A\).

Note

These spaces provide different perspectives on the linear transformation represented by \(A\).

Row and Column Spaces: Equal Dimensions

THEOREM 4.8.1: The row space and the column space of a matrix \(A\) have the same dimension.

Proof Idea:

  1. Elementary row operations do not change the dimension of the row space or column space.
  2. Reduce \(A\) to its Row Echelon Form (RREF), let’s call it \(R\).
  3. The dimension of Row(\(R\)) is the number of non-zero rows.
  4. The dimension of Col(\(R\)) is the number of leading 1’s (pivot positions).
  5. Since the number of non-zero rows is equal to the number of leading 1’s, their dimensions are equal.

Tip

This theorem is fundamental! It links the “horizontal” and “vertical” information content of a matrix.

Visualizing RREF and Dimensions

Here’s a simplified view of how a matrix \(A\) transforms into its Row Echelon Form \(R\):

flowchart LR
    A["Matrix A ($m \times n$)"] -->|"Elementary Row Operations"| R("RREF of A")
    R -- "Number of Non-Zero Rows" --> DimRow("dim(Row(A))")
    R -- "Number of Leading 1's" --> DimCol("dim(Col(A))")

Defining Rank and Nullity

The dimensions of these spaces are so important, they have special names:

DEFINITION 1:

  • The common dimension of the row space and column space of a matrix \(A\) is called the rank of \(A\) and is denoted by \(\operatorname{rank}(A)\).
  • The dimension of the null space of \(A\) is called the nullity of \(A\) and is denoted by \(\operatorname{nullity}(A)\).

Tip

\(\operatorname{rank}(A)\) quantifies the “effective” number of independent rows or columns in \(A\), reflecting its information content or the dimensionality of the output space of the transformation. \(\operatorname{nullity}(A)\) quantifies the “size” of the input space that gets mapped to zero, indicating the redundancy or non-uniqueness of solutions.

Example 1: Rank and Nullity of a \(4 \times 6\) Matrix

Let’s find the rank and nullity of:

\[ A = {\left[ \begin{array}{l l l l l l}{-1} & 2 & 0 & 4 & 5 & {-3}\\ 3 & {-7} & 2 & 0 & 1 & 4\\ 2 & {-5} & 2 & 4 & 6 & 1\\ 4 & {-9} & 2 & {-4} & {-4} & 7 \end{array} \right]} \]

The reduced row echelon form (RREF) of \(A\) is:

\[ R = \left[ \begin{array}{cccccc}1 & 0 & -4 & -28 & -37 & 13 \\ 0 & 1 & -2 & -12 & -16 & 5 \\ 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{array} \right] \]

  • Rank: The RREF has two leading 1’s. So, \(\operatorname{rank}(A) = 2\).
  • Nullity: From the RREF, the system \(A\mathbf{x} = \mathbf{0}\) has 2 leading variables (\(x_1, x_2\)) and 4 free variables (\(x_3, x_4, x_5, x_6\)).
    • The number of free variables directly gives the dimension of the null space.
    • Thus, \(\operatorname{nullity}(A) = 4\).

Interactive: Calculate Rank & Nullity

Enter a matrix (e.g., [[1,2,3],[4,5,6],[7,8,9]]) and see its RREF, Rank, and Nullity.

Maximum Value for Rank

For an \(m \times n\) matrix \(A\):

The row vectors lie in \(\mathbb{R}^n\), so \(\operatorname{dim}(\text{Row}(A)) \leq n\). The column vectors lie in \(\mathbb{R}^m\), so \(\operatorname{dim}(\text{Col}(A)) \leq m\).

Since \(\operatorname{rank}(A)\) is the common dimension, it must satisfy:

\[ \operatorname{rank}(A) \leq \min(m, n) \]

Note

This means the rank can never exceed the number of rows or the number of columns, whichever is smaller.

ECE Application: In signal processing, if you have \(m\) sensors collecting \(n\) samples, the rank of the data matrix tells you the maximum number of independent “features” or “signals” you can extract, limited by either the number of sensors or the number of samples.

Dimension Theorem for Matrices

THEOREM 4.8.2: If \(A\) is a matrix with \(n\) columns, then:

\[ \operatorname{rank}(A) + \operatorname{nullity}(A) = n \]

Proof Idea:

  1. The \(n\) columns (and thus \(n\) variables in \(A\mathbf{x} = \mathbf{0}\)) are divided into two types:
    • Leading variables: Correspond to pivot columns in RREF.
    • Free variables: Correspond to non-pivot columns in RREF.
  2. Number of leading variables = \(\operatorname{rank}(A)\).
  3. Number of free variables = \(\operatorname{nullity}(A)\).
  4. Since (leading variables) + (free variables) = \(n\), the theorem holds.

Important

This theorem, also known as the Rank-Nullity Theorem, is one of the most important results in linear algebra!

ECE Application: System Degrees of Freedom

Consider a control system modeled by \(A\mathbf{x} = \mathbf{b}\):

  • \(n\): Total number of system variables (e.g., states, inputs, outputs).
  • \(\operatorname{rank}(A)\): Number of independent constraints or available output dimensions.
  • \(\operatorname{nullity}(A)\): Number of degrees of freedom in the system’s internal states that do not affect the output, or the number of independent “internal modes” that can be freely chosen without changing the system’s observable behavior.

Example: A robotic arm with \(n\) joints. - If \(\operatorname{rank}(A)\) is the number of controllable degrees of motion, then \(\operatorname{nullity}(A)\) represents the number of “redundant” joint movements that don’t change the end-effector’s position. This is key in robotics for avoiding singularities or optimizing paths.

Example 3: The Sum of Rank and Nullity (Revisited)

For the matrix from Example 1:

\[ A=\left[\begin{array}{r r r r r r}{-1}&{2}&{0}&{4}&{5}&{-3}\\ {3}&{-7}&{2}&{0}&{1}&{4}\\ {2}&{-5}&{2}&{4}&{6}&{1}\\ {4}&{-9}&{2}&{-4}&{-4}&{7}\end{array}\right] \]

  • We found \(\operatorname{rank}(A) = 2\).
  • We found \(\operatorname{nullity}(A) = 4\).
  • The matrix \(A\) has \(n = 6\) columns.

Let’s check the Rank-Nullity Theorem:

\[ \operatorname{rank}(A) + \operatorname{nullity}(A) = 2 + 4 = 6 \]

This is consistent with \(n=6\).

Rank, Nullity, and Linear Systems

THEOREM 4.8.3: If \(A\) is an \(m \times n\) matrix, then:

  1. \(\operatorname{rank}(A) =\) the number of leading variables in the general solution of \(A\mathbf{x} = \mathbf{0}\).
  2. \(\operatorname{nullity}(A) =\) the number of parameters in the general solution of \(A\mathbf{x} = \mathbf{0}\).

THEOREM 4.8.4: If \(A\mathbf{x} = \mathbf{b}\) is a consistent linear system of \(m\) equations in \(n\) unknowns, and if \(A\) has rank \(r\), then the general solution of the system contains \(n - r\) parameters.

Note

For consistent systems, the number of parameters in the general solution is equal to the nullity of the coefficient matrix.

Example 4: Calculating Parameters and Rank

  1. Find the number of parameters in the general solution of \(A\mathbf{x} = \mathbf{0}\) if \(A\) is a \(5 \times 7\) matrix of rank 3.
  • Here, \(n=7\) and \(\operatorname{rank}(A)=3\).
  • Using \(\operatorname{nullity}(A) = n - \operatorname{rank}(A) = 7 - 3 = 4\).
  • Thus, there are four parameters.
  1. Find the rank of a \(5 \times 7\) matrix \(A\) for which \(A\mathbf{x} = \mathbf{0}\) has a two-dimensional solution space.
  • A “two-dimensional solution space” means \(\operatorname{nullity}(A)=2\).
  • Here, \(n=7\).
  • Using \(\operatorname{rank}(A) = n - \operatorname{nullity}(A) = 7 - 2 = 5\).
  • Thus, \(\operatorname{rank}(A) = 5\).

The Four Fundamental Spaces of a Matrix

For an \(m \times n\) matrix \(A\), there are six important vector spaces:

  1. Row space of \(A\)
  2. Column space of \(A\)
  3. Null space of \(A\)
  4. Row space of \(A^T\)
  5. Column space of \(A^T\)
  6. Null space of \(A^T\)

However, only four are distinct:

  • Row space of \(A\) (subspace of \(\mathbb{R}^n\))
  • Column space of \(A\) (subspace of \(\mathbb{R}^m\))
  • Null space of \(A\) (subspace of \(\mathbb{R}^n\))
  • Null space of \(A^T\) (subspace of \(\mathbb{R}^m\))

Tip

The row space of \(A^T\) is the column space of \(A\), and the column space of \(A^T\) is the row space of \(A\).

Relationship Between Rank(A) and Rank(A^T)

THEOREM 4.8.5: If \(A\) is any matrix, then \(\operatorname{rank}(A) = \operatorname{rank}(A^T)\).

Proof: \(\operatorname{rank}(A) = \operatorname{dim}(\text{Row space of } A)\) \(\operatorname{dim}(\text{Row space of } A) = \operatorname{dim}(\text{Column space of } A^T)\) \(\operatorname{dim}(\text{Column space of } A^T) = \operatorname{rank}(A^T)\) Therefore, \(\operatorname{rank}(A) = \operatorname{rank}(A^T)\).

This implies: If \(A\) is \(m \times n\) and \(\operatorname{rank}(A) = r\), then:

  • \(\operatorname{dim}(\text{Row}(A)) = r\)
  • \(\operatorname{dim}(\text{Col}(A)) = r\)
  • \(\operatorname{dim}(\text{Null}(A)) = n - r\)
  • \(\operatorname{dim}(\text{Null}(A^T)) = m - r\)

Interactive: Orthogonal Complement in \(\mathbb{R}^2\)

Adjust the slope of a line (representing subspace \(W\)) and observe its orthogonal complement \(W^\perp\).

Fundamental Spaces as Orthogonal Complements

THEOREM 4.8.7: If \(A\) is an \(m \times n\) matrix, then:

  1. The null space of \(A\) and the row space of \(A\) are orthogonal complements in \(\mathbb{R}^n\).
    • \(\text{Null}(A) = (\text{Row}(A))^\perp\) and \(\text{Row}(A) = (\text{Null}(A))^\perp\)
  2. The null space of \(A^T\) and the column space of \(A\) are orthogonal complements in \(\mathbb{R}^m\).
    • \(\text{Null}(A^T) = (\text{Col}(A))^\perp\) and \(\text{Col}(A) = (\text{Null}(A^T))^\perp\)

Fundamental Spaces as Orthogonal Complements

This theorem reveals the deep geometric connections between the fundamental spaces.

ECE Application:

  • In signal processing, if Row(\(A\)) represents the space of “valid signals,” then Null(\(A\)) represents the space of “noise” that the system completely ignores.
  • In control theory, understanding these orthogonality relationships helps design controllers that specifically target desired system behaviors while being robust to disturbances.

More on the Equivalence Theorem

For an \(n \times n\) matrix \(A\), many statements are equivalent to its invertibility. We can now add statements involving rank and nullity:

THEOREM 4.8.8: Equivalent Statements If \(A\) is an \(n \times n\) matrix, the following statements are equivalent:

  1. \(A\) is invertible. … (many other statements, e.g., \(\det(A) \neq 0\), columns are linearly independent) …
  2. \(A\) has rank \(n\).
  3. \(A\) has nullity 0.
  4. The orthogonal complement of the null space of \(A\) is \(\mathbb{R}^n\).
  5. The orthogonal complement of the row space of \(A\) is \(\{\mathbf{0}\}\).

More on the Equivalence Theorem

Proof of \((b) \Leftrightarrow (n) \Leftrightarrow (o)\):

  • \((b) \implies (o)\): If \(A\mathbf{x} = \mathbf{0}\) has only the trivial solution, then there are no free variables, so \(\operatorname{nullity}(A) = 0\).
  • \((o) \implies (n)\): By Rank-Nullity Theorem, \(\operatorname{rank}(A) + \operatorname{nullity}(A) = n\). If \(\operatorname{nullity}(A) = 0\), then \(\operatorname{rank}(A) = n\).
  • \((n) \implies (b)\): If \(\operatorname{rank}(A) = n\), then there are \(n\) leading variables and 0 free variables. Thus, \(A\mathbf{x} = \mathbf{0}\) has only the trivial solution.

Applications of Rank: Data Compression

Rank plays a crucial role in data compression and data analysis.

  • If \(A\) is an \(m \times n\) matrix of rank \(k\), it means \(n-k\) of its column vectors and \(m-k\) of its row vectors can be expressed as linear combinations of \(k\) independent vectors.
  • This indicates redundancy in the data.
  • Idea: Approximate the original data (matrix \(A\)) with a lower-rank matrix \(A'\) that captures the “essential” information. Then, transmit or store \(A'\), which requires less data.

ECE Examples:

  • Image Compression: A high-resolution image can be represented as a matrix. Using techniques like Singular Value Decomposition (SVD), we can approximate the image with a lower-rank matrix, significantly reducing storage size while maintaining visual quality.
  • Signal Denoising: By projecting a noisy signal onto a lower-rank subspace, we can filter out noise components that lie outside this dominant subspace.
  • Principal Component Analysis (PCA): Used in machine learning and data analysis to reduce the dimensionality of data by finding the directions (principal components) with the highest variance, effectively creating a lower-rank representation.

Overdetermined and Underdetermined Systems

In ECE, systems often have different numbers of equations (constraints) and unknowns (variables).

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

  1. Overdetermined Case (m > n): If there are more equations than unknowns.
    • The linear system \(A\mathbf{x} = \mathbf{b}\) is inconsistent for at least one vector \(\mathbf{b}\) in \(\mathbb{R}^m\).
    • Intuitively: Too many constraints, likely no perfect solution.
  2. Underdetermined Case (m < n): If there are fewer equations than unknowns.
    • For each vector \(\mathbf{b}\) in \(\mathbb{R}^m\), the linear system \(A\mathbf{x} = \mathbf{b}\) is either inconsistent or has infinitely many solutions.
    • Intuitively: Not enough constraints, likely many solutions (or none).

Caution

Overdetermined systems often require least squares solutions (finding the “best fit” solution), common in sensor fusion and parameter estimation.

Underdetermined systems imply degrees of freedom, as seen in redundant robotic arms or network routing.

Example 6: Analyzing Over/Underdetermined Systems

  1. What can you say about the solutions of an overdetermined system \(A\mathbf{x} = \mathbf{b}\) of 7 equations in 5 unknowns (\(m=7, n=5\)) in which \(A\) has rank \(r = 4\)?
  • Since \(m > n\), it’s an overdetermined system.
  • If consistent, the number of parameters is \(n - r = 5 - 4 = 1\).
  • The system may be inconsistent or has solutions with 1 parameter.
  1. What can you say about the solutions of an underdetermined system \(A\mathbf{x} = \mathbf{b}\) of 5 equations in 7 unknowns (\(m=5, n=7\)) in which \(A\) has rank \(r = 4\)?
  • Since \(m < n\), it’s an underdetermined system.
  • If consistent, the number of parameters is \(n - r = 7 - 4 = 3\).
  • The system may be inconsistent or has solutions with 3 parameters (infinitely many).

Example 7: An Overdetermined System (Consistency)

Consider the overdetermined system:

\[ \begin{array}{r}x_{1} - 2x_{2} = b_{1} \\ x_{1} - x_{2} = b_{2} \\ x_{1} + x_{2} = b_{3} \\ x_{1} + 2x_{2} = b_{4} \\ x_{1} + 3x_{2} = b_{5} \end{array} \]

The augmented matrix is row equivalent to:

\[ \left[ \begin{array}{c c c}{1} & 0 & {2b_{2} - b_{1}}\\ 0 & 1 & {b_{2} - b_{1}}\\ 0 & 0 & {b_{3} - 3b_{2} + 2b_{1}}\\ 0 & 0 & {b_{4} - 4b_{2} + 3b_{1}}\\ 0 & 0 & {b_{5} - 5b_{2} + 4b_{1}} \end{array} \right] \]

Example 7: An Overdetermined System (Consistency)

For consistency, the last three entries in the augmented column must be zero:

\[ \begin{array}{r l r l}2b_{1} - 3b_{2} + b_{3} & {} & = 0\\ 3b_{1} - 4b_{2} & {} & +b_{4} & {} = 0\\ 4b_{1} - 5b_{2} & {} & +b_{5} = 0 \end{array} \]

These are the consistency conditions for \(\mathbf{b}\). When consistent, the solution is unique (\(n-r = 2-2=0\) parameters).

Interactive: Check Consistency for Example 7

Enter values for \(b_1, \dots, b_5\) and check if the overdetermined system from Example 7 is consistent.

Summary & ECE Relevance

Today, we’ve explored:

  • Rank: The dimension of the row/column space, indicating independent information.
  • Nullity: The dimension of the null space, indicating redundancy or degrees of freedom.
  • Rank-Nullity Theorem: \(\operatorname{rank}(A) + \operatorname{nullity}(A) = n\).
  • Fundamental Spaces: The four key subspaces (Row(\(A\)), Col(\(A\)), Null(\(A\)), Null(\(A^T\))) and their dimensions.
  • Orthogonal Complements: Geometric relationships between these spaces.
  • Applications: Data compression, system analysis, over/underdetermined systems.

Important

These concepts are not just theoretical; they are the bedrock for:

  • Designing efficient circuits and communication systems.
  • Developing robust control algorithms.
  • Analyzing and compressing large datasets in signal and image processing.
  • Understanding the limitations and capabilities of any linear ECE system.