Weeks
Mathematics 2Week 2 · Solving Linear Systems: Cramer, Inverse and Gauss Elimination
Week 2 Notes

Mathematics for
Data Science 2

Solving systems of linear equations: determinants and Cramer's Rule, the inverse-matrix method, echelon forms, row reduction and Gauss elimination.

7 chapters40 worked examples~47 min read
Cramer's RuleInverse matrixEchelon formsGauss elimination

Chapters

  1. 01Linear Equations and a Determinants RecapPart 1
  2. 02Cramer's RulePart 2
  3. 03Solving with an Invertible Coefficient MatrixPart 3
  4. 04The Echelon FormPart 4
  5. 05Row ReductionPart 5
  6. 06The Gauss Elimination MethodPart 6
  7. 07Week 2 Summary SheetAll parts
01
Linear systems

Linear Equations and a Determinants Recap

What a linear system is, how it is written as Ax = b, and what the determinant of the coefficient matrix says about its solutions.

1.1What is a linear equation?

Definition: linear equation

A linear equation in the variables x1,x2,…,xnx_1, x_2, \dots, x_n is an equation of the form

a1x1+a2x2+⋯+anxn=ba_1 x_1 + a_2 x_2 + \cdots + a_n x_n = b

where the coefficients a1,…,ana_1, \dots, a_n and the constant bb are real numbers. Every variable appears to the power one: no squares, no product of two variables, nothing under a root.

EquationLinear?Why
x+2y=1x + 2y = 1Yesboth variables to the power 1
x+y+z=1x + y + z = 1Yesthree variables, each to the power 1
2x2+y=12x^2 + y = 1Noxx is squared
3x2+3y2+z2=13x^2 + 3y^2 + z^2 = 1Noall three variables are squared
xy=4xy = 4Noa product of two variables (extra example)

1.2A system of equations as Ax = b

A system of linear equations is a collection of such equations that share the same variables. When there are mm equations in nn unknowns, the whole system packs into one matrix equation Ax=bA\mathbf{x} = \mathbf{b}:

[a11a12⋯a1na21a22⋯a2n⋮⋮⋱⋮am1am2⋯amn]⏟A (m×n)[x1x2⋮xn]⏟x (n×1)=[b1b2⋮bm]⏟b (m×1)\underbrace{\begin{bmatrix}a_{11}&a_{12}&\cdots&a_{1n}\\a_{21}&a_{22}&\cdots&a_{2n}\\\vdots&\vdots&\ddots&\vdots\\a_{m1}&a_{m2}&\cdots&a_{mn}\end{bmatrix}}_{A\ (m\times n)}\underbrace{\begin{bmatrix}x_1\\x_2\\\vdots\\x_n\end{bmatrix}}_{\mathbf{x}\ (n\times 1)} = \underbrace{\begin{bmatrix}b_1\\b_2\\\vdots\\b_m\end{bmatrix}}_{\mathbf{b}\ (m\times 1)}
  • AA is the coefficient matrix, m×nm \times n: one row per equation, one column per unknown.
  • x\mathbf{x} is the column of unknowns and b\mathbf{b} is the column of constants on the right-hand side.
23−2246x₁x₂6312=A (3×2)x (2×1)b (3×1)2x₁ + 3x₂ = 6−2x₁ + 2x₂ = 34x₁ + 6x₂ = 123 equations → 3 rows, 2 unknowns → 2 columns
Figure 1. The system 2x₁ + 3x₂ = 6, −2x₁ + 2x₂ = 3, 4x₁ + 6x₂ = 12 written as Ax = b
Example 1Writing a system as Ax = b

Write 2x1+3x2=6, −2x1+2x2=3, 4x1+6x2=122x_1 + 3x_2 = 6,\ -2x_1 + 2x_2 = 3,\ 4x_1 + 6x_2 = 12 as Ax=bA\mathbf{x} = \mathbf{b} and state the order of AA.

Solution
  1. Read the coefficients row by row: A=[23−2246]A = \begin{bmatrix}2&3\\-2&2\\4&6\end{bmatrix}.
  2. The unknowns are x=[x1x2]\mathbf{x} = \begin{bmatrix}x_1\\x_2\end{bmatrix} and the constants are b=[6312]\mathbf{b} = \begin{bmatrix}6\\3\\12\end{bmatrix}.
  3. So Ax=bA\mathbf{x} = \mathbf{b} holds, and AA has 3 rows and 2 columns: its order is 3×23 \times 2.

1.3Determinant recap

Cramer's Rule and the inverse-matrix method both work only when det⁡(A)≠0\det(A) \neq 0, so the determinant has to be back in hand.

2 × 2 matrix
det⁡[a11a12a21a22]=a11a22−a12a21\det\begin{bmatrix}a_{11}&a_{12}\\a_{21}&a_{22}\end{bmatrix} = a_{11}a_{22} - a_{12}a_{21}
3 × 3 matrix: expand along row 1
det⁡A=a11(a22a33−a23a32)−a12(a21a33−a23a31)+a13(a21a32−a22a31)\begin{aligned}\det A &= a_{11}(a_{22}a_{33} - a_{23}a_{32})\\ &\quad - a_{12}(a_{21}a_{33} - a_{23}a_{31})\\ &\quad + a_{13}(a_{21}a_{32} - a_{22}a_{31})\end{aligned}
Invertible matrix

A square matrix AA is invertible (non-singular) exactly when det⁡(A)≠0\det(A) \neq 0. That one number is the gatekeeper: every method that follows starts by checking it.

Example 2Two determinants

Compute det⁡[2134]\det\begin{bmatrix}2&1\\3&4\end{bmatrix} and det⁡[1−1121−2−1−24]\det\begin{bmatrix}1&-1&1\\2&1&-2\\-1&-2&4\end{bmatrix}.

Solution
  1. 2×22 \times 2: 2⋅4−1⋅3=8−3=52 \cdot 4 - 1 \cdot 3 = 8 - 3 = 5.
  2. 3×33 \times 3, along row 1: 1 (1⋅4−(−2)(−2))−(−1) (2⋅4−(−2)(−1))+1 (2(−2)−1⋅(−1))1\,(1\cdot 4 - (-2)(-2)) - (-1)\,(2\cdot 4 - (-2)(-1)) + 1\,(2(-2) - 1\cdot(-1)).
  3. =1(4−4)+1(8−2)+1(−4+1)=0+6−3=3= 1(4 - 4) + 1(8 - 2) + 1(-4 + 1) = 0 + 6 - 3 = 3.

1.4Seeing it geometrically

For two equations in two unknowns, each equation draws a line in the xyxy-plane, and solving the system means finding where the lines meet. The determinant of the coefficient matrix decides the story.

(2, 2)Crossing linesx − y = 0, x + y = 4det ≠ 0: one solutionSame linex + y = 3, 2x + 2y = 6det = 0: infinitely manyParallel linesx + y = 3, x + y = 1det = 0: no solution
Figure 2. Crossing lines have one solution; the same line has infinitely many; parallel lines have none
  • det⁡(A)≠0\det(A) \neq 0: the lines cross at exactly one point, a unique solution.
  • det⁡(A)=0\det(A) = 0, same line: x+y=3x + y = 3 and 2x+2y=62x + 2y = 6 are multiples of each other, so every point of the line is a solution: infinitely many.
  • det⁡(A)=0\det(A) = 0, parallel lines: they never meet, so there is no solution.
Important

det⁡(A)=0\det(A) = 0 alone cannot tell you whether you are in the "infinitely many" case or the "no solution" case. Telling those two apart is exactly what row reduction (Parts 4 to 6) is for.

1.5Going deeper

  • Square needed for a determinant. A determinant exists only for a square matrix, so det⁡(A)≠0\det(A) \neq 0 is a test for systems with as many equations as unknowns (m=nm = n). Rectangular systems need Gauss elimination (Part 6).
  • Three variables. Each equation is a plane in 3D. The same three outcomes appear: planes meeting at a point, along a line or sheet, or not meeting at all (extra).
  • Consistent / inconsistent (extra). A system with at least one solution is called consistent; with none, inconsistent.

1.6Exam tips and common mistakes

Exam tips
  • In "is it linear?" questions look only at powers and products of variables, not at the numbers.
  • The order of AA is (number of equations) ×\times (number of unknowns).
Common mistakes
  • Calling 2x2+y=12x^2 + y = 1 linear because the coefficients are numbers.
  • Writing the order of AA as n×mn \times m instead of m×nm \times n.
  • Concluding "no solution" just because det⁡(A)=0\det(A) = 0.

Practice questions (graded-assignment style)

Q1Which are linear?

Multiple Select Question (MSQ): select all that apply.

Which of the following is/are a linear equation?

1
2x2+y=12x^2 + y = 1
2
x+2y=1x + 2y = 1
3
x+y+z=1x + y + z = 1
4
3x2+3y2+z2=13x^2 + 3y^2 + z^2 = 1
Solution
Idea

Variables only to the first power.

  • Options 2 and 3 have every variable to the power 1.
  • Options 1 and 4 contain squares of variables, so they are not linear.
  • Answer: options 2 and 3.
Q2Order of A

Multiple Choice Question (MCQ): choose the one correct option.

For 2x1+3x2=6, −2x1+2x2=3, 4x1+6x2=122x_1 + 3x_2 = 6,\ -2x_1 + 2x_2 = 3,\ 4x_1 + 6x_2 = 12 with Ax=bA\mathbf{x} = \mathbf{b}, what is the order of AA?

1
2×32 \times 3
2
3×23 \times 2
3
3×33 \times 3
4
2×22 \times 2
Solution
Idea

Rows = equations, columns = unknowns.

  • There are 3 equations, so 3 rows. There are 2 unknowns, so 2 columns.
  • The order is 3×23 \times 2.
  • Answer: option 2.
Q3Which system has which kind of solution?

Multiple Select Question (MSQ): select all that apply.

Consider 2x1+3x2=6, −2x1+kx2=d, 4x1+6x2=122x_1 + 3x_2 = 6,\ -2x_1 + kx_2 = d,\ 4x_1 + 6x_2 = 12. Choose the correct statements.

1
No solution if k=−3, d=0k = -3,\ d = 0.
2
A unique solution if k=3, d=0k = 3,\ d = 0.
3
Infinitely many solutions if k=−3, d=6k = -3,\ d = 6.
4
Infinitely many solutions if k=−3, d=−6k = -3,\ d = -6.
Solution
Idea

The third equation is 2 times the first, so it adds nothing new. Look at the first two.

  • For k=−3k = -3, the second equation is −1-1 times the first (−2x1−3x2=d-2x_1 - 3x_2 = d vs 2x1+3x2=62x_1 + 3x_2 = 6). It agrees only when d=−6d = -6.
  • d=0d = 0 gives −2x1−3x2=0-2x_1 - 3x_2 = 0 against 2x1+3x2=62x_1 + 3x_2 = 6: contradiction, no solution (option 1 true).
  • d=6d = 6 also contradicts (option 3 false); d=−6d = -6 makes the two equations identical, so infinitely many (option 4 true).
  • For k=3k = 3 the first two equations are independent (det⁡[23−23]=12≠0\det\begin{bmatrix}2&3\\-2&3\end{bmatrix} = 12 \neq 0), so one solution (option 2 true).
  • Answer: options 1, 2 and 4.
Q4A determinant

Numerical Answer Type (NAT).

Find det⁡[120013002]\det\begin{bmatrix}1&2&0\\0&1&3\\0&0&2\end{bmatrix}.

Solution
Idea

Expand along column 1: only one non-zero entry.

  • Column 1 is (1,0,0)(1, 0, 0), so det⁡=1⋅det⁡[1302]=1⋅(2−0)=2\det = 1 \cdot \det\begin{bmatrix}1&3\\0&2\end{bmatrix} = 1 \cdot (2 - 0) = 2.
  • (For a triangular matrix the determinant is the product of the diagonal: 1⋅1⋅2=21 \cdot 1 \cdot 2 = 2.)
  • Answer: 2
Q5Same line

Multiple Choice Question (MCQ): choose the one correct option.

The system x+y=1, 2x+2y=2x + y = 1,\ 2x + 2y = 2 has:

1
No solution
2
Exactly one solution
3
Infinitely many solutions
4
Exactly two solutions
Solution
Idea

Is the second equation a multiple of the first?

  • 2x+2y=22x + 2y = 2 is 2×(x+y=1)2 \times (x + y = 1): the same line.
  • Every point of the line x+y=1x + y = 1 is a solution, so there are infinitely many; det⁡[1122]=0\det\begin{bmatrix}1&1\\2&2\end{bmatrix} = 0.
  • Answer: option 3.
Revision overview
Linear equationa₁x₁ + … + aₙxₙ = b
Variables to power 1 only
Systemm equations, n unknowns
Ax = b with A of order m × n
Determinant2 × 2: ad − bc
3 × 3: expand along a row
Solving linear equationsWeek 2 · Part 1
det(A) ≠ 0A invertible
Unique solution
det(A) = 0Infinitely many or none
Cannot tell which
Geometry (2 unknowns)Lines cross, coincide
or are parallel
Revision: what a linear system is and what the determinant tells you
Next · Square systemsCramer's Rule
02
Square systems

Cramer's Rule

A direct formula for the unknowns as ratios of determinants, for square systems with a non-zero determinant.

2.1When can Cramer's Rule be used?

Cramer's Rule gives a direct formula for solving Ax=bA\mathbf{x} = \mathbf{b}, with no elimination. It applies only when both conditions hold:

  • The coefficient matrix AA must be square.
  • det⁡(A)\det(A) must be non-zero, i.e. AA is invertible.

If either condition fails, Cramer's Rule does not apply and you use Gauss elimination (Part 6) instead.

2.2Order 2

For a11x1+a12x2=b1, a21x1+a22x2=b2a_{11}x_1 + a_{12}x_2 = b_1,\ a_{21}x_1 + a_{22}x_2 = b_2 with A=[a11a12a21a22]A = \begin{bmatrix}a_{11}&a_{12}\\a_{21}&a_{22}\end{bmatrix}, replace one column of AA at a time by b\mathbf{b}:

Cramer's Rule, order 2
Ax1=[b1a12b2a22],Ax2=[a11b1a21b2]A_{x_1} = \begin{bmatrix}b_1&a_{12}\\b_2&a_{22}\end{bmatrix},\quad A_{x_2} = \begin{bmatrix}a_{11}&b_1\\a_{21}&b_2\end{bmatrix}
x1=det⁡(Ax1)det⁡(A),x2=det⁡(Ax2)det⁡(A)x_1 = \frac{\det(A_{x_1})}{\det(A)},\qquad x_2 = \frac{\det(A_{x_2})}{\det(A)}
The idea

AxiA_{x_i} is AA with its ii-th column replaced by b\mathbf{b}. The unknown xix_i is the ratio of the new determinant to the old one.

Example 3Cramer's Rule, order 2

Solve 2x1+x2=1, 3x1+4x2=−12x_1 + x_2 = 1,\ 3x_1 + 4x_2 = -1.

Solution
  1. A=[2134]A = \begin{bmatrix}2&1\\3&4\end{bmatrix}, det⁡(A)=2(4)−1(3)=5≠0\det(A) = 2(4) - 1(3) = 5 \neq 0, so the rule applies.
  2. Ax1=[11−14]A_{x_1} = \begin{bmatrix}1&1\\-1&4\end{bmatrix}, det⁡(Ax1)=4−(−1)=5\det(A_{x_1}) = 4 - (-1) = 5.
  3. Ax2=[213−1]A_{x_2} = \begin{bmatrix}2&1\\3&-1\end{bmatrix}, det⁡(Ax2)=−2−3=−5\det(A_{x_2}) = -2 - 3 = -5.
  4. x1=55=1x_1 = \dfrac{5}{5} = 1, x2=−55=−1x_2 = \dfrac{-5}{5} = -1.
  5. Check: 2(1)+(−1)=12(1) + (-1) = 1 and 3(1)+4(−1)=−13(1) + 4(-1) = -1.
213411−14213−1AA with column 1 → bA with column 2 → bdet(A) = 5det = 5det = −52x₁ + x₂ = 1, 3x₁ + 4x₂ = −1 (b = (1, −1))x₁ = 5 / 5 = 1, x₂ = −5 / 5 = −1
Figure 3. Example 3: the replaced column is highlighted

2.3Order 3

The pattern extends directly. For a11x1+a12x2+a13x3=b1a_{11}x_1 + a_{12}x_2 + a_{13}x_3 = b_1 and so on, build Ax1,Ax2,Ax3A_{x_1}, A_{x_2}, A_{x_3} by putting b\mathbf{b} in place of the 1st, 2nd and 3rd columns of AA. Then

x1=det⁡(Ax1)det⁡(A),x2=det⁡(Ax2)det⁡(A),x3=det⁡(Ax3)det⁡(A)x_1 = \frac{\det(A_{x_1})}{\det(A)},\quad x_2 = \frac{\det(A_{x_2})}{\det(A)},\quad x_3 = \frac{\det(A_{x_3})}{\det(A)}
Example 4Cramer's Rule, order 3

Solve x1−x2+x3=1, 2x1+x2−2x3=−1, −x1−2x2+4x3=1x_1 - x_2 + x_3 = 1,\ 2x_1 + x_2 - 2x_3 = -1,\ -x_1 - 2x_2 + 4x_3 = 1.

Solution
  1. A=[1−1121−2−1−24]A = \begin{bmatrix}1&-1&1\\2&1&-2\\-1&-2&4\end{bmatrix}, b=[1−11]\mathbf{b} = \begin{bmatrix}1\\-1\\1\end{bmatrix}, and det⁡(A)=3≠0\det(A) = 3 \neq 0 (Example 2).
  2. Replace columns by b\mathbf{b}: Ax1=[1−11−11−21−24]A_{x_1} = \begin{bmatrix}1&-1&1\\-1&1&-2\\1&-2&4\end{bmatrix}, Ax2=[1112−1−2−114]A_{x_2} = \begin{bmatrix}1&1&1\\2&-1&-2\\-1&1&4\end{bmatrix}, Ax3=[1−1121−1−1−21]A_{x_3} = \begin{bmatrix}1&-1&1\\2&1&-1\\-1&-2&1\end{bmatrix}.
  3. Their determinants are det⁡(Ax1)=−1\det(A_{x_1}) = -1, det⁡(Ax2)=−7\det(A_{x_2}) = -7, det⁡(Ax3)=−3\det(A_{x_3}) = -3.
  4. x1=−13x_1 = -\dfrac{1}{3}, x2=−73x_2 = -\dfrac{7}{3}, x3=−33=−1x_3 = \dfrac{-3}{3} = -1.
  5. Check in equation 1: −13+73−1=2−1=1-\tfrac{1}{3} + \tfrac{7}{3} - 1 = 2 - 1 = 1.

2.4Order n: the general pattern

Cramer's Rule, order n

For an n×nn \times n system Ax=bA\mathbf{x} = \mathbf{b} with det⁡(A)≠0\det(A) \neq 0, let AxiA_{x_i} be the matrix obtained from AA by replacing its ii-th column with b\mathbf{b}. Then

xi=det⁡(Axi)det⁡(A),i=1,2,…,nx_i = \frac{\det(A_{x_i})}{\det(A)},\qquad i = 1, 2, \dots, n
  • It needs n+1n + 1 determinants of order nn: one for AA and one for each AxiA_{x_i}.
  • A bonus fact (extra). You can find just one unknown without solving for the others: compute only det⁡(A)\det(A) and that one det⁡(Axi)\det(A_{x_i}).
  • Why it is slow for big nn (extra). Computing n+1n + 1 determinants is expensive, which is why elimination is preferred for large systems.

2.5Exam tips and common mistakes

Exam tips
  • Check det⁡(A)≠0\det(A) \neq 0 first. If it is 0, stop: Cramer's Rule does not apply.
  • Replace the column, not the row, and keep the other columns in their original order.
  • When a question gives some unknowns, plug them into the rows first; it often fixes the parameter without any determinant.
Common mistakes
  • Putting b\mathbf{b} in the wrong column.
  • Dividing by det⁡(Axi)\det(A_{x_i}) instead of det⁡(A)\det(A).
  • Using Cramer's Rule on a non-square system.

Practice questions (graded-assignment style)

Q1Which matrices are A_{x}?

Multiple Select Question (MSQ): select all that apply.

For x1+x3=1, −x1+x2−x3=1, −x2+x3=1x_1 + x_3 = 1,\ -x_1 + x_2 - x_3 = 1,\ -x_2 + x_3 = 1 with A=[101−11−10−11]A = \begin{bmatrix}1&0&1\\-1&1&-1\\0&-1&1\end{bmatrix}, b=[111]\mathbf{b} = \begin{bmatrix}1\\1\\1\end{bmatrix}, and AxiA_{x_i} the matrix got by replacing the ii-th column of AA with b\mathbf{b}, choose the correct options.

1
Ax1=[110−11−10−11]A_{x_1} = \begin{bmatrix}1&1&0\\-1&1&-1\\0&-1&1\end{bmatrix}
2
Ax1=[10111−11−11]A_{x_1} = \begin{bmatrix}1&0&1\\1&1&-1\\1&-1&1\end{bmatrix}
3
Ax2=[101−11−10−11]A_{x_2} = \begin{bmatrix}1&0&1\\-1&1&-1\\0&-1&1\end{bmatrix}
4
Ax3=[101−1110−11]A_{x_3} = \begin{bmatrix}1&0&1\\-1&1&1\\0&-1&1\end{bmatrix}
Solution
Idea

Replace the whole column, keep the rest unchanged.

  • Ax1A_{x_1}: column 1 becomes (1,1,1)T(1, 1, 1)^T, so the rows start with 1, 1, 1 and the other columns stay: option 2 is true; option 1 is not AA with a column replaced by b\mathbf{b}, so it is false.
  • Ax2A_{x_2}: column 2 must become (1,1,1)T(1, 1, 1)^T; option 3 is just AA again, so it is false.
  • Ax3A_{x_3}: column 3 becomes (1,1,1)T(1, 1, 1)^T: option 4 is true.
  • Answer: options 2 and 4.
Q2Solving with the values

Multiple Select Question (MSQ): select all that apply.

For the same system, det⁡(A)=1\det(A) = 1 and x=A−1b=(−2,2,3)T\mathbf{x} = A^{-1}\mathbf{b} = (-2, 2, 3)^T. Which are correct?

1
x1=−2x_1 = -2
2
x2=−2x_2 = -2
3
x3=3x_3 = 3
4
None of the above
Solution
Idea

Read the entries of the solution vector.

  • x1=−2x_1 = -2 and x3=3x_3 = 3 are entries 1 and 3; x2=2x_2 = 2, not −2-2.
  • Check in equation 1: x1+x3=−2+3=1x_1 + x_3 = -2 + 3 = 1. Equation 2: 2+2−3=12 + 2 - 3 = 1. Equation 3: −2+3=1-2 + 3 = 1.
  • Answer: options 1 and 3.
Q3Find a²

Numerical Answer Type (NAT).

Ax=bA\mathbf{x} = \mathbf{b} with A=[1a0a1210a]A = \begin{bmatrix}1&a&0\\a&1&2\\1&0&a\end{bmatrix}, x=[x10x3]\mathbf{x} = \begin{bmatrix}x_1\\0\\x_3\end{bmatrix}, b=[100]\mathbf{b} = \begin{bmatrix}1\\0\\0\end{bmatrix}. Find a2a^2, given a≠0, 3, −3a \neq 0,\ \sqrt{3},\ -\sqrt{3}.

Solution
Idea

Use the known second entry x2=0x_2 = 0 in each row.

  • Row 1: x1+a⋅0+0⋅x3=1x_1 + a \cdot 0 + 0 \cdot x_3 = 1, so x1=1x_1 = 1.
  • Row 2: ax1+0+2x3=0a x_1 + 0 + 2x_3 = 0, so a+2x3=0a + 2x_3 = 0 and x3=−a/2x_3 = -a/2.
  • Row 3: x1+ax3=0x_1 + a x_3 = 0, so 1+a(−a/2)=01 + a(-a/2) = 0, i.e. 1−a2/2=01 - a^2/2 = 0 and a2=2a^2 = 2.
  • Answer: 2
Q4Find 3a

Numerical Answer Type (NAT).

Ax=bA\mathbf{x} = \mathbf{b} with A=[12a+33a+21]A = \begin{bmatrix}1&2a+3\\3a+2&1\end{bmatrix}, x=[x10]\mathbf{x} = \begin{bmatrix}x_1\\0\end{bmatrix}, b=[11]\mathbf{b} = \begin{bmatrix}1\\1\end{bmatrix}. Find 3a3a, given det⁡(A)≠0\det(A) \neq 0.

Solution
Idea

Put x2=0x_2 = 0 into both rows.

  • Row 1: x1=1x_1 = 1.
  • Row 2: (3a+2)(1)+1⋅0=1(3a + 2)(1) + 1 \cdot 0 = 1, so 3a+2=13a + 2 = 1 and 3a=−13a = -1.
  • Answer: -1
Q5Cramer by hand (extra)

Numerical Answer Type (NAT).

Solve 2x+y=7, x−y=22x + y = 7,\ x - y = 2 with Cramer's Rule and give xx.

Solution
Idea

det⁡(A)\det(A), then det⁡(Ax1)\det(A_{x_1}).

  • det⁡(A)=2(−1)−1(1)=−3\det(A) = 2(-1) - 1(1) = -3.
  • Ax1=[712−1]A_{x_1} = \begin{bmatrix}7&1\\2&-1\end{bmatrix}, det⁡=−7−2=−9\det = -7 - 2 = -9.
  • x=−9−3=3x = \dfrac{-9}{-3} = 3. (And y=det⁡[2712]−3=−3−3=1y = \dfrac{\det\begin{bmatrix}2&7\\1&2\end{bmatrix}}{-3} = \dfrac{-3}{-3} = 1.)
  • Answer: 3
Revision overview
ConditionsA is square
det(A) ≠ 0
Build A_{xᵢ}Replace the i-th column
of A by b
OrdersOrder 2: 3 determinants
Order 3: 4 determinants
Order n: n + 1
Cramer's RuleWeek 2 · Part 2
Formulaxᵢ = det(A_{xᵢ}) / det(A)
i = 1, 2, …, n
If it failsdet(A) = 0 or not square
Use Gauss elimination
CheckPut x back into every
original equation
Revision: solving a square system with determinants
Next · Square systemsSolving with an Invertible Coefficient Matrix
03
Square systems

Solving with an Invertible Coefficient Matrix

The same systems solved by finding the inverse of A, and a picture of what a unique solution looks like in 3D.

3.1The idea

Cramer's Rule needs n+1n + 1 determinants. This method reaches straight for the inverse of AA. Start from Ax=bA\mathbf{x} = \mathbf{b} and multiply both sides on the left by A−1A^{-1}:

A−1Ax=A−1b  ⟹  x=A−1bA^{-1}A\mathbf{x} = A^{-1}\mathbf{b} \;\Longrightarrow\; \mathbf{x} = A^{-1}\mathbf{b}

This works because A−1A=IA^{-1}A = I. The applicability conditions are exactly the same as for Cramer's Rule: AA must be square and det⁡(A)≠0\det(A) \neq 0.

StartAx = bMultiply by A⁻¹A⁻¹Ax = A⁻¹bResultx = A⁻¹bRead offx₁, x₂, …, xₙ
Figure 4. The inverse-matrix method in four steps
  1. Find the inverse A−1A^{-1} (adjugate and determinant: A−1=adj⁡(A)det⁡(A)A^{-1} = \dfrac{\operatorname{adj}(A)}{\det(A)}).
  2. Compute the product A−1bA^{-1}\mathbf{b}; it is a column matrix.
  3. Read off x1,x2,…,xnx_1, x_2, \dots, x_n by comparing with x\mathbf{x}.
Order matters. It is A−1bA^{-1}\mathbf{b}, with A−1A^{-1} on the left. Matrix multiplication is not commutative, so bA−1\mathbf{b}A^{-1} is a different (and usually undefined) product.

3.2Seeing it in 3D

With three variables each equation is a plane, and an invertible coefficient matrix means all three planes meet at exactly one point. For example, x+y+z=1x + y + z = 1, x=1x = 1, y=−2y = -2 meet only at (1,−2,2)(1, -2, 2).

y = −2x = 1x + y + z = 1unique intersection point(1, −2, 2)an invertible A: one point
Figure 5. Three planes with an invertible coefficient matrix meet in a single point

3.3Cramer's Rule or the inverse?

Cramer's RuleInverse-matrix method
ConditionsAA square, det⁡(A)≠0\det(A) \neq 0AA square, det⁡(A)≠0\det(A) \neq 0
What you computen+1n + 1 determinantsA−1A^{-1}, then A−1bA^{-1}\mathbf{b}
Strengthone unknown at a time (extra)all unknowns at once; reuse A−1A^{-1} for many b\mathbf{b} (extra)

3.4Going deeper

  • Why the answer is unique. If AA is invertible, x=A−1b\mathbf{x} = A^{-1}\mathbf{b} is forced: any solution has to equal it. So an invertible AA gives exactly one solution for every b\mathbf{b}.
  • The 2 × 2 shortcut (extra). For [abcd]\begin{bmatrix}a&b\\c&d\end{bmatrix}: swap the diagonal entries, negate the off-diagonal ones, divide by ad−bcad - bc. That is how adj⁡\operatorname{adj} of Example 5 came out.
  • Adjugate = inverse when det⁡=1\det = 1. In Q1 below det⁡(A)=1\det(A) = 1, so A−1A^{-1} and adj⁡(A)\operatorname{adj}(A) are the same matrix.

3.5Exam tips and common mistakes

Exam tips
  • Always check the answer: AxA\mathbf{x} must give b\mathbf{b} back.
  • If det⁡(A)=1\det(A) = 1, the adjugate is the inverse, so you can skip the division.
Common mistakes
  • Forgetting to divide the adjugate by det⁡(A)\det(A).
  • Multiplying bA−1\mathbf{b}A^{-1} instead of A−1bA^{-1}\mathbf{b}.
  • Sign slips while building the adjugate (signs alternate in a checkerboard).

Practice questions (graded-assignment style)

Q1Inverse of A (Part 1)

Multiple Select Question (MSQ): select all that apply.

Consider 2x1−x2=3, x1−x3=3, x2−x3=22x_1 - x_2 = 3,\ x_1 - x_3 = 3,\ x_2 - x_3 = 2, with A=[2−1010−101−1]A = \begin{bmatrix}2&-1&0\\1&0&-1\\0&1&-1\end{bmatrix}, x=[x1x2x3]\mathbf{x} = \begin{bmatrix}x_1\\x_2\\x_3\end{bmatrix}, b=[332]\mathbf{b} = \begin{bmatrix}3\\3\\2\end{bmatrix}. Choose the correct options.

1
A−1=[2−101−1010−1]A^{-1} = \begin{bmatrix}2&-1&0\\1&-1&0\\1&0&-1\end{bmatrix}
2
A−1=[1−111−221−21]A^{-1} = \begin{bmatrix}1&-1&1\\1&-2&2\\1&-2&1\end{bmatrix}
3
The adjoint of AA is [1−111−221−21]\begin{bmatrix}1&-1&1\\1&-2&2\\1&-2&1\end{bmatrix}
4
det⁡(A)=1\det(A) = 1
Solution
Idea

Compute det⁡(A)\det(A) first, then check each option with AA−1=IAA^{-1} = I.

  • det⁡(A)=2(0+1)+1(−1−0)+0=2−1=1\det(A) = 2(0 + 1) + 1(-1 - 0) + 0 = 2 - 1 = 1, so option 4 is true.
  • With det⁡(A)=1\det(A) = 1, A−1=adj⁡(A)=[1−111−221−21]A^{-1} = \operatorname{adj}(A) = \begin{bmatrix}1&-1&1\\1&-2&2\\1&-2&1\end{bmatrix}: options 2 and 3 are true.
  • Option 1 fails: row 1 of AA times column 1 of option 1 is 2⋅2+(−1)⋅1=3≠12 \cdot 2 + (-1) \cdot 1 = 3 \neq 1.
  • Answer: options 2, 3 and 4.
Q2Solution (Part 2)

Multiple Select Question (MSQ): select all that apply.

For the same system, which are correct?

1
x1=−2x_1 = -2
2
x2=1x_2 = 1
3
x3=−1x_3 = -1
4
None of the above
Solution
Idea

Use x=A−1b\mathbf{x} = A^{-1}\mathbf{b}.

  • A−1b=[1−111−221−21][332]=[21−1]A^{-1}\mathbf{b} = \begin{bmatrix}1&-1&1\\1&-2&2\\1&-2&1\end{bmatrix}\begin{bmatrix}3\\3\\2\end{bmatrix} = \begin{bmatrix}2\\1\\-1\end{bmatrix}.
  • So x1=2x_1 = 2 (not −2-2), x2=1x_2 = 1, x3=−1x_3 = -1.
  • Check: 2(2)−1=32(2) - 1 = 3, 2−(−1)=32 - (-1) = 3, 1−(−1)=21 - (-1) = 2.
  • Answer: options 2 and 3.
Q3A 2 × 2 solve

Numerical Answer Type (NAT).

Use the inverse method on 2x1+x2=1, 5x1+3x2=22x_1 + x_2 = 1,\ 5x_1 + 3x_2 = 2 and find x1+2x2x_1 + 2x_2.

Solution
Idea

det⁡(A)=1\det(A) = 1, so the adjugate is the inverse.

  • A=[2153]A = \begin{bmatrix}2&1\\5&3\end{bmatrix}, det⁡(A)=6−5=1\det(A) = 6 - 5 = 1, A−1=[3−1−52]A^{-1} = \begin{bmatrix}3&-1\\-5&2\end{bmatrix}.
  • x=[3−1−52][12]=[1−1]\mathbf{x} = \begin{bmatrix}3&-1\\-5&2\end{bmatrix}\begin{bmatrix}1\\2\end{bmatrix} = \begin{bmatrix}1\\-1\end{bmatrix}.
  • So x1+2x2=1+2(−1)=−1x_1 + 2x_2 = 1 + 2(-1) = -1.
  • Answer: -1
Q4The right formula

Multiple Choice Question (MCQ): choose the one correct option.

If AA is square and invertible, the solution of Ax=bA\mathbf{x} = \mathbf{b} is:

1
x=bA−1\mathbf{x} = \mathbf{b}A^{-1}
2
x=A−1b\mathbf{x} = A^{-1}\mathbf{b}
3
x=Ab−1\mathbf{x} = A\mathbf{b}^{-1}
4
x=b−A\mathbf{x} = \mathbf{b} - A
Solution
Idea

Multiply both sides of Ax=bA\mathbf{x} = \mathbf{b} by A−1A^{-1} on the left.

  • A−1Ax=A−1bA^{-1}A\mathbf{x} = A^{-1}\mathbf{b} and A−1A=IA^{-1}A = I, so x=A−1b\mathbf{x} = A^{-1}\mathbf{b}.
  • b−1\mathbf{b}^{-1} does not exist (a column is not a square matrix), and bA−1\mathbf{b}A^{-1} has the wrong shape.
  • Answer: option 2.
Revision overview
StartAx = b
A square, det(A) ≠ 0
MultiplyA⁻¹ on the left
A⁻¹A = I
InverseA⁻¹ = adj(A) / det(A)
Inverse methodWeek 2 · Part 3
Resultx = A⁻¹b
A column matrix
GeometryThree planes meet
at one point
CheckAx must give b back
Revision: solving a square system with the inverse matrix
Next · Any systemThe Echelon Form
04
Any system

The Echelon Form

The shapes that a matrix is reduced to, so that systems of any size, square or not, can be solved.

4.1Why we need it

Cramer's Rule and the inverse method share a blind spot: they work only when AA is square and invertible. Real systems are often rectangular, or square but singular. The echelon form is the tool that handles those too. It is really two related shapes.

4.2Row echelon form (REF)

Row echelon form

A matrix is in row echelon form if:

  1. The first non-zero entry (the leading entry) of each row is 1.
  2. The leading 1 of each row sits strictly to the right of the leading 1 in the row above.
  3. Any all-zero rows sit at the bottom, below every non-zero row.

4.3Reduced row echelon form (RREF)

Reduced row echelon form

A matrix is in reduced row echelon form if it satisfies everything above, plus one more condition:

  1. The leading 1 in each row is the only non-zero entry in its entire column.
RREF is REF with extra clean-up

Every matrix in RREF is automatically in REF. RREF just adds the column clean-up condition on top.

12501300010−1013000REFRREFR₁ − 2R₂2 sits above a leading 1:allowed in REF, not in RREFzeros above and belowevery leading 1
Figure 6. A REF (left) and the RREF it reduces to (right); the dashed staircase marks the zeros

4.4Going deeper

  • Leading 1 = pivot (extra). The leading 1 of a row is also called a pivot, and its column a pivot column. This word is used a lot in Part 6.
  • RREF is unique (extra). A matrix can have many REFs, but its RREF is one single matrix, whichever row operations you use to reach it.
  • Echelon form and determinants. A square matrix with a row of zeros has det⁡=0\det = 0. A square matrix whose RREF is the identity has det⁡≠0\det \neq 0 (it is invertible), as in Q2 below.

4.5Exam tips and common mistakes

Exam tips
  • Test the three REF conditions in order: leading 1s, staircase, zero rows. Only then test the RREF column condition.
  • Look only at the entry above and below each leading 1 for RREF; other entries are free.
Common mistakes
  • Requiring the leading entry to be 1 but forgetting the staircase direction (it goes right as you go down).
  • Calling a matrix RREF when a non-leading entry above a leading 1 is non-zero.
  • Putting a zero row above a non-zero row.

Practice questions (graded-assignment style)

Q1Reading a matrix

Multiple Select Question (MSQ): select all that apply.

Let A=[013102000]A = \begin{bmatrix}0&1&3\\1&0&2\\0&0&0\end{bmatrix} (row 1 is the topmost row). Identify the correct statements.

1
The first non-zero element in the first row is 3.
2
The first non-zero element in the second row is 1.
3
There is a non-zero element in the third row.
4
Since there is a row with all elements zero, det⁡(A)=0\det(A) = 0.
Solution
Idea

Read each row from the left.

  • Row 1 is (0,1,3)(0, 1, 3): its first non-zero entry is 1, not 3 (option 1 false).
  • Row 2 is (1,0,2)(1, 0, 2): it begins with 1 (option 2 true). Row 3 is entirely zero (option 3 false).
  • A square matrix with a zero row has det⁡=0\det = 0 (option 4 true).
  • Answer: options 2 and 4.
Q2Row operations and RREF

Multiple Select Question (MSQ): select all that apply.

Let A=[1−11011−101]A = \begin{bmatrix}1&-1&1\\0&1&1\\-1&0&1\end{bmatrix}, a 3×33 \times 3 matrix. Which statements are true?

1
AA can be transformed by row operations into [1−11011001]\begin{bmatrix}1&-1&1\\0&1&1\\0&0&1\end{bmatrix}, which is in REF.
2
The RREF of AA is [101010001]\begin{bmatrix}1&0&1\\0&1&0\\0&0&1\end{bmatrix}.
3
The RREF of AA is [100010001]\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix}.
4
AA can be transformed into [100010001]\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix}, which is in REF.
Solution
Idea

Compute det⁡(A)\det(A): non-zero means the RREF is the identity.

  • R3+R1R_3 + R_1 gives [1−110110−12]\begin{bmatrix}1&-1&1\\0&1&1\\0&-1&2\end{bmatrix}, then R3+R2R_3 + R_2 gives [1−11011003]\begin{bmatrix}1&-1&1\\0&1&1\\0&0&3\end{bmatrix}, then 13R3\tfrac{1}{3}R_3 gives the matrix of option 1: true.
  • det⁡(A)=3≠0\det(A) = 3 \neq 0, so the RREF is the identity matrix II: option 3 is true and option 2 is false.
  • The identity is also in REF, and AA can reach it, so option 4 is true.
  • Answer: options 1, 3 and 4.
Q3A missing column

Numerical Answer Type (NAT).

The RREF of a matrix AA is [10−1011]\begin{bmatrix}1&0&-1\\0&1&1\end{bmatrix}. The first and third columns of AA itself are [−12]\begin{bmatrix}-1\\2\end{bmatrix} and [−11]\begin{bmatrix}-1\\1\end{bmatrix}. If the second column of AA is [m1m2]\begin{bmatrix}m_1\\m_2\end{bmatrix}, find m1+m2m_1 + m_2.

Solution
Idea

Row operations act on every column in the same way: EA=RREFE A = \text{RREF}.

  • From columns 1 and 3: E[−1−121]=[1−101]E\begin{bmatrix}-1&-1\\2&1\end{bmatrix} = \begin{bmatrix}1&-1\\0&1\end{bmatrix}, giving E=[32−2−1]E = \begin{bmatrix}3&2\\-2&-1\end{bmatrix}.
  • The second column of the RREF is [01]\begin{bmatrix}0\\1\end{bmatrix}, so E[m1m2]=[01]E\begin{bmatrix}m_1\\m_2\end{bmatrix} = \begin{bmatrix}0\\1\end{bmatrix}.
  • Check the logic: EE turns (−1,2)T(-1, 2)^T into (1,0)T(1, 0)^T and (−1,1)T(-1, 1)^T into (−1,1)T(-1, 1)^T.
  • E−1=[−1−223]E^{-1} = \begin{bmatrix}-1&-2\\2&3\end{bmatrix}, so [m1m2]=[−23]\begin{bmatrix}m_1\\m_2\end{bmatrix} = \begin{bmatrix}-2\\3\end{bmatrix} and m1+m2=1m_1 + m_2 = 1.
  • Answer: 1
Q4Which is RREF?

Multiple Choice Question (MCQ): choose the one correct option.

Which of the following matrices is in reduced row echelon form?

1
[100010001]\begin{bmatrix}1&0&0\\0&1&0\\0&0&1\end{bmatrix}
2
[120010000]\begin{bmatrix}1&2&0\\0&1&0\\0&0&0\end{bmatrix}
3
[010100001]\begin{bmatrix}0&1&0\\1&0&0\\0&0&1\end{bmatrix}
4
[103000010]\begin{bmatrix}1&0&3\\0&0&0\\0&1&0\end{bmatrix}
Solution
Idea

Check staircase, zero rows and clean columns.

  • Option 1 is the identity: RREF.
  • Option 2: the 2 above the second leading 1 breaks the column condition (REF only).
  • Option 3: the leading 1 of row 2 is to the left of the leading 1 of row 1. Not REF.
  • Option 4: the zero row is above a non-zero row. Not REF.
  • Answer: option 1.
Revision overview
REFLeading entry is 1
Staircase to the right
Zero rows at the bottom
RREFREF plus
leading 1 is alone
in its column
RelationRREF is always REF
REF need not be RREF
Echelon formsWeek 2 · Part 4
WhyWorks for non-square
and singular matrices
PivotA leading 1
Its column is a pivot column
With detZero row: det = 0
RREF = I: det ≠ 0
Revision: recognising row echelon and reduced row echelon form
Next · Any systemRow Reduction
05
Any system

Row Reduction

The three elementary row operations, what they do to the determinant, and the algorithm that reaches REF and RREF.

5.1The three elementary row operations

Getting a matrix into echelon form uses three elementary row operations. Each has a predictable effect on the determinant, which is worth remembering.

Type 1 · swapR₁ ↔ R₂det(B) = −det(A)sign flipsType 2 · scaleR₂ → c · R₂det(B) = c · det(A)scales by cType 3 · add a multipleR₂ → R₂ + k · R₁det(B) = det(A)unchanged
Figure 7. The three row operations and what each does to the determinant
TypeOperationEffect on det⁡\det
1 · interchangeswap two rowsdet⁡(B)=−det⁡(A)\det(B) = -\det(A)
2 · scalemultiply a row by a constant ccdet⁡(B)=c⋅det⁡(A)\det(B) = c \cdot \det(A)
3 · add a multipleadd a multiple of one row to anotherdet⁡(B)=det⁡(A)\det(B) = \det(A), unchanged

5.2The row-reduction algorithm

To carry any m×nm \times n matrix into REF and then RREF:

  1. Step 1. Find the left-most non-zero column.
  2. Step 2. Use a Type 1 or Type 2 operation to make its top entry 1.
  3. Step 3. Use Type 3 operations to zero out every entry below that 1.
  4. Step 4. Repeat on the submatrix below and to the right of the current row, until no non-zero rows are left. The matrix is now in REF.
  5. Step 5. For each column with a leading 1, use Type 3 operations to clear every other entry in that column. The matrix is now in RREF.
Forward, then backward. Steps 1 to 4 sweep downward and rightward and produce zeros below each leading 1 (REF). Step 5 sweeps back up and produces zeros above them (RREF).

5.3Going deeper

  • Row operations keep the solutions. Applying them to [A∣b][A \mid \mathbf{b}] never changes the solution set of Ax=bA\mathbf{x} = \mathbf{b}. Each step is reversible, so equations are replaced by equivalent ones (extra).
  • Why Type 2 uses c≠0c \neq 0 (extra). Multiplying a row by 0 would destroy information and cannot be undone.
  • Each operation is a matrix (extra). Doing a row operation is the same as multiplying on the left by an elementary matrix. That is why EA=RREFE A = \text{RREF} in Q3 of Part 4 acts on every column in the same way.

5.4Exam tips and common mistakes

Exam tips
  • Write the operation next to every step (R₂ − 3R₁ and so on) so mistakes are easy to trace.
  • To avoid fractions, you may swap rows to get a 1 early, or scale only when needed.
  • Never change two rows at once with a swap and an add in the same step.
Common mistakes
  • Believing that scaling a row leaves det⁡\det unchanged (Type 2 changes it by cc).
  • Using the already-changed row while updating a second row in the same step.
  • Forgetting Step 5 and calling a REF a RREF.

Practice questions (graded-assignment style)

Q1Non-zero rows

Numerical Answer Type (NAT).

Let A=[0131021−1−1]A = \begin{bmatrix}0&1&3\\1&0&2\\1&-1&-1\end{bmatrix} and let RR be its reduced row echelon form. How many non-zero rows does RR have?

Solution
Idea

Row-reduce AA.

  • Swap R1↔R2R_1 \leftrightarrow R_2: [1020131−1−1]\begin{bmatrix}1&0&2\\0&1&3\\1&-1&-1\end{bmatrix}.
  • R3−R1R_3 - R_1: [1020130−1−3]\begin{bmatrix}1&0&2\\0&1&3\\0&-1&-3\end{bmatrix}; then R3+R2R_3 + R_2: [102013000]\begin{bmatrix}1&0&2\\0&1&3\\0&0&0\end{bmatrix}.
  • This is already the RREF, with 2 non-zero rows.
  • Answer: 2
Q2Using the RREF

Numerical Answer Type (NAT).

For the same AA, consider Ax=bA\mathbf{x} = \mathbf{b} with x=(x1,x2,x3)T\mathbf{x} = (x_1, x_2, x_3)^T and b=(4,3,−1)T\mathbf{b} = (4, 3, -1)^T. If x1=0x_1 = 0 is given, find x2x_2.

Solution
Idea

Use the first two rows of Ax=bA\mathbf{x} = \mathbf{b}.

  • Row 2 of Ax=bA\mathbf{x} = \mathbf{b}: x1+2x3=3x_1 + 2x_3 = 3. With x1=0x_1 = 0, x3=32x_3 = \tfrac32.
  • Row 1: x2+3x3=4x_2 + 3x_3 = 4, so x2=4−92=−12x_2 = 4 - \tfrac92 = -\tfrac12.
  • Check row 3: x1−x2−x3=0+12−32=−1x_1 - x_2 - x_3 = 0 + \tfrac12 - \tfrac32 = -1. ✓\checkmark
  • Answer: -0.5
Q3Row operations and the determinant

Multiple Select Question (MSQ): select all that apply.

Let AA and BB be 3×33 \times 3 matrices. Eqn 1: det⁡(A)=−det⁡(B)\det(A) = -\det(B). Eqn 2: det⁡(A)=−cdet⁡(B)\det(A) = -c\det(B) for some c∈Rc \in \mathbb{R}. Eqn 3: det⁡(A)=det⁡(B)\det(A) = \det(B). Choose the correct options.

1
If BB comes from AA via a Type 1 operation, Eqn 1 holds.
2
If BB comes from AA via a Type 1 operation followed by a Type 2 operation, Eqn 2 holds for some cc.
3
If BB comes from AA via a Type 2 operation, Eqn 3 holds.
4
If BB comes from AA via a Type 3 operation, Eqn 3 holds.
Solution
Idea

Recall the effect of each type on det⁡\det.

  • Type 1 flips the sign: option 1 is true.
  • Type 1 then Type 2 gives det⁡(B)=−cdet⁡(A)\det(B) = -c\det(A) (with cc the scaling factor), which is Eqn 2 for some cc: option 2 is true.
  • Type 2 generally changes the determinant (it multiplies it by cc), so option 3 is false.
  • Type 3 leaves det⁡\det unchanged: option 4 is true.
  • Answer: options 1, 2 and 4.
Q4Swap and scale (extra)

Numerical Answer Type (NAT).

det⁡(A)=6\det(A) = 6. Swap two rows of AA, then multiply one row of the result by 3. What is the determinant of the final matrix?

Solution
Idea

Apply the two effects one after another.

  • Swap: 6→−66 \to -6.
  • Scale a row by 3: −6→−18-6 \to -18.
  • Answer: -18
Revision overview
Type 1Swap two rows
det changes sign
Type 2Scale a row by c ≠ 0
det × c
Type 3Add a multiple of
one row to another
det unchanged
Row reductionWeek 2 · Part 5
Steps 1 to 4Left-most column, make 1,
zero below, repeat
Result: REF
Step 5Clear above each leading 1
Result: RREF
CheckTrack det through each step
as a sanity check
Revision: carrying a matrix to REF and RREF
Next · Any systemThe Gauss Elimination Method
06
Any system

The Gauss Elimination Method

Solving any linear system by row-reducing its augmented matrix, and reading off whether the answer is unique, infinite, or absent.

6.1Why Gauss elimination?

Cramer's Rule and the inverse method both need a square, invertible AA. Gauss elimination has no such requirement. It works whether AA is square or rectangular, invertible or singular, and it tells you outright whether the system has a unique solution, infinitely many, or none at all.

6.2Homogeneous and non-homogeneous systems

Homogeneous: Ax = 0

Every right-hand side is zero. It always has the trivial solution x=0\mathbf{x} = \mathbf{0}. Then exactly one of two things happens: 0\mathbf{0} is the only solution, or there are infinitely many solutions besides 0\mathbf{0}.

Non-homogeneous: Ax = b

Some bi≠0b_i \neq 0. It can land in any of three buckets: a unique solution, infinitely many, or none. Gauss elimination decides which.

What is guaranteed for Ax = 0
  • More unknowns than equations (n>mn > m): there are always infinitely many solutions besides 0\mathbf{0}, because a free variable must exist.
  • AA square and invertible: 0\mathbf{0} is the only solution.
Correction to the source (extra). The source says 0\mathbf{0} is the only solution "whenever the number of equations exceeds the number of variables". That is not always true: x+y=0, 2x+2y=0, 3x+3y=0x + y = 0,\ 2x + 2y = 0,\ 3x + 3y = 0 has 3 equations and 2 unknowns but infinitely many solutions. The exact test is: 0\mathbf{0} is the only solution exactly when every variable column has a leading 1 in the RREF.

6.3The augmented matrix

For Ax=bA\mathbf{x} = \mathbf{b}, the augmented matrix [A∣b][A \mid \mathbf{b}] glues the column b\mathbf{b} onto AA as an extra last column:

[A∣b]=[a11a12⋯a1nb1a21a22⋯a2nb2⋮⋮⋱⋮⋮am1am2⋯amnbm][A \mid \mathbf{b}] = \left[\begin{array}{cccc|c}a_{11}&a_{12}&\cdots&a_{1n}&b_1\\a_{21}&a_{22}&\cdots&a_{2n}&b_2\\\vdots&\vdots&\ddots&\vdots&\vdots\\a_{m1}&a_{m2}&\cdots&a_{mn}&b_m\end{array}\right]

6.4The algorithm

Augment[A | b]Row-reduceto RREFSplit[R | c]SolveRx = c
Figure 8. Gauss elimination in four moves
  1. Step 1. Form the augmented matrix [A∣b][A \mid \mathbf{b}].
  2. Step 2. Row-reduce it all the way to RREF, with the operations of Part 5.
  3. Step 3. Split the result as [R∣c][R \mid \mathbf{c}], where RR is the RREF of AA and c\mathbf{c} is the transformed last column.
  4. Step 4. Rewrite it as the equation Rx=cR\mathbf{x} = \mathbf{c}.
  5. Step 5. Solve Rx=cR\mathbf{x} = \mathbf{c} directly. A variable with no leading 1 in its column is a free (independent) variable; the others are dependent, written in terms of the free ones.

6.5Reading the outcome

100201030014Unique solutiona leading 1 in everyvariable column102301310000Infinitely manya free column (no leading 1)free variable = parameter102301310001No solutionrow 0 0 0 | 1 says 0 = 1the system is inconsistent
Figure 9. The three possible RREFs of an augmented matrix
RREF of [A | b]OutcomeWhy
every variable column has a leading 1, no bad rowunique solutioneach variable is fixed
some variable column has no leading 1, no bad rowinfinitely manyfree variables can take any value
a row (0  0 ⋯ 0∣1)(0\ \ 0\ \cdots\ 0 \mid 1)no solutionit says 0=10 = 1

6.6Choosing a method

Is A square with det(A) ≠ 0?yesnoCramer or inverseunique solution,n × n square systemGauss eliminationany shape, any rank:one, many or none
Figure 10. Which method fits which system

6.7Going deeper

  • Free variables. The number of free variables is (number of unknowns) −- (number of leading 1s in the coefficient part). One free variable gives a line of solutions, two give a plane, and so on (extra).
  • Parameter problems. When a system has a letter like cc or dd, reduce as far as the letters allow, then split into cases (Q3 below).
  • The same pivot idea (extra). "Leading 1 in every variable column" means unique; "a free column" means infinitely many; "0 = 1 row" means none. These three checks answer almost every question on this topic.

6.8Rank, the inverse by Gauss–Jordan, and the rules of the inverse

Four ideas that the graded assignments lean on and that grow straight out of row reduction: rank, the rank test for solutions, finding A−1A^{-1} by Gauss–Jordan, and the algebra of inverses.

A. Rank

Rank

The rank of a matrix AA, written rank⁡(A)\operatorname{rank}(A), is the number of non-zero rows in its row echelon form, which is the same as the number of leading 1s (pivots) in its RREF.

Example. A=[121243364]A = \begin{bmatrix} 1 & 2 & 1 \\ 2 & 4 & 3 \\ 3 & 6 & 4 \end{bmatrix}. Then R2−2R1=(0,0,1)R_2 - 2R_1 = (0, 0, 1) and R3−3R1=(0,0,1)R_3 - 3R_1 = (0, 0, 1); subtracting once more, R3−R2=(0,0,0)R_3 - R_2 = (0, 0, 0). The RREF is

[120001000]⇒rank⁡(A)=2.\begin{bmatrix} 1 & 2 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix} \quad\Rightarrow\quad \operatorname{rank}(A) = 2.
  • Elementary row operations do not change the rank, so any echelon form gives the right count.
  • For an m×nm \times n matrix, rank⁡(A)≤min⁡(m,n)\operatorname{rank}(A) \le \min(m, n), and rank⁡(A)=rank⁡(AT)\operatorname{rank}(A) = \operatorname{rank}(A^T).
  • Rank counts the rows that are genuinely new: here row 2 is not a multiple of row 1, but row 3 is made of rows 1 and 2, so only two rows survive.
  • For an n×nn \times n matrix: rank⁡(A)=n  ⟺  det⁡A≠0\operatorname{rank}(A) = n \iff \det A \neq 0 (RREF is II). In the example, det⁡A=0\det A = 0 and rank⁡=2<3\operatorname{rank} = 2 < 3.

B. The rank test for Ax=bA\mathbf{x} = \mathbf{b}

Let AA be m×nm \times n (nn unknowns) and compare the rank of AA with the rank of the augmented matrix [A∣b][A \mid \mathbf{b}]. This is just 6.5 written with ranks: a row (0 ⋯ 0∣1)(0\ \cdots\ 0 \mid 1) raises the rank of [A∣b][A \mid \mathbf{b}] by one.

RanksOutcome
rank⁡[A∣b]>rank⁡(A)\operatorname{rank}[A \mid \mathbf{b}] > \operatorname{rank}(A)no solution (inconsistent)
rank⁡[A∣b]=rank⁡(A)=n\operatorname{rank}[A \mid \mathbf{b}] = \operatorname{rank}(A) = nexactly one solution
rank⁡[A∣b]=rank⁡(A)=r<n\operatorname{rank}[A \mid \mathbf{b}] = \operatorname{rank}(A) = r < ninfinitely many, with n−rn - r free variables
The two ranks can differ by at most 1, because [A∣b][A \mid \mathbf{b}] has only one extra column. For a homogeneous system Ax=0A\mathbf{x} = \mathbf{0} the two ranks are always equal, so it is always consistent, and it has a non-trivial solution exactly when rank⁡(A)<n\operatorname{rank}(A) < n.

A parameter example. Take x+y+z=1,  x+2y+3z=4,  x+3y+kz=mx + y + z = 1,\; x + 2y + 3z = 4,\; x + 3y + kz = m. Row-reduce the augmented matrix: R2−R1R_2 - R_1 gives (0,1,2∣3)(0, 1, 2 \mid 3), R3−R1R_3 - R_1 gives (0,2,k−1∣m−1)(0, 2, k - 1 \mid m - 1), then R3−2R2R_3 - 2R_2 gives

[1111012300k−5m−7]\left[\begin{array}{ccc|c} 1 & 1 & 1 & 1 \\ 0 & 1 & 2 & 3 \\ 0 & 0 & k - 5 & m - 7 \end{array}\right]
  • k≠5k \neq 5: both ranks are 3, so a unique solution, for every mm.
  • k=5k = 5 and m=7m = 7: last row is all zeros, both ranks are 2, so infinitely many solutions (3−2=13 - 2 = 1 free variable).
  • k=5k = 5 and m≠7m \neq 7: last row is (0 0 0∣m−7)(0\ 0\ 0 \mid m - 7) with m−7≠0m - 7 \neq 0; ranks are 2 and 3, so no solution.

The coefficient determinant of this system is k−5k - 5, which agrees: the system fails to have a unique solution only at k=5k = 5.

C. Finding A−1A^{-1} by Gauss–Jordan

Write AA and the identity side by side as [A∣I][A \mid I] and row-reduce until the left half becomes II. Whatever the same row operations have turned the right half into is A−1A^{-1}:

[A∣I]  →row operations  [I∣A−1][A \mid I] \;\xrightarrow{\text{row operations}}\; [I \mid A^{-1}]

Why it works. Each row operation is multiplication on the left by an invertible matrix. If the product of all of them is EE, then EA=IEA = I and EI=EEI = E. So E=A−1E = A^{-1}, and the right half records EE.

Example. A=[123014560]A = \begin{bmatrix} 1 & 2 & 3 \\ 0 & 1 & 4 \\ 5 & 6 & 0 \end{bmatrix}.

[123100014010560001]→R3−5R1[1231000140100−4−15−501]\left[\begin{array}{ccc|ccc} 1 & 2 & 3 & 1 & 0 & 0 \\ 0 & 1 & 4 & 0 & 1 & 0 \\ 5 & 6 & 0 & 0 & 0 & 1 \end{array}\right] \xrightarrow{R_3 - 5R_1} \left[\begin{array}{ccc|ccc} 1 & 2 & 3 & 1 & 0 & 0 \\ 0 & 1 & 4 & 0 & 1 & 0 \\ 0 & -4 & -15 & -5 & 0 & 1 \end{array}\right]
→R3+4R2[123100014010001−541]→R2−4R3[12310001020−15−4001−541]\xrightarrow{R_3 + 4R_2} \left[\begin{array}{ccc|ccc} 1 & 2 & 3 & 1 & 0 & 0 \\ 0 & 1 & 4 & 0 & 1 & 0 \\ 0 & 0 & 1 & -5 & 4 & 1 \end{array}\right] \xrightarrow{R_2 - 4R_3} \left[\begin{array}{ccc|ccc} 1 & 2 & 3 & 1 & 0 & 0 \\ 0 & 1 & 0 & 20 & -15 & -4 \\ 0 & 0 & 1 & -5 & 4 & 1 \end{array}\right]
→R1−3R3[12016−12−301020−15−4001−541]→R1−2R2[100−2418501020−15−4001−541]\xrightarrow{R_1 - 3R_3} \left[\begin{array}{ccc|ccc} 1 & 2 & 0 & 16 & -12 & -3 \\ 0 & 1 & 0 & 20 & -15 & -4 \\ 0 & 0 & 1 & -5 & 4 & 1 \end{array}\right] \xrightarrow{R_1 - 2R_2} \left[\begin{array}{ccc|ccc} 1 & 0 & 0 & -24 & 18 & 5 \\ 0 & 1 & 0 & 20 & -15 & -4 \\ 0 & 0 & 1 & -5 & 4 & 1 \end{array}\right]

So A−1=[−2418520−15−4−541]A^{-1} = \begin{bmatrix} -24 & 18 & 5 \\ 20 & -15 & -4 \\ -5 & 4 & 1 \end{bmatrix}. Check: det⁡A=1\det A = 1 (so adj⁡(A)\operatorname{adj}(A) is the same matrix), and the first row of AA times the first column of A−1A^{-1} is 1(−24)+2(20)+3(−5)=11(-24) + 2(20) + 3(-5) = 1, while row 1 times column 2 is 1(18)+2(−15)+3(4)=01(18) + 2(-15) + 3(4) = 0 ✓.

When it fails. If a zero row appears in the left half, AA is singular and has no inverse. For [123456789]\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}: R2−4R1=(0,−3,−6)R_2 - 4R_1 = (0, -3, -6), R3−7R1=(0,−6,−12)R_3 - 7R_1 = (0, -6, -12), then R3−2R2=(0,0,0)R_3 - 2R_2 = (0, 0, 0). Rank 2, so no inverse. Gauss–Jordan therefore also tests invertibility without computing a determinant.

2 × 2 shortcut. [abcd]−1=1ad−bc[d−b−ca]\begin{bmatrix} a & b \\ c & d \end{bmatrix}^{-1} = \dfrac{1}{ad - bc}\begin{bmatrix} d & -b \\ -c & a \end{bmatrix}. For [2153]\begin{bmatrix} 2 & 1 \\ 5 & 3 \end{bmatrix}, ad−bc=1ad - bc = 1, so the inverse is [3−1−52]\begin{bmatrix} 3 & -1 \\ -5 & 2 \end{bmatrix}.

D. The rules of the inverse

Let AA and BB be invertible matrices of the same order.

RuleWhy
(A−1)−1=A(A^{-1})^{-1} = AAA does what the inverse of A−1A^{-1} must do: A−1A=IA^{-1}A = I.
(AB)−1=B−1A−1(AB)^{-1} = B^{-1}A^{-1} (order reverses)(AB)(B−1A−1)=A(BB−1)A−1=AA−1=I(AB)(B^{-1}A^{-1}) = A(BB^{-1})A^{-1} = AA^{-1} = I. Undo the last step first, like taking off socks and shoes.
(AT)−1=(A−1)T(A^T)^{-1} = (A^{-1})^TAT(A−1)T=(A−1A)T=IT=IA^T(A^{-1})^T = (A^{-1}A)^T = I^T = I.
(cA)−1=1cA−1(cA)^{-1} = \dfrac{1}{c}A^{-1}, c≠0c \neq 0(cA)(1cA−1)=AA−1=I(cA)\left(\tfrac1c A^{-1}\right) = AA^{-1} = I.
(Ak)−1=(A−1)k(A^k)^{-1} = (A^{-1})^kApply the product rule kk times.
det⁡(A−1)=1det⁡A\det(A^{-1}) = \dfrac{1}{\det A}det⁡A⋅det⁡A−1=det⁡I=1\det A \cdot \det A^{-1} = \det I = 1.
ABAB is invertible exactly when both AA and BB aredet⁡(AB)=det⁡Adet⁡B≠0\det(AB) = \det A \det B \neq 0 needs both factors non-zero.
Not true
  • (AB)−1≠A−1B−1(AB)^{-1} \neq A^{-1}B^{-1} in general. It is B−1A−1B^{-1}A^{-1}.
  • (A+B)−1≠A−1+B−1(A + B)^{-1} \neq A^{-1} + B^{-1}. There is no simple formula for the inverse of a sum.
  • No cancelling without an inverse. AB=ACAB = AC gives B=CB = C only when AA is invertible (multiply by A−1A^{-1} on the left). With A=[1111]A = \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix}, B=IB = I, C=[0110]C = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}, we get AB=AC=[1111]AB = AC = \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix} but B≠CB \neq C.

Solving matrix equations. For invertible AA: AX=B⇒X=A−1BAX = B \Rightarrow X = A^{-1}B (multiply on the left), but XA=B⇒X=BA−1XA = B \Rightarrow X = BA^{-1} (multiply on the right). The side matters because matrix products do not commute.

E. One square matrix, many equivalent statements

For an n×nn \times n matrix AA, each of these says the same thing, and each has a negation that all say the opposite:

AA is invertibleAA is singular
det⁡A≠0\det A \neq 0det⁡A=0\det A = 0
rank⁡(A)=n\operatorname{rank}(A) = nrank⁡(A)<n\operatorname{rank}(A) < n
RREF of AA is IIRREF has a zero row
Ax=0A\mathbf{x} = \mathbf{0} has only x=0\mathbf{x} = \mathbf{0}Ax=0A\mathbf{x} = \mathbf{0} has a non-trivial solution
Ax=bA\mathbf{x} = \mathbf{b} has exactly one solution for every b\mathbf{b}Ax=bA\mathbf{x} = \mathbf{b} has none or infinitely many, depending on b\mathbf{b}
Cramer's Rule and x=A−1b\mathbf{x} = A^{-1}\mathbf{b} applyNeither applies; use Gauss elimination

6.9Exam tips and common mistakes

Exam tips
  • Always carry the last column along with every row operation.
  • After solving, plug your answer back into the original equations.
  • For a solution set with a free variable, write it with a parameter: S = { ... | c ∈ ℝ }.
Common mistakes
  • Row-reducing only A and forgetting the b column.
  • Treating a free variable as dependent, or giving only one solution for a system with a free variable.
  • Missing the row (0  0 ⋯ 0∣1)(0\ \ 0\ \cdots\ 0 \mid 1) and claiming a solution exists.

Practice questions (graded-assignment style)

Q1Going back two steps

Numerical Answer Type (NAT).

Let P=[101011001]P = \begin{bmatrix}1&0&1\\0&1&1\\0&0&1\end{bmatrix} and PXn−1=XnPX_{n-1} = X_n. If X2=[783]X_2 = \begin{bmatrix}7\\8\\3\end{bmatrix}, what is the sum of all elements of X0X_0?

Solution
Idea

X0=P−2X2X_0 = P^{-2}X_2.

  • P−1=[10−101−1001]P^{-1} = \begin{bmatrix}1&0&-1\\0&1&-1\\0&0&1\end{bmatrix}; check: PP−1=IP P^{-1} = I.
  • X1=P−1X2=(7−3, 8−3, 3)T=(4,5,3)TX_1 = P^{-1}X_2 = (7 - 3,\ 8 - 3,\ 3)^T = (4, 5, 3)^T.
  • X0=P−1X1=(4−3, 5−3, 3)T=(1,2,3)TX_0 = P^{-1}X_1 = (4 - 3,\ 5 - 3,\ 3)^T = (1, 2, 3)^T. The sum is 66.
  • Answer: 6
Q2How many solutions?

Multiple Choice Question (MCQ): choose the one correct option.

The system x−y+z=2, x+y−z=3, −x+y+z=4x - y + z = 2,\ x + y - z = 3,\ -x + y + z = 4 has:

1
No solution.
2
Infinitely many solutions.
3
A unique solution.
4
Finitely many solutions.
Solution
Idea

Find det⁡\det of the coefficient matrix.

  • det⁡[1−1111−1−111]=4≠0\det\begin{bmatrix}1&-1&1\\1&1&-1\\-1&1&1\end{bmatrix} = 4 \neq 0, so the coefficient matrix is invertible and the system has a unique solution.
  • In fact x=52, y=72, z=3x = \tfrac52,\ y = \tfrac72,\ z = 3 (check: 52−72+3=2\tfrac52 - \tfrac72 + 3 = 2, 52+72−3=3\tfrac52 + \tfrac72 - 3 = 3, −52+72+3=4-\tfrac52 + \tfrac72 + 3 = 4).
  • Option 4 ("finitely many") is not a distinct case: a linear system has 0, 1 or infinitely many solutions. Option 3 is the one that fits.
  • Answer: option 3.
Q3A system with parameters

Multiple Select Question (MSQ): select all that apply.

Consider −x1+x2+2x3=1, 2x1+x2−2x3=−1, 3x2+cx3=d-x_1 + x_2 + 2x_3 = 1,\ 2x_1 + x_2 - 2x_3 = -1,\ 3x_2 + cx_3 = d. Choose the correct options.

1
If c=2c = 2 and d=1d = 1, the system has infinitely many solutions.
2
If c=1c = 1 and d=1d = 1, the system has infinitely many solutions.
3
If c=1c = 1 and d=2d = 2, the system has no solution.
4
If c=3c = 3 and d=2d = 2, the system has a unique solution.
Solution
Idea

Solve the first two equations for x1,x2x_1, x_2 in terms of x3x_3, then substitute into the third.

  • The first two give x1=43x3−23x_1 = \tfrac43 x_3 - \tfrac23 and x2=13−23x3x_2 = \tfrac13 - \tfrac23 x_3.
  • Substituting into the third: 3x2+cx3=1−2x3+cx3=1+(c−2)x3=d3x_2 + cx_3 = 1 - 2x_3 + cx_3 = 1 + (c - 2)x_3 = d.
  • c=2c = 2: the equation is 1=d1 = d. For d=1d = 1 it always holds, so infinitely many (option 1 true); for d≠1d \neq 1 it has no solution.
  • c≠2c \neq 2: x3=d−1c−2x_3 = \dfrac{d - 1}{c - 2}, a unique solution. So c=1,d=1c = 1, d = 1 gives x3=0x_3 = 0 (unique, option 2 false); c=1,d=2c = 1, d = 2 gives x3=−1x_3 = -1 (unique, option 3 false); c=3,d=2c = 3, d = 2 gives x3=1x_3 = 1 (unique, option 4 true).
  • Answer: options 1 and 4.
Q4Counting free variables (extra)

Numerical Answer Type (NAT).

The RREF of the augmented matrix of a system in x1,x2,x3,x4x_1, x_2, x_3, x_4 is [1020501−10200017]\left[\begin{array}{cccc|c}1&0&2&0&5\\0&1&-1&0&2\\0&0&0&1&7\end{array}\right]. How many free variables are there?

Solution
Idea

Which variable column has no leading 1?

  • Leading 1s are in columns 1, 2 and 4.
  • Column 3 has no leading 1, so x3x_3 is the only free variable: x1=5−2x3x_1 = 5 - 2x_3, x2=2+x3x_2 = 2 + x_3, x4=7x_4 = 7.
  • Answer: 1
Q5A homogeneous system (extra)

Multiple Choice Question (MCQ): choose the one correct option.

A homogeneous system has 2 equations in 3 unknowns. Which statement is true?

1
0\mathbf{0} is the only solution.
2
It has infinitely many solutions.
3
It has no solution.
4
It has exactly two solutions.
Solution
Idea

A homogeneous system always has 0\mathbf{0}, and unknowns exceed equations.

  • It is never inconsistent (x=0\mathbf{x} = \mathbf{0} works), so option 3 is false.
  • With 3 unknowns and at most 2 leading 1s, some column is free, giving infinitely many solutions.
  • A linear system never has exactly two solutions. Option 2 is true.
  • Answer: option 2.
Q6Rank of a matrix

Numerical Answer Type (NAT).

Find the rank of A=[121243364]A = \begin{bmatrix} 1 & 2 & 1 \\ 2 & 4 & 3 \\ 3 & 6 & 4 \end{bmatrix}.

Solution
Idea

Row-reduce and count the non-zero rows.

  • R2−2R1=(0,0,1)R_2 - 2R_1 = (0, 0, 1) and R3−3R1=(0,0,1)R_3 - 3R_1 = (0, 0, 1). Then R3−R2=(0,0,0)R_3 - R_2 = (0, 0, 0).
  • Echelon form: [121001000]\begin{bmatrix} 1 & 2 & 1 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix}, with 2 non-zero rows.
  • Check: det⁡A=0\det A = 0, so the rank must be less than 3 ✓. Rows 1 and 2 are not proportional, so the rank is not 1.
  • Answer: 2
Q7Number of solutions with two parameters

Multiple Select Question (MSQ): select all that apply.

Consider x+y+z=1,  x+2y+3z=4,  x+3y+kz=mx + y + z = 1,\; x + 2y + 3z = 4,\; x + 3y + kz = m. Select all correct statements.

1
For k=5k = 5 and m=7m = 7, there are infinitely many solutions.
2
For k=5k = 5 and m=8m = 8, there is no solution.
3
For k=6k = 6 and any mm, there is exactly one solution.
4
For every k≠5k \neq 5, there is no solution.
Solution
Idea

Reduce the augmented matrix and compare the rank of AA with the rank of [A∣b][A \mid \mathbf{b}].

  • Row reduction gives the last row (0  0  k−5∣m−7)(0\ \ 0\ \ k - 5 \mid m - 7) (see the parameter example in 6.9).
  • Option 1 ✓ k=5,m=7k = 5, m = 7: last row is (0 0 0∣0)(0\ 0\ 0 \mid 0). Both ranks are 2, less than 3 unknowns, so infinitely many solutions.
  • Option 2 ✓ k=5,m=8k = 5, m = 8: last row is (0 0 0∣1)(0\ 0\ 0 \mid 1), which says 0=10 = 1. The ranks are 2 and 3, so no solution.
  • Option 3 ✓ k=6k = 6: the pivot k−5=1≠0k - 5 = 1 \neq 0, so all three columns have pivots: one solution whatever mm is.
  • Option 4 ✗ For k≠5k \neq 5 the last pivot exists and the solution is unique, not absent.
  • Answer: options 1, 2 and 3.
Q8An entry of the inverse by Gauss–Jordan

Numerical Answer Type (NAT).

For A=[123014560]A = \begin{bmatrix} 1 & 2 & 3 \\ 0 & 1 & 4 \\ 5 & 6 & 0 \end{bmatrix}, find the (1,1)(1, 1) entry of A−1A^{-1}.

Solution
Idea

Reduce [A∣I][A \mid I] to [I∣A−1][I \mid A^{-1}] and read the entry. (Cross-check with a cofactor.)

  • The worked reduction in 6.9 gives A−1=[−2418520−15−4−541]A^{-1} = \begin{bmatrix} -24 & 18 & 5 \\ 20 & -15 & -4 \\ -5 & 4 & 1 \end{bmatrix}.
  • Cross-check with A−1=adj⁡(A)/det⁡AA^{-1} = \operatorname{adj}(A)/\det A: the (1,1)(1,1) entry of the adjugate is the cofactor C11=1⋅0−4⋅6=−24C_{11} = 1\cdot 0 - 4 \cdot 6 = -24, and det⁡A=1⋅(0−24)−2(0−20)+3(0−5)=−24+40−15=1\det A = 1\cdot(0 - 24) - 2(0 - 20) + 3(0 - 5) = -24 + 40 - 15 = 1. So the entry is −24/1=−24-24/1 = -24 ✓.
  • Answer: -24
Q9Determinant of an expression with inverses

Numerical Answer Type (NAT).

AA and BB are invertible 3×33 \times 3 matrices with det⁡A=2\det A = 2 and det⁡B=4\det B = 4. Find det⁡((AB)−1A2)\det\big((AB)^{-1}A^2\big).

Solution
Idea

det⁡\det of an inverse is the reciprocal, and det⁡\det of a product is the product of the det⁡\dets. The order inside (AB)−1(AB)^{-1} does not matter for the determinant.

  • det⁡(AB)=2⋅4=8\det(AB) = 2 \cdot 4 = 8, so det⁡((AB)−1)=18\det\big((AB)^{-1}\big) = \dfrac18.
  • det⁡(A2)=22=4\det(A^2) = 2^2 = 4.
  • det⁡((AB)−1A2)=18⋅4=12=0.5\det\big((AB)^{-1}A^2\big) = \dfrac18 \cdot 4 = \dfrac12 = 0.5.
  • Answer: 0.5
Q10Rules of the inverse

Multiple Select Question (MSQ): select all that apply.

AA and BB are invertible n×nn \times n matrices. Choose the correct statements.

1
(AB)−1=A−1B−1(AB)^{-1} = A^{-1}B^{-1} always.
2
(AB)−1=B−1A−1(AB)^{-1} = B^{-1}A^{-1}.
3
(AT)−1=(A−1)T(A^T)^{-1} = (A^{-1})^T.
4
(A+B)−1=A−1+B−1(A + B)^{-1} = A^{-1} + B^{-1}.
5
(2A)−1=12A−1(2A)^{-1} = \tfrac12 A^{-1}.
6
If CA=CBCA = CB for some matrix CC, then A=BA = B.
Solution
Idea

Test each rule by multiplying the proposed inverse by the matrix and asking whether the result is II.

  • Option 1 ✗ (AB)(A−1B−1)=ABA−1B−1(AB)(A^{-1}B^{-1}) = ABA^{-1}B^{-1}, which is generally not II because AA and BB do not commute.
  • Option 2 ✓ (AB)(B−1A−1)=A(BB−1)A−1=I(AB)(B^{-1}A^{-1}) = A(BB^{-1})A^{-1} = I.
  • Option 3 ✓ AT(A−1)T=(A−1A)T=IA^T(A^{-1})^T = (A^{-1}A)^T = I.
  • Option 4 ✗ For A=B=IA = B = I: (2I)−1=12I(2I)^{-1} = \tfrac12 I, but I−1+I−1=2II^{-1} + I^{-1} = 2I.
  • Option 5 ✓ (2A)(12A−1)=I(2A)\left(\tfrac12 A^{-1}\right) = I.
  • Option 6 ✗ Cancelling needs CC to be invertible. With C=[1111]C = \begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix}, A=IA = I, B=[0110]B = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}: CA=CBCA = CB but A≠BA \neq B.
  • Answer: options 2, 3 and 5.
Q11Which side does A−1A^{-1} go on?

Multiple Choice Question (MCQ): choose the one correct option.

AA is an invertible n×nn \times n matrix and XX, BB are n×nn \times n matrices with XA=BXA = B. Then XX equals

1
A−1BA^{-1}B
2
BA−1BA^{-1}
3
AB−1AB^{-1}
4
B−1AB^{-1}A
Solution
Idea

AA sits on the right of XX, so multiply both sides by A−1A^{-1} on the right to cancel it.

  • XA=B⇒XAA−1=BA−1⇒X=BA−1XA = B \Rightarrow XAA^{-1} = BA^{-1} \Rightarrow X = BA^{-1}.
  • Option 1 would be the answer to AX=BAX = B, not XA=BXA = B. Options 3 and 4 invert BB, which need not be invertible.
  • Numeric check: A=[1235]A = \begin{bmatrix} 1 & 2 \\ 3 & 5 \end{bmatrix}, X=[1021]X = \begin{bmatrix} 1 & 0 \\ 2 & 1 \end{bmatrix} give B=XA=[1259]B = XA = \begin{bmatrix} 1 & 2 \\ 5 & 9 \end{bmatrix}, and BA−1BA^{-1} returns XX ✓.
  • Answer: option 2.
Q12When does a homogeneous system have a non-trivial solution?

Numerical Answer Type (NAT).

For which value of kk does x+y+z=0,  x+2y+3z=0,  x+3y+kz=0x + y + z = 0,\; x + 2y + 3z = 0,\; x + 3y + kz = 0 have a non-trivial solution?

Solution
Idea

A square homogeneous system has a non-trivial solution exactly when the coefficient determinant is 00.

  • det⁡[11112313k]=1(2k−9)−1(k−3)+1(3−2)=2k−9−k+3+1=k−5\det\begin{bmatrix} 1 & 1 & 1 \\ 1 & 2 & 3 \\ 1 & 3 & k \end{bmatrix} = 1(2k - 9) - 1(k - 3) + 1(3 - 2) = 2k - 9 - k + 3 + 1 = k - 5.
  • k−5=0⇒k=5k - 5 = 0 \Rightarrow k = 5.
  • Check: at k=5k = 5, R3=2R2−R1R_3 = 2R_2 - R_1, so the rows are dependent and the rank is 2, with 3−2=13 - 2 = 1 free variable.
  • Answer: 5
Q13A system with more unknowns than equations

Multiple Choice Question (MCQ): choose the one correct option.

AA is a 3×43 \times 4 matrix with rank⁡(A)=3\operatorname{rank}(A) = 3. Which is true about Ax=bA\mathbf{x} = \mathbf{b}?

1
For some b\mathbf{b} there is no solution.
2
For every b\mathbf{b} there is exactly one solution.
3
For every b\mathbf{b} there are infinitely many solutions.
4
There are infinitely many solutions only when b=0\mathbf{b} = \mathbf{0}.
Solution
Idea

Compare ranks: [A∣b][A \mid \mathbf{b}] also has 3 rows, so its rank cannot exceed 3.

  • rank⁡[A∣b]≤3=rank⁡(A)\operatorname{rank}[A \mid \mathbf{b}] \le 3 = \operatorname{rank}(A), and it is at least rank⁡(A)\operatorname{rank}(A), so the two ranks are equal: the system is consistent for every b\mathbf{b}. That rules out option 1.
  • The number of free variables is n−r=4−3=1>0n - r = 4 - 3 = 1 > 0, so each solvable system has infinitely many solutions. That rules out option 2 and option 4.
  • Answer: option 3.
Q14Counting free variables from the rank

Numerical Answer Type (NAT).

A homogeneous system Ax=0A\mathbf{x} = \mathbf{0} has a 4×64 \times 6 coefficient matrix of rank 3. How many free variables does its general solution have?

Solution
Idea

Free variables = unknowns −- rank.

  • The number of unknowns is the number of columns, n=6n = 6 (not the number of rows).
  • Free variables =6−3=3= 6 - 3 = 3. Pivot columns give the 3 dependent variables, and the other 3 columns are free.
  • Answer: 3
Revision overview
SystemsAx = 0: homogeneous
Ax = b: non-homogeneous
Augmented[A | b]
b glued as last column
Reduce[A | b] → [R | c]
R is the RREF of A
Gauss eliminationWeek 2 · Part 6
SolveRx = c
Free column: parameter
OutcomesUnique, infinitely many,
or none (0 = 1 row)
Works forAny shape, any rank
Revision: solving any linear system with row reduction
Next · All partsWeek 2 Summary Sheet
07
All parts

Week 2 Summary Sheet

One page to revise all of Week 2: the methods, their conditions, the row operations and the three possible outcomes.

The big picture

Part 1 · Linear systems
  • Ax=bA\mathbf{x} = \mathbf{b}, with AA of order m×nm \times n.
  • det⁡(A)≠0  ⟺  A\det(A) \neq 0 \iff A invertible.
Part 2 · Cramer's Rule
  • xi=det⁡(Axi)/det⁡(A)x_i = \det(A_{x_i}) / \det(A).
  • Needs a square, invertible A.
Part 3 · Inverse method
  • x=A−1b\mathbf{x} = A^{-1}\mathbf{b}, A−1=adj⁡(A)/det⁡(A)A^{-1} = \operatorname{adj}(A)/\det(A).
  • Same conditions as Cramer.
Part 4 · Echelon forms
  • REF: leading 1s step right, zero rows at the bottom.
  • RREF: each leading 1 alone in its column.
Part 5 · Row reduction
  • Three row operations; five-step algorithm.
  • Swap: det⁡\det flips; scale: det⁡×c\det \times c; add: unchanged.
Part 6 · Gauss elimination
  • [A∣b]→[R∣c][A \mid \mathbf{b}] \to [R \mid \mathbf{c}], then solve Rx=cR\mathbf{x} = \mathbf{c}.
  • Unique, infinitely many, or none.

Revision sheet

TopicKey idea
Linear equationa1x1+⋯+anxn=ba_1 x_1 + \cdots + a_n x_n = b: every variable to the power 1
Invertible / non-singulardet⁡(A)≠0\det(A) \neq 0
Cramer's Rulexi=det⁡(Axi)/det⁡(A)x_i = \det(A_{x_i}) / \det(A); needs a square, invertible AA
Inverse-matrix methodx=A−1b\mathbf{x} = A^{-1}\mathbf{b}; needs a square, invertible AA
Row echelon formleading 1s step right going down; zero rows at the bottom
Reduced row echelon formREF, and each leading 1 is the only non-zero entry in its column
Type 1 row operationswap two rows →\to det⁡\det flips sign
Type 2 row operationscale a row by cc →\to det⁡\det scales by cc
Type 3 row operationadd a multiple of one row to another →\to det⁡\det unchanged
Augmented matrix[A∣b][A \mid \mathbf{b}]: glue b\mathbf{b} on as the last column
Gauss eliminationrow-reduce [A∣b][A \mid \mathbf{b}] to [R∣c][R \mid \mathbf{c}], then solve Rx=cR\mathbf{x} = \mathbf{c}
Free variablea variable with no leading 1 in its column; set it to a parameter

Which method when?

Is A square with det(A) ≠ 0?yesnoCramer or inverseunique solution,n × n square systemGauss eliminationany shape, any rank:one, many or none
Figure 11. Choosing between Cramer / inverse and Gauss elimination
SituationUse
square AA, det⁡(A)≠0\det(A) \neq 0, one answer wantedCramer's Rule or A−1bA^{-1}\mathbf{b}
det⁡(A)=0\det(A) = 0, or AA not squareGauss elimination
decide unique / infinitely many / noneGauss elimination (look at the RREF)
is a matrix in REF / RREF?check the four conditions in order

Common mistakes

Calling a non-linear equation linear
  • Squares and products of variables make it non-linear.
Using Cramer on a singular system
  • If det⁡(A)=0\det(A) = 0 or AA is not square, use Gauss elimination.
Wrong product order
  • It is A−1bA^{-1}\mathbf{b}, not bA−1\mathbf{b}A^{-1}.
REF vs RREF
  • A REF may still have non-zero entries above a leading 1.
Scaling does not keep det
  • Only Type 3 (and no other) leaves det⁡\det unchanged.
Missing the 0 = 1 row
  • A row (0 ⋯ 0∣1)(0\ \cdots\ 0 \mid 1) means no solution.
Back to top