Matrix Rank Calculator
Free Matrix rank Calculator for fractions. Enter values to get step-by-step solutions with formulas and graphs. Includes formulas and worked examples.
Reviewed for accuracy by Manoj Kumar, Mathematics Educator
Matrix Rank Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: rank(A) = number of pivot positions in row echelon form
Worked example โ Rank: 2 | Nullity: 1 | Not full rank | 2 pivot columns
Formula
rank(A) = number of pivot positions in row echelon form
The rank is computed by transforming the matrix to row echelon form using Gaussian elimination and counting the number of non-zero rows (pivot rows). The nullity equals the number of columns minus the rank, per the rank-nullity theorem.
Worked Examples
Example 1: Rank of a 3x3 Singular Matrix
Problem:Find the rank of A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]].
Solution:Row reduce: R2 = R2 - 4*R1: [[1,2,3],[0,-3,-6],[7,8,9]] R3 = R3 - 7*R1: [[1,2,3],[0,-3,-6],[0,-6,-12]] R3 = R3 - 2*R2: [[1,2,3],[0,-3,-6],[0,0,0]] 2 nonzero rows = rank 2. Row 3 = Row 1 + Row 2, confirming linear dependence.
Result:Rank: 2 | Nullity: 1 | Not full rank | 2 pivot columns
Example 2: Rank of a Full-Rank 2x3 Matrix
Problem:Find the rank of A = [[1, 0, 2], [0, 1, 3]].
Solution:The matrix is already in row echelon form with 2 pivots (columns 1 and 2). Both rows are linearly independent. Rank = 2 = min(2, 3), so the matrix has full rank. Nullity = 3 - 2 = 1 (one free variable, column 3).
Result:Rank: 2 (full rank) | Nullity: 1 | Full row rank | 2 pivot columns
Frequently Asked Questions
What is the rank of a matrix and what does it represent?
The rank of a matrix is the maximum number of linearly independent rows (or equivalently, linearly independent columns). It represents the dimension of the column space (also called the range or image) of the matrix. Intuitively, the rank tells you the true dimensionality of the information contained in the matrix. A 3x3 matrix with rank 2 means that while it appears three-dimensional, its columns actually span only a two-dimensional subspace. The rank determines how many independent equations exist in a linear system, how much the associated transformation compresses space, and whether the system has a unique solution, infinitely many solutions, or no solution.
How is the rank computed using row echelon form?
The rank is computed by transforming the matrix into row echelon form (REF) using Gaussian elimination and then counting the number of non-zero rows. Gaussian elimination applies three row operations that do not change the rank: swapping two rows, multiplying a row by a nonzero scalar, and adding a scalar multiple of one row to another. After elimination, the matrix has a staircase pattern where each leading entry (pivot) is to the right of the one above it. The number of pivots equals the rank. This method is both theoretically elegant and computationally efficient, requiring approximately n cubed divided by 3 operations for an n x n matrix, making it the standard algorithm in numerical linear algebra.
What is the rank-nullity theorem?
The rank-nullity theorem states that for an m x n matrix A, the rank of A plus the nullity of A equals n (the number of columns). The nullity is the dimension of the null space (kernel), which is the set of all vectors x such that Ax = 0. This theorem provides a fundamental constraint: every column either contributes to the rank (as part of a pivot column) or to the nullity (as a free variable). If a 5x3 matrix has rank 2, its nullity is 1, meaning the null space is one-dimensional. This theorem is crucial for understanding solution spaces of linear systems, where the nullity determines the number of free parameters in the general solution.
What does it mean for a matrix to have full rank?
A matrix has full rank when its rank equals the smaller of its row and column counts, meaning rank equals min(m, n) for an m x n matrix. For square matrices, full rank means rank equals n, which is equivalent to the matrix being invertible (having a nonzero determinant). A matrix with full row rank (rank = m) means all rows are linearly independent, and the system Ax = b has at least one solution for every b. A matrix with full column rank (rank = n) means all columns are independent, and the system Ax = b has at most one solution for any b. Full rank is desirable in statistical regression because it ensures unique parameter estimates.
How does rank relate to the solvability of linear systems?
The rank determines whether a system Ax = b has solutions and how many. By the Rouche-Capelli theorem, the system is consistent (has at least one solution) if and only if the rank of A equals the rank of the augmented matrix [A|b]. If consistent with rank r and n unknowns, the solution space has dimension n - r. When n - r = 0, there is a unique solution. When n - r > 0, there are infinitely many solutions parameterized by n - r free variables. When the augmented matrix has higher rank than A, the system is inconsistent with no solutions. This analysis provides a complete classification of linear system behavior based on a single computable quantity.
What is the relationship between rank and determinant?
For square matrices, the determinant is nonzero if and only if the matrix has full rank. A rank-deficient square matrix (rank less than n) always has determinant zero, making it singular. However, the determinant provides more information than just full rank versus not: its value indicates the scaling factor of the transformation and its sign indicates orientation. For non-square matrices, the determinant is not defined, but rank still makes sense. The rank can be related to the largest non-vanishing minor determinant: the rank of a matrix equals the size of the largest square submatrix with a nonzero determinant, providing an alternative characterization of rank.
How is matrix rank used in data science and statistics?
In data science, matrix rank reveals the intrinsic dimensionality of datasets. A data matrix with n features but rank r < n indicates that only r features are truly independent, with the rest being linear combinations. Principal Component Analysis (PCA) exploits this by finding the rank-r approximation that captures the most variance. In regression, the rank of the design matrix must equal the number of parameters for unique estimation. Rank deficiency causes multicollinearity, leading to unstable coefficient estimates. In recommendation systems, low-rank matrix factorization assumes that user-item interaction matrices have low rank, reflecting a small number of latent factors that explain preferences.
What are pivot columns and free variables?
Pivot columns are the columns of the original matrix that correspond to leading entries (pivots) in the row echelon form. These columns form a basis for the column space and are linearly independent. The remaining columns are called free columns, and the corresponding variables in a linear system are free variables that can take any value. The number of pivot columns equals the rank, and the number of free columns equals the nullity. In solving Ax = b, you express pivot variables in terms of free variables, with each free variable contributing one basis vector to the null space. Identifying pivots and free variables is the practical output of Gaussian elimination.
Can the row rank and column rank of a matrix differ?
No, the row rank and column rank of any matrix are always equal, and this common value is simply called the rank. This is a fundamental theorem in linear algebra that is perhaps surprising because rows and columns seem to play different roles. The proof relies on showing that row operations preserve column rank and that the row echelon form makes the row rank obvious (number of nonzero rows) while preserving column relationships. This equality has important implications: for an m x n matrix, the rank cannot exceed min(m, n), and the dimensions of the row space and column space are always the same. This symmetry between rows and columns underlies the duality in linear programming.
What is numerical rank and why does it matter in computation?
Numerical rank addresses the fact that in floating-point computation, exact zero rarely occurs. Theoretically rank-deficient matrices may have very small but nonzero values due to rounding errors, making them appear full rank. The numerical rank is determined using a tolerance threshold: singular values below the threshold are treated as zero. The standard threshold is typically the machine epsilon times the largest singular value times the matrix dimension. This concept is critical in engineering applications where measurement noise can inflate the apparent rank. Algorithms like truncated SVD compute the numerical rank robustly, enabling reliable dimensionality reduction and system identification even with noisy data.
References
Reviewed for accuracy by Manoj Kumar, Mathematics Educator ยท Editorial policy
Related Calculators
๐งฎMatrix Exponential Calculator
Calculate matrix exponential with inputs, formulas, and instant results.
๐งฎMatrix Addition and Subtraction Calculator
Calculate matrix addition and subtraction with inputs, formulas, and instant results.
๐งฎMatrix by Scalar Calculator
Calculate matrix by scalar with inputs, formulas, and instant results.
๐งฎMatrix Determinant Calculator
Calculate matrix determinant with inputs, formulas, and instant results.
๐งฎMatrix Multiplication Calculator
Calculate matrix multiplication with inputs, formulas, and instant results.
๐งฎMatrix Norm Calculator
Calculate matrix norm with inputs, formulas, and instant results.
๐งฎMatrix Power Calculator
Calculate matrix power with inputs, formulas, and instant results.
๐งฎMatrix Trace Calculator
Calculate matrix trace with inputs, formulas, and instant results.