Systems of Linear Equations and Gaussian Elimination
Writing systems as Ax = b, elementary row operations, row echelon and reduced row echelon forms, Gaussian and Gauss–Jordan elimination with back substitution, pivoting and cost, the rank test for consistency (none, unique or infinitely many solutions), homogeneous systems, parametric solutions, Cramer's rule and computing inverses.
Matrix form
A system of linear equations in unknowns is with . The augmented matrix carries all the information.
Geometrically, each equation in is a plane; the solution set is their intersection. Column view: must be a combination of the columns of .
Elementary row operations
- Swap two rows.
- Multiply a row by a non-zero scalar.
- Add a multiple of one row to another.
They do not change the solution set (each is reversible), the row space, the null space or the rank. Each corresponds to left-multiplication by an invertible elementary matrix.
Echelon forms
Row echelon form (REF): all zero rows at the bottom; each row's leading entry (pivot) is to the right of the pivot above it; entries below each pivot are zero.
Reduced row echelon form (RREF): additionally, every pivot is 1 and is the only non-zero entry in its column. RREF is unique; REF is not.
The number of pivots is the rank. Columns with pivots correspond to basic variables; the rest are free variables.
Gaussian elimination
- Forward elimination: for each column, pick a pivot, and subtract multiples of the pivot row to create zeros below it.
- Back substitution: solve the triangular system from the last equation upwards.
Gauss–Jordan continues to RREF, eliminating above the pivots too, so the solution can be read off directly.
Pivoting and stability
A zero (or tiny) pivot forces a row swap. Partial pivoting — choosing the entry of largest absolute value in the column as the pivot — keeps multipliers bounded by 1 and controls round-off error. In matrix terms this gives (see LU and SVD).
Cost: about flops for elimination and for each triangular solve.
When does a solution exist? (Rouché–Capelli)
Let and , with unknowns.
| Condition | Solutions |
|---|---|
| none (a row reads ) | |
| exactly one | |
| infinitely many, with free parameters |
For a square system, a unique solution exists for every iff iff is invertible.
Homogeneous systems
is always consistent (). Non-trivial solutions exist iff — in particular whenever there are more unknowns than equations, or when is square with . The solution set is the null space, of dimension .
Structure of all solutions: if is any particular solution of , then every solution is with in the null space. The solution set is a translated subspace (an affine set), never a subspace unless .
Cramer's rule
For a square system with : , where is with column replaced by . Elegant for and problems, impractical for large ones.
Computing the inverse
Row-reduce . If a zero row appears on the left, is singular. In numerical work you almost never form explicitly — solving by elimination or LU is cheaper and more accurate.
Over- and under-determined systems in data science
- More equations than unknowns (, e.g. regression with many data points): usually inconsistent; we find the least-squares solution — see projections.
- Fewer equations than unknowns: infinitely many solutions; the minimum-norm one is via the pseudo-inverse (see SVD).
Quick revision
Practice questions
GATE-style questions: 3 one-mark and 6 two-mark. Wrong MCQs cost ⅓ of their marks in the real exam; MSQ and NAT have no negative marking. Attempt each before opening the solution.
The system
has infinitely many solutions when
A homogeneous system of 3 equations in 5 unknowns has a coefficient matrix of rank 3. The number of free variables (the dimension of its solution space) is ______.
The solution of , , has ______.
is an matrix and . Which statements are true?
One or more options are correct.
The homogeneous system with coefficient matrix has a non-trivial solution for ______.
The number of arithmetic operations needed to solve a dense system by Gaussian elimination grows as
Using Cramer's rule on , , the value of is ______.
Which of the following is not preserved by elementary row operations on a matrix?
The rank of is ______.