MAT1041 · Week 1 · - Introduction to Systems of Linear Equations
Systems of linear equations: Gauss and Gauss-Jordan elimination
You learn to turn a linear system into an augmented matrix and reduce it to REF and RREF with row operations, to tell a unique solution, infinitely many solutions and inconsistency apart, and to solve systems with parameters. The biggest block of the midterm.
linear equationsystem of linear equationsconsistentinconsistentaugmented matrixcoefficient matrixelementary row operationsrow echelon form (REF)reduced row echelon form (RREF)leading 1 (pivot)free variableback-substitutionGaussian eliminationGauss-Jordan eliminationhomogeneous systemtrivial solution
The first week of the linear algebra course is the toolbox for the rest of the semester. Inverse matrix, determinant, rank, null space, eigenvector: all of them end up at the step “solve a system with row operations”. The biggest block of points on the midterm comes from here too: solve a 3×3 system with Gauss, write the general solution of a system with Gauss-Jordan, solve a “for which k” question case by case.
Golden rules:
Write every row operation above the arrow (R2←R2−2R1). It gives both partial credit and error checking.
A row operation is applied to the whole row, including the right-hand side column.
One column at a time: first clear below the pivot, then move right.
A row [000∣c] with c=0 means no solution. A row [000∣0] is harmless.
Substitute your solution back into the equations. It takes 20 seconds and saves points.
Linear equations and systems
A linear equation in the variables x1,…,xn has the form:
a1x1+a2x2+⋯+anxn=b.
The variables appear only to the first power, are not multiplied by each other, and do not appear inside roots, sines or exponentials. 3x−2y+z=5 is linear; xy=2, x2+y=1, x+y=3 are not linear.
Several linear equations form a system of linear equations. A solution is a list of numbers that satisfies all the equations at the same time. For the solution set of a linear system there are only three possibilities:
Case
Name
Geometry in 2 variables
Exactly one solution
consistent, unique
two lines meet at a single point
Infinitely many solutions
consistent, infinitely many
two lines coincide
No solution
inconsistent
two lines are parallel
There is no such thing as “exactly two solutions”. If there are two solutions, every point on the line between them is also a solution.
Augmented matrix and row operations
When writing a system, repeating the variable names in every row is unnecessary. We put the coefficients and the right-hand side into a table. The coefficients give the coefficient matrixA, and adding the right-hand side gives the augmented matrix[A∣b]:
If a variable is missing from an equation, write 0 in its place. Skipping this step shifts the columns and ruins the whole calculation.
The elementary row operations are the three operations that do not change the solution set:
Operation
Notation
In terms of equations
Row swap
Ri↔Rj
swap two equations
Scaling
Ri←cRi, c=0
multiply an equation by a nonzero number
Addition
Ri←Ri+cRj
add a multiple of one equation to another
Two matrices that can be turned into each other with these three operations are called row equivalent. The systems of row equivalent augmented matrices have the same solution set. The whole method rests on this.
REF and RREF
A matrix is in row echelon form (REF) if:
Rows that are entirely zero are at the bottom.
The first nonzero entry of every nonzero row (the leading entry, the pivot) is 1.
Each pivot is to the right of the pivot in the row above it (a staircase shape).
If, in addition, all entries in each pivot column other than the pivot are 0, the matrix is in reduced row echelon form (RREF).
The matrix on the right is the one on the left with the entries above the pivots also cleared by Gauss-Jordan. A matrix can have many REFs, but its RREF is unique. Some books do not require the pivot to be 1 in the definition of REF; in this course (in line with the problem book) we make the pivot 1.
TIP · pivot column and free variable. In the RREF, the variables of the columns that contain a pivot are the leading variables. The variables of the columns without a pivot are the free variables. You give the free variables a parameter (t, s) and write the leading variables in terms of them.
Gaussian elimination: a unique solution
Gaussian elimination: bring the augmented matrix to REF, then start from the bottom and do back-substitution. Let us solve the system above.
side work: R2 - 2R1 = (2-2, 5-4, 1+2 | 14-6) = (0, 1, 3 | 8) R3 + R1 = (0, 3, 3 | 12) R3 - 3R2 = (0, 3-3, 3-9 | 12-24) = (0, 0, -6 | -12)back-sub: z = 2 y + 3z = 8 → y = 2 x + 2y - z = 3 → x = 3 - 4 + 2 = 1
The solution is (x,y,z)=(1,2,2). Check (3rd equation): −1+2+8=9.
Gauss-Jordan: infinitely many solutions and parametric form
Gauss-Jordan elimination does not stop at REF: it also clears the entries above the pivots and reaches the RREF. The advantage: you read the solution directly, with no back-substitution. Look at this system with four variables:
PITFALL · simplifying and losing a root. In the equation (k−1)(k+2)z=k−1, if you immediately divide both sides by k−1 and write "z=k+21", you lose the case k=1. First separate the roots, then divide.
Homogeneous systems
If the whole right-hand side is zero, the system is homogeneous: Ax=0. A homogeneous system is always consistent, because x=0 (the trivial solution) always satisfies it. The question is whether there is any other (nontrivial) solution.
If there is a free variable, there are infinitely many nontrivial solutions.
If the number of unknowns is greater than the number of equations, there is necessarily a free variable.
In a homogeneous system the right-hand side column stays 0 through all the row operations; most people never write it and just reduce A.
PITFALL · “fewer equations, so infinitely many solutions”. This is true only for a consistent system. In the system x+y+z=0, x+y+z=1 there are 2 equations and 3 unknowns, yet there is no solution. For a homogeneous system, consistency comes for free, so the claim is true.
Common mistakes
Wrong
Right
Not applying the row operation to the right-hand side column
The operation is applied to the whole row
Leaving the place of a missing variable empty
Write 0 so the columns do not shift
Thinking a row [000∣0] means “no solution”
It is harmless; it leaves a free variable
Saying “infinitely many solutions” without checking consistency
First look for a row [0⋯0∣c=0]
Confusing REF and RREF
In RREF the entries above the pivot are also 0 and the pivots are 1
Dividing by an expression like k−1 without thinking
First examine the case k=1 separately
Choosing the wrong free variable
The variable of a column without a pivot is free
Writing a mixed operation like R2←3R2−R1
Harmless for a system, but it multiplies the determinant by 3; make a habit of using Ri←Ri+cRj
Test yourself
Exam-style questions. Solve them on paper first, then reveal the answer.
Question 1easy
Solve the system x+3y=7, 2x−y=0.
Show answer
x=1,y=2
The augmented matrix is [123−170].R2←R2−2R1: (0,−7∣−14), so −7y=−14, y=2. Substitute back: x=7−3(2)=1. Check: 2(1)−2=0.
Question 2easy
Is (x,y,z)=(2,−1,1) a solution of the system x+y+z=2, 2x−y+3z=8, x+2y−z=−1?
Show answer
Yes
Substitute into all three equations: 2−1+1=2, 4+1+3=8, 2−2−1=−1. All three hold, so yes, it is a solution. A point is a solution of the system only if it satisfies all the equations.
Question 3easy
Which of the following matrices is in reduced row echelon form? (A) 100020210 (B) 100300001 (C) 100400010−230 (D) 100210131
Show answer
(C)
(A) The leading entry of row 2 is 2, not 1. (B) The zero row is not at the bottom. (D) It is REF but not RREF: in the pivot columns the entries above the pivot are not zero. (C) The leading 1's are in columns 1 and 3, every other entry in those columns is 0, and the zero row is at the bottom. It is RREF. The 4 in column 2 is not a problem: column 2 is not a pivot column (it is a free variable column).
Question 4medium
Solve by Gaussian elimination with back-substitution: x−y+2z=8, 2x+y−z=3, 3x+2y+z=9.
Show answer
(3,−1,2)
R2←R2−2R1: (0,3,−5∣−13). R3←R3−3R1: (0,5,−5∣−15). To avoid fractions, R3←51R3: (0,1,−1∣−3), then R2↔R3.R3←R3−3R2: (0,0,−2∣−4), so z=2. Substitute back: y−z=−3⇒y=−1. x=8+y−2z=8−1−4=3. Check (3rd equation): 9−2+2=9.
Question 5medium
Use Gauss-Jordan elimination to find the general solution of x−2y+z=1, 2x−3y+4z=5, x−y+3z=4.
Show answer
x=7−5t,y=3−2t,z=t
R2←R2−2R1: (0,1,2∣3). R3←R3−R1: (0,1,2∣3).R3←R3−R2: a zero row (0=0, harmless). Clear above the pivot, R1←R1+2R2: (1,0,5∣7). RREF: x+5z=7, y+2z=3. z is free, z=t: x=7−5t, y=3−2t. Check (t=1): (2,1,1): 2−2+1=1.
Question 6medium
How many solutions does the system x+2y+z=3, 2x+3y+4z=5, 3x+5y+5z=9 have?
Show answer
No solution (inconsistent)
R2←R2−2R1: (0,−1,2∣−1). R3←R3−3R1: (0,−1,2∣0).R3←R3−R2: (0,0,0∣1), that is, 0=1. The system is inconsistent. Intuition: the left side of the 3rd equation is the sum of the first two, but the right side is 3+5=8=9.
Question 7medium
Consider the homogeneous system x1+x2+2x3−x4=0, 2x1+3x2+3x3+x4=0, x1+2x2+x3+2x4=0. How many free variables does the general solution have?
Show answer
2
R2←R2−2R1: (0,1,−1,3). R3←R3−R1: (0,1,−1,3). R3←R3−R2: a zero row. R1←R1−R2: (1,0,3,−4). 2 pivots, 4 variables: 4−2=2 free variables. General solution: x3=s, x4=t, x1=−3s+4t, x2=s−3t.
Question 8hard
For which value of k is the system x+y+z=1, x+ky+z=1, x+y+kz=2 inconsistent? For the other values, find the unique solution.
Show answer
k=1; otherwise x=k−1k−2,y=0,z=k−11
R2←R2−R1: (0,k−1,0∣0). R3←R3−R1: (0,0,k−1∣1).k=1: the last row is (0,0,0∣1), that is, 0=1. Inconsistent.k=1: (k−1)y=0⇒y=0, (k−1)z=1⇒z=k−11, x=1−y−z=k−1k−2. The infinitely-many-solutions case never occurs in this system. We divided by the expression containing k (k−1) only after assuming it is not zero.
Question 9hard
For which b1,b2,b3 is the system x+2y−z=b1, 2x+5y+z=b2, x+3y+2z=b3 consistent?
Show answer
b3=b2−b1
R2←R2−2R1: (0,1,3∣b2−2b1). R3←R3−R1: (0,1,3∣b3−b1).R3←R3−R2: (0,0,0∣b3−b2+b1). The left side is entirely zero, so the right side must be zero too: b1−b2+b3=0, that is, b3=b2−b1. Example: (1,3,2) is consistent, (1,1,1) is inconsistent.
Question 10hard
Find the parabola y=ax2+bx+c that passes through (1,2), (2,3) and (3,6).
Show answer
y=x2−2x+3
Each point gives an equation: a+b+c=2, 4a+2b+c=3, 9a+3b+c=6.R2−R1: 3a+b=1. R3−R2: 5a+b=3. Their difference: 2a=2, a=1, b=−2, c=2−1+2=3. Check: x=3: 9−6+3=6.
Question 11medium
True or false: A homogeneous system with more unknowns than equations always has a nontrivial solution.
Show answer
True
A homogeneous system is always consistent (x=0 is a solution). The number of pivots is at most the number of equations m. If the number of unknowns is n>m, at least n−m≥1 free variables remain. Giving a free variable a nonzero value produces a nontrivial solution.
Question 12medium
For which values of a and b does the system x+2y=4, 3x+ay=b have infinitely many solutions?
Show answer
a=6,b=12
R2←R2−3R1: (0,a−6∣b−12). For infinitely many solutions the last row must be 0=0: a−6=0 and b−12=0.a=6, b=12: inconsistent. a=6: unique solution.
Verification: All row operations and intermediate matrices were applied step by step in node with BigInt fractions; the solutions were found with the exact RREF and checked by substituting back into the equations, and for the parametric questions the solution type was tested separately for many values of k (verify/MAT1041/01.mjs).
Review card
System → [A | b] augmented matrix. A missing variable = coefficient 0.
3 row operations: Ri ↔ Rj, Ri ← cRi (c≠0), Ri ← Ri + cRj. The solution set does NOT CHANGE.
REF: zero rows at the bottom, each leading entry to the right of the previous one, zeros below pivots.
RREF: + leading entries are 1 + everything else in a pivot column is 0. The RREF is unique.
Gauss: REF + back-substitution. Gauss-Jordan: RREF, read off the solution directly.
[0 0 0 | c], c≠0 → NO SOLUTION. [0 0 0 | 0] → harmless, delete.
If consistent: free variables = number of variables - number of pivots.
0 free → unique solution; ≥1 free → infinitely many solutions (free = t, s ...)
Parameter k: NEVER divide by k. Last row [0 0 f(k) | g(k)]:
f≠0 unique, f=0 and g≠0 none, f=0 and g=0 infinitely many.
Homogeneous Ax=0: always consistent; unknowns > equations → nontrivial solution exists.
Make the pivot 1: swap rows or divide; avoid fractions.
Check: substitute your solution back into the original equations.