Gaussian Elimination: Solving Linear Systems

3868 words
19 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# Gaussian Elimination: Solving Linear Systems ## ๐ŸŽฏ Learning Objectives After this topic you will be able to: - Identify row echelon form (REF) and reduced row echelon form (RREF) - Perform the three elementary row operations - Carry out Gaussian elimination to transform any matrix to REF - Carry out Gauss-Jordan e...

Gaussian Elimination: Solving Linear Systems

๐ŸŽฏ Learning Objectives

After this topic you will be able to:
  • Identify row echelon form (REF) and reduced row echelon form (RREF)
  • Perform the three elementary row operations
  • Carry out Gaussian elimination to transform any matrix to REF
  • Carry out Gauss-Jordan elimination to transform any matrix to RREF
  • Determine whether a linear system has zero, one, or infinitely many solutions
  • Express solution sets in parametric form using free variables
  • Compute the rank of a matrix from its RREF

๐Ÿ“‹ Prerequisites

  • Matrices Introduction (Week 1) โ€” matrix notation, matrix-vector multiplication
  • Determinants (Week 1) โ€” testing invertibility
  • Vectors Introduction (Week 1) โ€” column vectors and linear combinations
  • Gaussian elimination is the master algorithm of linear algebra โ€” it underlies finding bases, ranks, null spaces, and inverses

1. The Problem: Solving Ax=bA\mathbf{x} = \mathbf{b}

1.1 Intuition: From Messy to Clean

Imagine you have a system of equations. The equations are messy โ€” coefficients everywhere. We want to transform them into something clean where the solution is obvious. Row operations are like legal algebraic moves (swap equations, multiply an equation by a non-zero constant, add a multiple of one equation to another). They don't change the solution set. We systematically apply these moves until the system is in a form we can read the answer from directly. (Diagram)

2. Row Echelon Form (REF)

2.1 Definition

A matrix is in row echelon form if:
  1. All non-zero rows are above any zero rows
  2. The leading (first non-zero) entry of each row is to the right of the leading entry in the row above
  3. All entries below a leading entry are zero The leading entry (or pivot) is the first non-zero element in a row. In REF, pivots are typically normalised to 1 for convenience (though the definition doesn't require it).

2.2 Examples

โœ“ REF (correct):
[12โˆ’1300120000]\begin{bmatrix} 1 & 2 & -1 & 3 \\ 0 & 0 & 1 & 2 \\ 0 & 0 & 0 & 0 \end{bmatrix}
โœ— Not REF (violation):
[001212โˆ’130000](rowย 2โ€™sย pivotย atย columnย 1ย isย toย theย leftย ofย rowย 1โ€™sย pivotย atย columnย 3ย โ€”ย wrongย order)\begin{bmatrix} 0 & 0 & 1 & 2 \\ 1 & 2 & -1 & 3 \\ 0 & 0 & 0 & 0 \end{bmatrix} \quad \text{(row 2's pivot at column 1 is to the left of row 1's pivot at column 3 โ€” wrong order)}

2.3 Reduced Row Echelon Form (RREF)

A matrix is in RREF if it is in REF and additionally:
  1. The leading entry in each non-zero row is 11
  2. Each leading 11 is the only non-zero entry in its column โœ“ RREF (correct):
[120700120000]\begin{bmatrix} 1 & 2 & 0 & 7 \\ 0 & 0 & 1 & 2 \\ 0 & 0 & 0 & 0 \end{bmatrix}

3. Elementary Row Operations

There are exactly three operations that preserve the solution set:
OperationNotationExampleEffect
SwapRiโ†”RjR_i \leftrightarrow R_jSwap rows 1 and 2Changes order
ScaleRiโ†’cRiR_i \to c R_i , cโ‰ 0c \neq 0Multiply row 2 by 13\frac{1}{3}Simplifies entries
Add multipleRiโ†’Ri+cRjR_i \to R_i + c R_jR2โ†’R2โˆ’2R1R_2 \to R_2 - 2R_1Eliminates entries
Key insight: Adding a multiple of one row to another preserves the determinant. Swapping flips its sign. Scaling scales the determinant by cc.

4. Gaussian Elimination Algorithm

4.1 Forward Elimination (to REF)

Given an mร—nm \times n matrix AA:
  1. Start with the leftmost non-zero column (pivot column)
  2. Find a pivot: select a non-zero entry in this column. If none exists, move to the next column
  3. Swap (if needed): bring the pivot row to the top
  4. Scale (optional): make the pivot 11
  5. Eliminate below: use row operations to create zeros below the pivot
  6. Repeat: ignore the pivot row and repeat steps 1-5 on the remaining submatrix
Example 1: Gaussian elimination (3 equations, 3 unknowns)
Solve:
>{x+2y+z=82x+4yโˆ’z=โˆ’13x+2yโˆ’2z=โˆ’1>> \begin{cases} x + 2y + z = 8 \\ 2x + 4y - z = -1 \\ 3x + 2y - 2z = -1 \end{cases} >
Augmented matrix:
>[121824โˆ’1โˆ’132โˆ’2โˆ’1]>> \left[\begin{array}{ccc|c} 1 & 2 & 1 & 8 \\ 2 & 4 & -1 & -1 \\ 3 & 2 & -2 & -1 \end{array}\right] >
Step 1: Already have pivot (1,1)=1(1,1) = 1.
Step 2: Eliminate column 1 below pivot:
>R2โ†’R2โˆ’2R1,R3โ†’R3โˆ’3R1>> R_2 \to R_2 - 2R_1,\quad R_3 \to R_3 - 3R_1 >
>[121800โˆ’3โˆ’170โˆ’4โˆ’5โˆ’25]>> \left[\begin{array}{ccc|c} 1 & 2 & 1 & 8 \\ 0 & 0 & -3 & -17 \\ 0 & -4 & -5 & -25 \end{array}\right] >
Step 3: Next pivot is in column 2. Row 2 has a 0 in column 2, so swap R2โ†”R3R_2 \leftrightarrow R_3:
>[12180โˆ’4โˆ’5โˆ’2500โˆ’3โˆ’17]>> \left[\begin{array}{ccc|c} 1 & 2 & 1 & 8 \\ 0 & -4 & -5 & -25 \\ 0 & 0 & -3 & -17 \end{array}\right] >
Step 4: Scale pivots (optional but helpful):
>R2โ†’โˆ’14R2,R3โ†’โˆ’13R3>> R_2 \to -\frac{1}{4}R_2,\quad R_3 \to -\frac{1}{3}R_3 >
>[12180154254001173]>> \left[\begin{array}{ccc|c} 1 & 2 & 1 & 8 \\ 0 & 1 & \frac{5}{4} & \frac{25}{4} \\ 0 & 0 & 1 & \frac{17}{3} \end{array}\right] >
Step 5: Back substitution. From row 3: z=173z = \frac{17}{3}.
From row 2: y+54z=254โ‡’y=254โˆ’54โ‹…173=75โˆ’8512=โˆ’1012=โˆ’56y + \frac{5}{4}z = \frac{25}{4} \Rightarrow y = \frac{25}{4} - \frac{5}{4}\cdot\frac{17}{3} = \frac{75 - 85}{12} = -\frac{10}{12} = -\frac{5}{6}
From row 1: x+2y+z=8โ‡’x=8โˆ’2(โˆ’56)โˆ’173=8+53โˆ’173=243+53โˆ’173=123=4x + 2y + z = 8 \Rightarrow x = 8 - 2(-\frac{5}{6}) - \frac{17}{3} = 8 + \frac{5}{3} - \frac{17}{3} = \frac{24}{3} + \frac{5}{3} - \frac{17}{3} = \frac{12}{3} = 4
Solution: x=4x = 4, y=โˆ’56y = -\frac{5}{6}, z=173z = \frac{17}{3}.

4.2 Gauss-Jordan Elimination (to RREF)

Instead of stopping at REF and back-substituting, we continue eliminating above each pivot to get RREF:
  1. Perform forward elimination (to REF)
  2. Scale each row so pivots are 11
  3. Eliminate upward: for each pivot, use row operations to create zeros above it
Example 2: Gauss-Jordan (same system)
Start from REF:
>[12180154254001173]>> \left[\begin{array}{ccc|c} 1 & 2 & 1 & 8 \\ 0 & 1 & \frac{5}{4} & \frac{25}{4} \\ 0 & 0 & 1 & \frac{17}{3} \end{array}\right] >
Step 1: Eliminate above pivot in column 3:
>R2โ†’R2โˆ’54R3,R1โ†’R1โˆ’R3>> R_2 \to R_2 - \frac{5}{4}R_3,\quad R_1 \to R_1 - R_3 >
>[12073010โˆ’56001173]>> \left[\begin{array}{ccc|c} 1 & 2 & 0 & \frac{7}{3} \\ 0 & 1 & 0 & -\frac{5}{6} \\ 0 & 0 & 1 & \frac{17}{3} \end{array}\right] >
Step 2: Eliminate above pivot in column 2:
>R1โ†’R1โˆ’2R2>> R_1 \to R_1 - 2R_2 >
>[1004010โˆ’56001173]>> \left[\begin{array}{ccc|c} 1 & 0 & 0 & 4 \\ 0 & 1 & 0 & -\frac{5}{6} \\ 0 & 0 & 1 & \frac{17}{3} \end{array}\right] >
Solution is now read directly from the RREF: x=4,y=โˆ’56,z=173x=4, y=-\frac{5}{6}, z=\frac{17}{3}.

5. Three Cases for Solution Sets

A linear system can have:
CaseConditionRREF PatternExample in R2\mathbb{R}^2
Unique solutionrank = number of variablesEvery column (except last) has a pivotTwo intersecting lines
No solutionA row like $[0;0;\dots;0;;c] withwith c \neq 0$Inconsistent row
Infinitely many solutionsrank < number of variablesAt least one column without a pivot (free variable)Two coincident lines
Rank = number of non-zero rows (pivots) in RREF.

5.1 Case 1: Unique Solution (already seen in Example 1)

5.2 Case 2: No Solution (Inconsistent)

Example 3: Inconsistent system
>{x+y=22x+2y=5>> \begin{cases} x + y = 2 \\ 2x + 2y = 5 \end{cases} >
Augmented matrix and row reduction:
>[112225]โ†’R2โ†’R2โˆ’2R1[112001]>> \left[\begin{array}{cc|c} 1 & 1 & 2 \\ 2 & 2 & 5 \end{array}\right] \xrightarrow{R_2 \to R_2 - 2R_1} \left[\begin{array}{cc|c} 1 & 1 & 2 \\ 0 & 0 & 1 \end{array}\right] >
Row 2 says 0x+0y=10x + 0y = 1, which is impossible. No solution.

5.3 Case 3: Infinitely Many Solutions

Example 4: Infinitely many solutions
>{x+2yโˆ’z=12x+4yโˆ’2z=2>> \begin{cases} x + 2y - z = 1 \\ 2x + 4y - 2z = 2 \end{cases} >
Augmented matrix:
>[12โˆ’1124โˆ’22]โ†’R2โ†’R2โˆ’2R1[12โˆ’110000]>> \left[\begin{array}{ccc|c} 1 & 2 & -1 & 1 \\ 2 & 4 & -2 & 2 \end{array}\right] \xrightarrow{R_2 \to R_2 - 2R_1} \left[\begin{array}{ccc|c} 1 & 2 & -1 & 1 \\ 0 & 0 & 0 & 0 \end{array}\right] >
RREF:
>[12โˆ’110000]>> \begin{bmatrix} 1 & 2 & -1 & 1 \\ 0 & 0 & 0 & 0 \end{bmatrix} >
Columns 1 and 3 have pivots? Actually column 2 has no pivot (free variable). Column 1 has pivot. Column 3 has no pivot.
Wait โ€” let me re-check. We have pivots in column 1 only. So columns 2 and 3 are free.
Solution: x=1โˆ’2y+zx = 1 - 2y + z, where y,zy, z are free variables (can be any real number).
In parametric vector form:
>[xyz]=[100]+y[โˆ’210]+z[101]>> \begin{bmatrix} x \\ y \\ z \end{bmatrix} = \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix} + y\begin{bmatrix} -2 \\ 1 \\ 0 \end{bmatrix} + z\begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix} >

6. Rank of a Matrix

Definition (Rank). The rank of a matrix AA is the number of non-zero rows in its RREF (equivalently, the number of pivots).
rank(A)=numberย ofย pivots\text{rank}(A) = \text{number of pivots}
Properties:
  • rank(A)โ‰คminโก(m,n)\text{rank}(A) \leq \min(m, n) for Amร—nA_{m \times n}
  • rank(A)=rank(AT)\text{rank}(A) = \text{rank}(A^T)
  • rank(A)=dimโก(columnย spaceย ofย A)\text{rank}(A) = \dim(\text{column space of } A)
  • rank(AB)โ‰คminโก(rank(A),rank(B))\text{rank}(AB) \leq \min(\text{rank}(A), \text{rank}(B))
Example 5: Finding rank
>A=[123246369]โ†’R2โˆ’2R1,โ€…โ€ŠR3โˆ’3R1[123000000]>> A = \begin{bmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 3 & 6 & 9 \end{bmatrix} \xrightarrow{R_2 - 2R_1,\; R_3 - 3R_1} \begin{bmatrix} 1 & 2 & 3 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix} >
Rank = 1 (only one pivot).

7. Homogeneous Systems (Ax=0A\mathbf{x} = \mathbf{0})

Definition (Homogeneous). A system Ax=0A\mathbf{x} = \mathbf{0} (all right-hand sides are zero) is homogeneous. Key facts:
  • Always has at least the trivial solution x=0\mathbf{x} = \mathbf{0}
  • Has non-trivial solutions iff there is at least one free variable (i.e., rank < number of columns)
  • The solution set is a vector space (the null space of AA)
Example 6: Homogeneous system
>{x+2yโˆ’z=02x+4y+z=0>> \begin{cases} x + 2y - z = 0 \\ 2x + 4y + z = 0 \end{cases} >
>[12โˆ’1241]โ†’R2โˆ’2R1[12โˆ’1003]โ†’13R2[12โˆ’1001]>> \begin{bmatrix} 1 & 2 & -1 \\ 2 & 4 & 1 \end{bmatrix} \xrightarrow{R_2 - 2R_1} \begin{bmatrix} 1 & 2 & -1 \\ 0 & 0 & 3 \end{bmatrix} \xrightarrow{\frac{1}{3}R_2} \begin{bmatrix} 1 & 2 & -1 \\ 0 & 0 & 1 \end{bmatrix} >
>โ†’R1+R2[120001]>> \xrightarrow{R_1 + R_2} \begin{bmatrix} 1 & 2 & 0 \\ 0 & 0 & 1 \end{bmatrix} >
Pivots in columns 1 and 3. Column 2 is free.
x=โˆ’2yx = -2y, z=0z = 0, yy free.
Solution:
>[xyz]=y[โˆ’210]>> \begin{bmatrix} x \\ y \\ z \end{bmatrix} = y \begin{bmatrix} -2 \\ 1 \\ 0 \end{bmatrix} >
.

8. Algorithm Summary

(Diagram)

9. Edge Cases & Gotchas

SituationWhat Happens
Pivot is zeroNeed to swap with a row below; if none, move to next column
All-zero row in coefficient matrixEither redundant (consistent) or impossible (inconsistent depending on RHS)
Free variablesIndicate infinitely many solutions; parameterise them
**Rectangular matrix m<nm < n **Always have free variables (more unknowns than equations)
Numerical precisionFloating-point arithmetic can create near-zero pivots; use partial pivoting

10. Common Pitfalls

โŒ Pitfall 1: Arithmetic errors in elimination

Track every operation carefully. Use fractions or rational arithmetic. Double-check that Riโ†’Ri+cRjR_i \to R_i + cR_j (adding cc times row jj to row ii) leaves row jj unchanged.

โŒ Pitfall 2: Forgetting to apply operations to the RHS

When working with the augmented matrix, every row operation affects both the coefficient matrix and the right-hand side.

โŒ Pitfall 3: Misidentifying free variables after Gauss-Jordan

In RREF, a column without a pivot (except the last column) corresponds to a free variable. The pivot columns are basic variables.

โŒ Pitfall 4: Thinking REF requires pivots to be 1

REF does not require leading entries to be 1 (RREF does). Many textbooks normalise to 1 during forward elimination for convenience.

11. Formula Summary Table

ConceptDescription
REFEach pivot right of previous pivot; zeros below pivots
RREFREF + pivots are 1 + zeros above and below
Elementary row opsSwap, scale ( cโ‰ 0c \neq 0 ), add multiple of another row
RankNumber of pivots (non-zero rows in RREF)
Free variablesColumns without pivots (โ‰  last column)
Homogeneous systemAx=0A\mathbf{x} = \mathbf{0} ; always at least trivial solution
Inconsistent systemRow of $[0;\dots;0;

12. ๐Ÿ“ Practice Questions

Q1: Simple elimination (unique solution)
Solve using Gaussian elimination:
>{x+y=32xโˆ’y=0>> \begin{cases} x + y = 3 \\ 2x - y = 0 \end{cases} >
Strategy: Augmented matrix โ†’ REF โ†’ back substitute.
Solution:
>[1132โˆ’10]โ†’R2โˆ’2R1[1130โˆ’3โˆ’6]>> \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 2 & -1 & 0 \end{array}\right] \xrightarrow{R_2 - 2R_1} \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 0 & -3 & -6 \end{array}\right] >
From R2R_2: โˆ’3y=โˆ’6โ‡’y=2-3y = -6 \Rightarrow y = 2. From R1R_1: x+2=3โ‡’x=1x + 2 = 3 \Rightarrow x = 1.
Solution: x=1x = 1, y=2y = 2. Q2: Inconsistent system
Solve:
>{x+2y=52x+4y=9>> \begin{cases} x + 2y = 5 \\ 2x + 4y = 9 \end{cases} >
Strategy: Check for inconsistency.
Solution:
>[125249]โ†’R2โˆ’2R1[12500โˆ’1]>> \left[\begin{array}{cc|c} 1 & 2 & 5 \\ 2 & 4 & 9 \end{array}\right] \xrightarrow{R_2 - 2R_1} \left[\begin{array}{cc|c} 1 & 2 & 5 \\ 0 & 0 & -1 \end{array}\right] >
Row 2: 0x+0y=โˆ’10x + 0y = -1 โ€” impossible. No solution. Q3: Infinitely many solutions
Solve:
>{x+yโˆ’2z=12x+2yโˆ’4z=2>> \begin{cases} x + y - 2z = 1 \\ 2x + 2y - 4z = 2 \end{cases} >
Solution:
>[11โˆ’2122โˆ’42]โ†’R2โˆ’2R1[11โˆ’210000]>> \left[\begin{array}{ccc|c} 1 & 1 & -2 & 1 \\ 2 & 2 & -4 & 2 \end{array}\right] \xrightarrow{R_2 - 2R_1} \left[\begin{array}{ccc|c} 1 & 1 & -2 & 1 \\ 0 & 0 & 0 & 0 \end{array}\right] >
Pivot in column 1 (basic variable xx). y,zy, z are free.
x=1โˆ’y+2zx = 1 - y + 2z, y,zโˆˆRy, z \in \mathbb{R}.
Parametric form:
>[xyz]=[100]+y[โˆ’110]+z[201]>> \begin{bmatrix} x\\y\\z \end{bmatrix} = \begin{bmatrix} 1\\0\\0 \end{bmatrix} + y\begin{bmatrix} -1\\1\\0 \end{bmatrix} + z\begin{bmatrix} 2\\0\\1 \end{bmatrix} >
. Q4: Gauss-Jordan elimination
Solve using Gauss-Jordan:
>{x+2y+z=02xโˆ’y+z=3xโˆ’y+z=1>> \begin{cases} x + 2y + z = 0 \\ 2x - y + z = 3 \\ x - y + z = 1 \end{cases} >
Solution:
>[12102โˆ’1131โˆ’111]>> \left[\begin{array}{ccc|c} 1 & 2 & 1 & 0 \\ 2 & -1 & 1 & 3 \\ 1 & -1 & 1 & 1 \end{array}\right] >
R2โ†’R2โˆ’2R1R_2 \to R_2 - 2R_1, R3โ†’R3โˆ’R1R_3 \to R_3 - R_1:
>[12100โˆ’5โˆ’130โˆ’301]>> \left[\begin{array}{ccc|c} 1 & 2 & 1 & 0 \\ 0 & -5 & -1 & 3 \\ 0 & -3 & 0 & 1 \end{array}\right] >
R2โ†’โˆ’15R2R_2 \to -\frac{1}{5}R_2:
>[12100115โˆ’350โˆ’301]>> \left[\begin{array}{ccc|c} 1 & 2 & 1 & 0 \\ 0 & 1 & \frac{1}{5} & -\frac{3}{5} \\ 0 & -3 & 0 & 1 \end{array}\right] >
R3โ†’R3+3R2R_3 \to R_3 + 3R_2:
>[12100115โˆ’350035โˆ’45]>> \left[\begin{array}{ccc|c} 1 & 2 & 1 & 0 \\ 0 & 1 & \frac{1}{5} & -\frac{3}{5} \\ 0 & 0 & \frac{3}{5} & -\frac{4}{5} \end{array}\right] >
R3โ†’53R3R_3 \to \frac{5}{3}R_3:
>[12100115โˆ’35001โˆ’43]>> \left[\begin{array}{ccc|c} 1 & 2 & 1 & 0 \\ 0 & 1 & \frac{1}{5} & -\frac{3}{5} \\ 0 & 0 & 1 & -\frac{4}{3} \end{array}\right] >
Eliminate above: R1โ†’R1โˆ’R3R_1 \to R_1 - R_3, R2โ†’R2โˆ’15R3R_2 \to R_2 - \frac{1}{5}R_3:
>[12043010โˆ’13001โˆ’43]>> \left[\begin{array}{ccc|c} 1 & 2 & 0 & \frac{4}{3} \\ 0 & 1 & 0 & -\frac{1}{3} \\ 0 & 0 & 1 & -\frac{4}{3} \end{array}\right] >
R1โ†’R1โˆ’2R2R_1 \to R_1 - 2R_2:
>[1002010โˆ’13001โˆ’43]>> \left[\begin{array}{ccc|c} 1 & 0 & 0 & 2 \\ 0 & 1 & 0 & -\frac{1}{3} \\ 0 & 0 & 1 & -\frac{4}{3} \end{array}\right] >
Solution: x=2x = 2, y=โˆ’13y = -\frac{1}{3}, z=โˆ’43z = -\frac{4}{3}. Q5: Homogeneous system with free variables
Find all solutions to:
>{x+2yโˆ’z=02x+3y+z=03x+5y+0z=0>> \begin{cases} x + 2y - z = 0 \\ 2x + 3y + z = 0 \\ 3x + 5y + 0z = 0 \end{cases} >
Solution:
>[12โˆ’1023103500]โ†’R2โˆ’2R1,โ€…โ€ŠR3โˆ’3R1[12โˆ’100โˆ’1300โˆ’130]>> \left[\begin{array}{ccc|c} 1 & 2 & -1 & 0 \\ 2 & 3 & 1 & 0 \\ 3 & 5 & 0 & 0 \end{array}\right] \xrightarrow{R_2 - 2R_1,\; R_3 - 3R_1} \left[\begin{array}{ccc|c} 1 & 2 & -1 & 0 \\ 0 & -1 & 3 & 0 \\ 0 & -1 & 3 & 0 \end{array}\right] >
R3โ†’R3โˆ’R2R_3 \to R_3 - R_2:
>[12โˆ’100โˆ’1300000]>> \left[\begin{array}{ccc|c} 1 & 2 & -1 & 0 \\ 0 & -1 & 3 & 0 \\ 0 & 0 & 0 & 0 \end{array}\right] >
R2โ†’โˆ’R2R_2 \to -R_2, R1โ†’R1โˆ’2R2R_1 \to R_1 - 2R_2:
>[105001โˆ’300000]>> \left[\begin{array}{ccc|c} 1 & 0 & 5 & 0 \\ 0 & 1 & -3 & 0 \\ 0 & 0 & 0 & 0 \end{array}\right] >
Pivots in columns 1, 2. zz is free. x=โˆ’5zx = -5z, y=3zy = 3z.
Solution:
>[xyz]=z[โˆ’531]>> \begin{bmatrix} x\\y\\z \end{bmatrix} = z \begin{bmatrix} -5\\3\\1 \end{bmatrix} >
, zโˆˆRz \in \mathbb{R}. Q6: Rank from RREF
Find the rank of
>A=[123124621103]>> A = \begin{bmatrix} 1 & 2 & 3 & 1 \\ 2 & 4 & 6 & 2 \\ 1 & 1 & 0 & 3 \end{bmatrix} >
.
Solution:
>[123124621103]โ†’R2โˆ’2R1,โ€…โ€ŠR3โˆ’R1[123100000โˆ’1โˆ’32]>> \begin{bmatrix} 1 & 2 & 3 & 1 \\ 2 & 4 & 6 & 2 \\ 1 & 1 & 0 & 3 \end{bmatrix} \xrightarrow{R_2 - 2R_1,\; R_3 - R_1} \begin{bmatrix} 1 & 2 & 3 & 1 \\ 0 & 0 & 0 & 0 \\ 0 & -1 & -3 & 2 \end{bmatrix} >
Swap R2โ†”R3R_2 \leftrightarrow R_3:
>[12310โˆ’1โˆ’320000]>> \begin{bmatrix} 1 & 2 & 3 & 1 \\ 0 & -1 & -3 & 2 \\ 0 & 0 & 0 & 0 \end{bmatrix} >
Rank = 2 (two pivots). Q7: Parameterising solution set
Solve and parameterise:
>{x1+2x2+x3โˆ’x4=12x1+4x2+2x3โˆ’2x4=2>> \begin{cases} x_1 + 2x_2 + x_3 - x_4 = 1 \\ 2x_1 + 4x_2 + 2x_3 - 2x_4 = 2 \end{cases} >
Solution:
>[121โˆ’11242โˆ’22]โ†’R2โˆ’2R1[121โˆ’1100000]>> \left[\begin{array}{cccc|c} 1 & 2 & 1 & -1 & 1 \\ 2 & 4 & 2 & -2 & 2 \end{array}\right] \xrightarrow{R_2 - 2R_1} \left[\begin{array}{cccc|c} 1 & 2 & 1 & -1 & 1 \\ 0 & 0 & 0 & 0 & 0 \end{array}\right] >
Pivot in column 1. x1x_1 basic; x2,x3,x4x_2, x_3, x_4 free.
x1=1โˆ’2x2โˆ’x3+x4x_1 = 1 - 2x_2 - x_3 + x_4, x2,x3,x4โˆˆRx_2, x_3, x_4 \in \mathbb{R}.
Parametric:
>[x1x2x3x4]=[1000]+x2[โˆ’2100]+x3[โˆ’1010]+x4[1001]>> \begin{bmatrix} x_1\\x_2\\x_3\\x_4 \end{bmatrix} = \begin{bmatrix} 1\\0\\0\\0 \end{bmatrix} + x_2\begin{bmatrix} -2\\1\\0\\0 \end{bmatrix} + x_3\begin{bmatrix} -1\\0\\1\\0 \end{bmatrix} + x_4\begin{bmatrix} 1\\0\\0\\1 \end{bmatrix} >
. Q8: System with parameters
For what value(s) of kk does the system have (a) unique solution, (b) no solution, (c) infinitely many solutions?
>{x+y=12x+ky=3>> \begin{cases} x + y = 1 \\ 2x + ky = 3 \end{cases} >
Solution:
>[1112k3]โ†’R2โˆ’2R1[1110kโˆ’21]>> \left[\begin{array}{cc|c} 1 & 1 & 1 \\ 2 & k & 3 \end{array}\right] \xrightarrow{R_2 - 2R_1} \left[\begin{array}{cc|c} 1 & 1 & 1 \\ 0 & k-2 & 1 \end{array}\right] >
  • If kโ‰ 2k \neq 2, unique solution (y=1kโˆ’2y = \frac{1}{k-2}, x=1โˆ’1kโˆ’2x = 1 - \frac{1}{k-2}).
  • If k=2k = 2, row 2 says 0x+0y=10x + 0y = 1 โ€” no solution.
  • Infinitely many solutions are impossible here (2 equations, 2 unknowns, RHS not all zero). Q9: Rank of transpose
If AA is 3ร—43 \times 4 with rank 2, what is the rank of ATA^T?
Solution: rank(AT)=rank(A)=2\text{rank}(A^T) = \text{rank}(A) = 2. Q10: Application โ€” network flow
A network has nodes A, B, C with flow equations:
>{x1+x2=10x2โˆ’x3=5x1+x3=15>> \begin{cases} x_1 + x_2 = 10 \\ x_2 - x_3 = 5 \\ x_1 + x_3 = 15 \end{cases} >
Does a unique flow exist?
Solution:
>[1101001โˆ’1510115]โ†’R3โˆ’R1[1101001โˆ’150โˆ’115]>> \left[\begin{array}{ccc|c} 1 & 1 & 0 & 10 \\ 0 & 1 & -1 & 5 \\ 1 & 0 & 1 & 15 \end{array}\right] \xrightarrow{R_3 - R_1} \left[\begin{array}{ccc|c} 1 & 1 & 0 & 10 \\ 0 & 1 & -1 & 5 \\ 0 & -1 & 1 & 5 \end{array}\right] >
>R3โ†’R3+R2:[1101001โˆ’1500010]>> R_3 \to R_3 + R_2: \left[\begin{array}{ccc|c} 1 & 1 & 0 & 10 \\ 0 & 1 & -1 & 5 \\ 0 & 0 & 0 & 10 \end{array}\right] >
Row 3 says 0=100 = 10 โ€” impossible. No solution exists (the equations are inconsistent).
Wait โ€” let me recheck. The sum of equations 1 and 2 minus equation 3: (x1+x2)+(x2โˆ’x3)โˆ’(x1+x3)=10+5โˆ’15โ‡’2x2โˆ’2x3=0โ‡’x2=x3(x_1+x_2)+(x_2-x_3)-(x_1+x_3) = 10+5-15 \Rightarrow 2x_2-2x_3 = 0 \Rightarrow x_2 = x_3. Then eq 2: x2โˆ’x3=0โ‰ 5x_2-x_3 = 0 \neq 5. Indeed inconsistent.

๐Ÿ”— Cross-References

  • Next topic: Cramer's Rule โ€” solving systems using determinants
  • Week 3 (Vector Spaces): The solution set of Ax=0A\mathbf{x} = \mathbf{0} is a vector space
  • Week 4 (Basis & Dimension): Gaussian elimination finds bases for vector spaces
  • Week 5 (Rank-Nullity): Rank from elimination feeds into the rank-nullity theorem
  • BSCS2004 (ML Foundations): Solving normal equations in linear regression uses Gaussian elimination Join Discord Previous1.3 DeterminantsNext2.2 Cramer's Rule & Inverses
Document outline

Keep your place and jump directly to a heading.

Table of contents

No note selected

Open a chapter to see its outline, backlinks, and sources here.