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:
Elementary row operations do not change the dimension of the row space or column space.
Reduce \(A\) to its Row Echelon Form (RREF), let’s call it \(R\).
The dimension of Row(\(R\)) is the number of non-zero rows.
The dimension of Col(\(R\)) is the number of leading 1’s (pivot positions).
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
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:
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.
Number of leading variables = \(\operatorname{rank}(A)\).
Number of free variables = \(\operatorname{nullity}(A)\).
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]
\]
THEOREM 4.8.3: If \(A\) is an \(m \times n\) matrix, then:
\(\operatorname{rank}(A) =\) the number of leading variables in the general solution of \(A\mathbf{x} = \mathbf{0}\).
\(\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
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.
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:
Row space of \(A\)
Column space of \(A\)
Null space of \(A\)
Row space of \(A^T\)
Column space of \(A^T\)
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\)
Geometric Link: Orthogonal Complements
DEFINITION 2: If \(W\) is a subspace of \(\mathbb{R}^n\), then the set of all vectors in \(\mathbb{R}^n\) that are orthogonal to every vector in \(W\) is called the orthogonal complement of \(W\) and is denoted by \(W^\perp\).
THEOREM 4.8.6: If \(W\) is a subspace of \(\mathbb{R}^n\), then:
\(W^\perp\) is a subspace of \(\mathbb{R}^n\).
The only vector common to \(W\) and \(W^\perp\) is \(\mathbf{0}\).
The orthogonal complement of \(W^\perp\) is \(W\), i.e., \((W^\perp)^\perp = W\).
Geometric Link: Orthogonal Complements
Example 5: Orthogonal Complements
In \(\mathbb{R}^2\), the orthogonal complement of a line \(W\) through the origin is the line through the origin perpendicular to \(W\).
Geometric Link: Orthogonal Complements (Cont.)
In \(\mathbb{R}^3\), the orthogonal complement of a plane \(W\) through the origin is the line through the origin perpendicular to that plane.
Interactive: Orthogonal Complement in \(\mathbb{R}^2\)
Adjust the slope of a line (representing subspace \(W\)) and observe its orthogonal complement \(W^\perp\).
viewof slope_m = Inputs.range([-5,5], {step:0.1,value:1,label:"Slope of Line W (m)"});
Fundamental Spaces as Orthogonal Complements
THEOREM 4.8.7: If \(A\) is an \(m \times n\) matrix, then:
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\)
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:
\(A\) is invertible. … (many other statements, e.g., \(\det(A) \neq 0\), columns are linearly independent) …
\(A\) has rank \(n\).
\(A\) has nullity 0.
The orthogonal complement of the null space of \(A\) is \(\mathbb{R}^n\).
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.
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.
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
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.
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).