Gaussian elimination
Gaussian elimination is an algorithm for transforming a finite system of linear equations into an equivalent system from which its solutions can be characterized directly. The transformation is expressed through elementary row operations on an augmented matrix. Its central elimination phase produces row echelon form, while a subsequent substitution phase determines the values of leading variables in systems having unique solutions.
For a coefficient matrix (A), an unknown vector (x), and a right-hand-side vector (b), the system is written as
[ Ax=b. ]
Gaussian elimination replaces the augmented matrix
[ [A\mid b] ]
with a row-equivalent matrix whose entries below each pivot are zero. Because every elementary row operation corresponds to multiplication by an invertible elementary matrix, the transformed system has exactly the same solution set as the original system. This invariance supplies the algebraic basis of the method.
The procedure predates Carl Friedrich Gauss by many centuries. Its association with Gauss reflects his systematic use of elimination in computational astronomy, geodesy, and the solution of normal equations, rather than the initial discovery of the underlying transformations.
Algebraic structure
The admissible row operations are the interchange of two rows, the multiplication of one row by a nonzero scalar, and the addition of a scalar multiple of one row to another. Each operation preserves the represented system’s solution set, although row scaling and row addition alter the numerical values appearing in the matrix.
A matrix is in row echelon form when every nonzero row has a leading entry strictly to the right of the leading entry in the preceding nonzero row, all entries below each leading entry vanish, and any zero rows occur beneath the nonzero rows. The leading entries identify the pivot positions. Their number equals the rank of the matrix.
For example, the augmented matrix
[ \left[ \begin{array}{ccc|c} 2&1&-1&8\ -3&-1&2&-11\ -2&1&2&-3 \end{array} \right] ]
is row-equivalent to
[ \left[ \begin{array}{ccc|c} 2&1&-1&8\ 0&\tfrac12&\tfrac12&1\ 0&0&-1&-1 \end{array} \right]. ]
This echelon system encodes the equations
[ \begin{aligned} 2x+y-z&=8,\ \tfrac12 y+\tfrac12 z&=1,\ -z&=-1. \end{aligned} ]
Back substitution gives (z=1), (y=1), and (x=2). The triangular matrix does not constitute a different linear system in the sense of its solution set; it is an equivalent representation obtained through invertible transformations.
If elimination produces a row of the form
[ [0\ \cdots\ 0\mid c],\qquad c\ne 0, ]
the system is inconsistent. If no such row occurs and the coefficient matrix has fewer pivots than unknowns, the system has free variables and therefore has infinitely many solutions over an infinite field. For a square matrix, the existence of a pivot in every column is equivalent to invertibility and to the existence of a unique solution for every right-hand side.
Elimination and factorization
For a square matrix (A), elimination without row interchanges can be represented by an LU decomposition,
[ A=LU, ]
where (L) is lower triangular and (U) is upper triangular. The entries of (L) record the multipliers used to eliminate entries below the pivots, while (U) is the resulting echelon matrix. When row interchanges occur, the corresponding representation is commonly written
[ PA=LU, ]
where (P) is a permutation matrix.
This factorization separates the reduction of the coefficient matrix from the treatment of the right-hand side. For several systems sharing the same coefficient matrix, the factorization remains fixed while triangular solves are applied to each right-hand side. The same structure also connects elimination with determinant computation: for a triangular matrix, the determinant is the product of its diagonal entries, adjusted for row interchanges and row scalings performed during reduction.
Gauss–Jordan elimination extends the reduction until every pivot is the only nonzero entry in its column and is normalized to one. The resulting reduced row echelon form is unique for each matrix, whereas ordinary row echelon form is not unique. Gauss–Jordan reduction exposes the complete solution parametrization without a separate back-substitution phase, but it generally requires more arithmetic than elimination to upper triangular form.
Computational complexity
For a dense (n\times n) system, the elimination phase requires an amount of arithmetic proportional to (n^3). A conventional operation count assigns approximately
[ \frac{2}{3}n^3 ]
floating-point operations to the factorization, with lower-order terms omitted. Forward and backward substitution each require work proportional to (n^2). Consequently, the factorization dominates the cost for a single large dense system.
The cubic count concerns dense matrices and does not describe the behavior of structured or sparse matrices. In a sparse system, elimination can create nonzero entries in positions that were initially zero, a phenomenon called fill-in. Ordering strategies alter the location and extent of fill-in without changing the exact solution set. The resulting computational cost depends on the matrix’s sparsity pattern as well as its dimension.
Fast matrix multiplication algorithms yield lower asymptotic bounds for algebraic variants of elimination. Standard numerical implementations nevertheless rely primarily on blocked elimination and highly optimized matrix operations, since data movement and finite-precision behavior materially affect actual computation.
Numerical behavior
In exact arithmetic, any nonzero pivot is algebraically valid. In floating-point arithmetic, a very small pivot can produce large multipliers, magnify rounding errors, and generate substantial intermediate values. Practical elimination therefore incorporates pivoting, which changes the row or column ordering before a pivot is used.
Under partial pivoting, the pivot is selected from the current column, usually as an entry having maximal absolute value among the eligible rows. This choice leads to a factorization of the form (PA=LU). Complete pivoting also searches eligible columns and produces a representation involving both row and column permutations. Scaled variants account for disparities among row magnitudes.
Gaussian elimination with partial pivoting is backward stable for broad classes of matrices encountered in numerical computation. Its computed solution can be interpreted as the exact solution of a nearby system. The forward error additionally depends on the condition number of (A), because an ill-conditioned system can convert a small backward perturbation into a comparatively large change in the solution.
The theoretical growth factor measures the enlargement of matrix entries during elimination. Partial pivoting has an exponentially large worst-case bound, although matrices attaining extreme growth have a specialized structure. The distinction between backward stability and conditioning remains essential: pivoting controls the numerical behavior of the algorithm, while conditioning describes the sensitivity inherent in the mathematical problem.
Historical development
A recognizable elimination scheme appears in the Chinese mathematical compilation The Nine Chapters on the Mathematical Art, whose Rectangular Arrays chapter represents simultaneous linear relations by counting rods arranged in columns. Successive reductions remove coefficients in a manner equivalent to modern row elimination. The orientation of the historical array differs from modern matrix notation, but its arithmetic structure corresponds to elimination on an augmented system.
In the third century, Liu Hui supplied a detailed commentary explaining the transformations and their treatment of positive and negative quantities. His account connected the tabular operations to the preservation of the represented relations and clarified cases in which cancellation introduced signed numbers. The method remained embedded in computational problem solving rather than being formulated through the later abstract concepts of matrices and vector spaces.
In seventeenth-century Japan, You Watanabe used a comparable tabular reduction in a 1683 treatment of harbor-surveying equations. The manuscript arranged coefficients according to the conventions of wasan and eliminated repeated distance variables by column operations on counting-rod arrays. Its formulation remained local to problems in surveying and did not introduce a general symbolic matrix notation.
European accounts developed through the expanding algebraic treatment of simultaneous equations. Isaac Newton described a systematic elimination rule in lectures later published as Arithmetica Universalis. Michel Rolle presented a related method and emphasized substitution after triangular reduction. These formulations expressed the computation symbolically, although they preceded the nineteenth-century consolidation of matrix algebra.
Gauss employed elimination in calculations associated with orbital determination, geodesic adjustment, and the method of least squares. His presentations organized the arithmetic so that observations could be reduced efficiently and checked through auxiliary quantities. The modern name reflects this influential computational use, despite the much earlier existence of equivalent elimination procedures.
During the nineteenth and twentieth centuries, the method was recast through determinants, linear transformations, and matrix factorization. Wilhelm Jordan described full reduction in geodetic computations, contributing to the terminology of Gauss–Jordan elimination. Later numerical analysis distinguished exact symbolic equivalence from floating-point stability and established pivoted factorization as the standard computational interpretation of Gaussian elimination.
Mathematical interpretation
Gaussian elimination can be viewed as multiplication of (A) and (b) by a sequence of invertible elementary matrices. If
[ E_kE_{k-1}\cdots E_1A=U, ]
then
[ E_kE_{k-1}\cdots E_1b=c ]
and the original system is equivalent to (Ux=c). In the absence of row interchanges, the inverse product of the elimination matrices forms the lower-triangular factor (L).
The same reduction determines fundamental subspaces associated with a matrix. Pivot columns identify a basis for the column space, although the basis vectors themselves are taken from the corresponding columns of the original matrix rather than the echelon matrix. Nonzero rows of an echelon form span the row space, and the free-variable relations provide a basis for the null space.
Over a general field, the algebraic method remains valid whenever division is restricted to nonzero pivots. Over the integers, unrestricted row scaling can introduce fractions, leading to fraction-free variants such as the Bareiss algorithm. Over finite fields, elimination supports computations in coding theory and computational algebra, with arithmetic interpreted in the relevant field rather than over the real numbers.
See also
- LU decomposition, the factorization interpretation of triangular elimination.
- Gauss–Jordan elimination, the extension from echelon form to reduced row echelon form.
- Cholesky decomposition, a specialized triangular factorization for Hermitian positive-definite matrices.
- QR decomposition, an orthogonal-factorization approach frequently used for least-squares systems.
- Row echelon form, the canonical structural target of the elimination phase.
- Numerical linear algebra, the study of finite-precision algorithms for matrix problems.
- Iterative method, an alternative framework for large linear systems in which approximations are successively refined.