Systems of linear equations · Lecture 11

Linear Systems, Cramer's Rule and the Inverse

Writing many equations as Ax=bA\mathbf{x} = \mathbf{b}, solving them with the two formulas from school, measuring vectors and matrices with norms, and discovering why the formulas break down for real problems.

Md Mahbub E Noor · Assistant Professor
CSE-3107 Numerical Methods · B.Sc. 3rd Year 1st Semester
Department of CSE, University of Barishal

Why this lecture

The problem: currents in a circuit

Kirchhoff's voltage law around each loop of a three-loop circuit gives three equations for the loop currents I1,I2,I3I_1, I_2, I_3 (amperes).

  • Every loop equation is linear in the currents: resistances times currents add up to the source voltage
  • Three loops: three equations. A phone charger board: dozens. A chip: millions
  • School gives two formulas: Cramer's rule and x=A−1b\mathbf{x} = A^{-1}\mathbf{b}
  • Today: use them, count their cost, and see where they fail. A 25-loop circuit by Cramer's rule would take longer than the age of the universe
Loop equations (volts)7I1−2I2−3I3=12−2I1+9I2−3I3=2−3I2+6I3=3\begin{aligned} 7I_1 - 2I_2 \phantom{{}-3I_3} &= 12 \\ -2I_1 + 9I_2 - 3I_3 &= 2 \\ -3I_2 + 6I_3 &= 3 \end{aligned}
The question

Find I1,I2,I3I_1, I_2, I_3. Then ask: how would the same method cope with 25 loops, or 25 000?

Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
2 / 25

Today's goals

  • Write a system of linear equations as Ax=bA\mathbf{x} = \mathbf{b} and recognise the three possible outcomes
  • Solve a system by Cramer's rule and by the inverse (adjugate) method
  • Count the operations each method needs and explain why both fail for large nn
  • Compute vector and matrix norms and the condition number κ(A)\kappa(A)
  • Predict how many digits of a computed solution can be trusted
Last time

Module 2: Newton for systems needs a linear solve JΔ=−FJ\Delta = -F at every step.


Today

Linear systems on their own: the school formulas, their cost, and how sensitive the answer is.

Systems of linear equations · you are hereBuilds on: L5
Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
3 / 25
Start here

The idea in one picture

one crossingexactly one solutionparallelno solutionsame lineinfinitely manydet A ≠ 0det A = 0det A = 0
Each linear equation in x and y is a straight line. Solving = finding the crossing.Parallel lines never meet: the equations contradict each other.The same line twice: every point on it is a solution.One number, the determinant, tells the cases apart.
In plain words
  • Each linear equation is a line (or a plane); solving means finding the common point
  • Usually there is exactly one, but sometimes none or infinitely many
  • School formulas work for 2 or 3 unknowns, and become hopeless for many
New words today
system Ax = b
all equations written with one matrix A
determinant
one number that is zero exactly when there is no unique solution
inverse A⁻¹
the matrix that undoes A
norm
a single number for the size of a vector or matrix
Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
4 / 25

Many equations, one matrix equation

The circuit in matrix form(7−20−29−30−36)⏟A(I1I2I3)⏟x=(1223)⏟b\underbrace{\begin{pmatrix} 7 & -2 & 0 \\ -2 & 9 & -3 \\ 0 & -3 & 6 \end{pmatrix}}_{A}\underbrace{\begin{pmatrix} I_1 \\ I_2 \\ I_3 \end{pmatrix}}_{\mathbf{x}} = \underbrace{\begin{pmatrix} 12 \\ 2 \\ 3 \end{pmatrix}}_{\mathbf{b}}
Augmented matrix: all the data in one table[A∣b]=(7−2012−29−320−363)[A \mid \mathbf{b}] = \left(\begin{array}{ccc|c} 7 & -2 & 0 & 12 \\ -2 & 9 & -3 & 2 \\ 0 & -3 & 6 & 3 \end{array}\right)
  • aija_{ij} = coefficient of unknown jj in equation ii
  • Unique solution exactly when det⁡A≠0\det A \ne 0 (A is nonsingular)
  • det⁡A=0\det A = 0: either no solution (parallel lines) or infinitely many (the same line twice)
  • Geometry for 2 unknowns: two lines that cross once, never, or everywhere
Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
5 / 25

Cramer's rule

2×2: eliminate y, then x (school algebra)x=b1a22−a12b2a11a22−a12a21=∣b1a12b2a22∣∣a11a12a21a22∣x = \frac{b_1 a_{22} - a_{12} b_2}{a_{11}a_{22} - a_{12}a_{21}} = \frac{\begin{vmatrix} b_1 & a_{12} \\ b_2 & a_{22}\end{vmatrix}}{\begin{vmatrix} a_{11} & a_{12} \\ a_{21} & a_{22}\end{vmatrix}}
General rule: Aᵢ is A with column i replaced by bxi=DiD,D=det⁡A,Di=det⁡Aix_i = \frac{D_i}{D}, \qquad D = \det A, \qquad D_i = \det A_i
3×3 determinant by cofactor expansion along row 1det⁡A=a11∣a22a23a32a33∣−a12∣a21a23a31a33∣+a13∣a21a22a31a32∣\det A = a_{11}\begin{vmatrix} a_{22} & a_{23} \\ a_{32} & a_{33}\end{vmatrix} - a_{12}\begin{vmatrix} a_{21} & a_{23} \\ a_{31} & a_{33}\end{vmatrix} + a_{13}\begin{vmatrix} a_{21} & a_{22} \\ a_{31} & a_{32}\end{vmatrix}
  • A closed formula: no iteration, no stopping rule
  • Needs D≠0D \ne 0
  • nn unknowns: n+1n + 1 determinants of size n×nn \times n
  • Each n×nn\times n determinant by cofactors needs nn determinants of size n−1n - 1: the work multiplies by nn at every level
Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
6 / 25
The method, step by step

Cramer's rule, step by step

  1. Write the system as [A∣b][A \mid \mathbf{b}]
  2. Compute D=det⁡AD = \det A. If D=0D = 0, stop: no unique solution
  3. For each i=1,…,ni = 1, \dots, n: copy AA, replace column ii by b\mathbf{b}, compute its determinant DiD_i
  4. Set xi=Di/Dx_i = D_i / D
  5. Check: substitute x\mathbf{x} into every equation

The recursion in det is where all the work goes: one call of size nn makes nn calls of size n−1n - 1.

Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
7 / 25

Problem 1: the circuit by Cramer's rule

Solve 7I1−2I2=127I_1 - 2I_2 = 12,   −2I1+9I2−3I3=2\;-2I_1 + 9I_2 - 3I_3 = 2,   −3I2+6I3=3\;-3I_2 + 6I_3 = 3.
1
D=7(9⋅6−(−3)(−3))−(−2)((−2)⋅6−0)+0=7(45)−24=291≠0D = 7(9\cdot 6 - (-3)(-3)) - (-2)((-2)\cdot 6 - 0) + 0 = 7(45) - 24 = 291 \ne 0
2
D1=∣12−2029−33−36∣=12(45)+2(12+9)=582D_1 = \begin{vmatrix} 12 & -2 & 0 \\ 2 & 9 & -3 \\ 3 & -3 & 6\end{vmatrix} = 12(45) + 2(12 + 9) = 582
3
In the same way (columns 2 and 3 replaced): D2=7(12+9)−12(−12)=291D_2 = 7(12 + 9) - 12(-12) = 291 and D3=291D_3 = 291
4
I1=582/291=2I_1 = 582/291 = 2,   I2=291/291=1\;I_2 = 291/291 = 1,   I3=291/291=1\;I_3 = 291/291 = 1. Check eq. 2: −4+9−3=2-4 + 9 - 3 = 2 ✓
I1=2I_1 = 2 A, I2=1I_2 = 1 A, I3=1I_3 = 1 A, using four 3×3 determinants.
Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
8 / 25

The inverse method: x=A−1b\mathbf{x} = A^{-1}\mathbf{b}

If A⁻¹ existsAx=b  ⟹  A−1Ax=A−1b  ⟹  x=A−1bA\mathbf{x} = \mathbf{b} \;\Longrightarrow\; A^{-1}A\mathbf{x} = A^{-1}\mathbf{b} \;\Longrightarrow\; \mathbf{x} = A^{-1}\mathbf{b}
Adjugate formulaA−1=1det⁡A adj⁡A,adj⁡A=CTA^{-1} = \frac{1}{\det A}\,\operatorname{adj} A, \qquad \operatorname{adj}A = C^{T}
2×2: swap the diagonal, negate the rest(abcd)−1=1ad−bc(d−b−ca)\begin{pmatrix} a & b \\ c & d \end{pmatrix}^{-1} = \frac{1}{ad - bc}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}
  • MijM_{ij} (minor) = determinant of AA without row ii and column jj
  • CijC_{ij} (cofactor) = minor with the sign pattern +−+−+−+−+\begin{smallmatrix} + & - & + \\ - & + & - \\ + & - & + \end{smallmatrix}
  • Exists only when det⁡A≠0\det A \ne 0
  • Once A−1A^{-1} is known, any new b\mathbf{b} costs only a matrix–vector product
Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
9 / 25
The method, step by step

The inverse method, step by step

  1. Compute D=det⁡AD = \det A; if D=0D = 0, stop
  2. Compute all n2n^2 cofactors Cij=(−1)i+jMijC_{ij} = (-1)^{i+j}M_{ij}
  3. Transpose: adj⁡A=CT\operatorname{adj}A = C^{T}
  4. Divide: A−1=adj⁡A/DA^{-1} = \operatorname{adj}A / D; check AA−1=IAA^{-1} = I
  5. Multiply: x=A−1b\mathbf{x} = A^{-1}\mathbf{b}

n2n^2 cofactors, each a determinant of size n−1n - 1: even more work than Cramer for one right-hand side.

Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
10 / 25

Problem 2: the circuit by the inverse

Find A−1A^{-1} for the circuit matrix and use it to find the currents.
1
Cofactors: C11=45C_{11} = 45, C12=−∣−2−306∣=12C_{12} = -\begin{vmatrix} -2 & -3 \\ 0 & 6\end{vmatrix} = 12, C13=6C_{13} = 6, C22=42C_{22} = 42, C23=21C_{23} = 21, C33=59C_{33} = 59, and Cji=CijC_{ji} = C_{ij} here
2
A−1=1291(4512612422162159)A^{-1} = \dfrac{1}{291}\begin{pmatrix} 45 & 12 & 6 \\ 12 & 42 & 21 \\ 6 & 21 & 59\end{pmatrix} (symmetric, because AA is)
3
x=A−1b=1291(45(12)+12(2)+6(3)12(12)+42(2)+21(3)6(12)+21(2)+59(3))=1291(582291291)\mathbf{x} = A^{-1}\mathbf{b} = \dfrac{1}{291}\begin{pmatrix} 45(12) + 12(2) + 6(3) \\ 12(12) + 42(2) + 21(3) \\ 6(12) + 21(2) + 59(3)\end{pmatrix} = \dfrac{1}{291}\begin{pmatrix} 582 \\ 291 \\ 291\end{pmatrix}
x=(2,1,1)\mathbf{x} = (2, 1, 1), as before. Nine 2×2 cofactors plus one 3×3 determinant.
Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
11 / 25

Limitation 1: the cost explodes

  • Cofactor determinants: one n×nn\times n determinant costs about e⋅n!e \cdot n! operations
  • Cramer: n+1n + 1 of them. n=3n = 3: 59 operations; n=10n = 10: 1.1×1081.1\times10^8 (0.1 s)
  • n=20n = 20: 1.4×10201.4 \times 10^{20} operations, 4400 years; elimination (Lecture 12): 5910 operations, 6 µs
  • n=25n = 25: 3.5×10103.5\times10^{10} years, more than the age of the universe
Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
12 / 25
Limitations shown failing

Limitations 2 and 3: determinants and inverses in floating point

Underflow

det⁡(0.1 I400)=10−400\det(0.1\,I_{400}) = 10^{-400}

Below the smallest double (4.9×10−3244.9\times10^{-324}, Lecture 2), so the computer stores 0 and Cramer reports "singular". Yet the system is trivial: x=10 b\mathbf{x} = 10\,\mathbf{b}.

Overflow

det⁡(10 I400)=10400\det(10\,I_{400}) = 10^{400}

Overflows to infinity, and every xi=Di/Dx_i = D_i/D becomes ∞/∞\infty/\infty = NaN. The size of the determinant says nothing useful about the system.

Waste

A−1A^{-1} then A−1bA^{-1}\mathbf{b}

Even with a good method for the inverse, it costs about 2n32n^3 operations, three times elimination, and adds extra rounding errors. Numerical analysts rarely form A−1A^{-1}.

A small determinant does not mean trouble, and a large one does not mean safety. What does measure trouble? The condition number, next.

Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
13 / 25

Measuring size: vector and matrix norms

Vector norms∥v∥1=∑i∣vi∣,∥v∥2=∑ivi2,∥v∥∞=max⁡i∣vi∣\|\mathbf{v}\|_1 = \sum_i |v_i|, \quad \|\mathbf{v}\|_2 = \sqrt{\textstyle\sum_i v_i^2}, \quad \|\mathbf{v}\|_\infty = \max_i |v_i|
Matrix norms: largest column sum, largest row sum∥A∥1=max⁡j∑i∣aij∣,∥A∥∞=max⁡i∑j∣aij∣\|A\|_1 = \max_j \sum_i |a_{ij}|, \qquad \|A\|_\infty = \max_i \sum_j |a_{ij}|
Key property∥Ax∥≤∥A∥ ∥x∥\|A\mathbf{x}\| \le \|A\|\,\|\mathbf{x}\|
  • v=(3,−4,1)\mathbf{v} = (3, -4, 1): ∥v∥1=8\|\mathbf{v}\|_1 = 8, ∥v∥2=26=5.099\|\mathbf{v}\|_2 = \sqrt{26} = 5.099, ∥v∥∞=4\|\mathbf{v}\|_\infty = 4
  • Circuit AA: row sums 9, 14, 9, so ∥A∥∞=14\|A\|_\infty = 14; column sums give ∥A∥1=14\|A\|_1 = 14 too
  • A norm is a single number for "how big": used for errors, stopping rules and convergence
  • Same idea as ∣x∣|x| for numbers (Lecture 4), extended to vectors and matrices
Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
14 / 25

The condition number of a matrix

Definitionκ(A)=∥A∥ ∥A−1∥  ≥  1\kappa(A) = \|A\|\,\|A^{-1}\| \;\ge\; 1
Error bound: relative error in b is amplified by at most κ∥δx∥∥x∥  ≤  κ(A) ∥δb∥∥b∥\frac{\|\delta\mathbf{x}\|}{\|\mathbf{x}\|} \;\le\; \kappa(A)\,\frac{\|\delta\mathbf{b}\|}{\|\mathbf{b}\|}
  • Same idea as κf\kappa_f in Lecture 5, now for systems
  • Rule of thumb: about log⁡10κ\log_{10}\kappa significant digits are lost
  • Circuit: ∥A−1∥∞=86/291=0.2955\|A^{-1}\|_\infty = 86/291 = 0.2955, so κ∞=14×0.2955=4.14\kappa_\infty = 14 \times 0.2955 = 4.14: well-conditioned
  • κ(cA)=κ(A)\kappa(cA) = \kappa(A) for any c≠0c \ne 0: unlike the determinant, it is not fooled by scaling
Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
15 / 25

Problem 3: an ill-conditioned system

Find κ∞(A)\kappa_\infty(A) for A=(1111.0001)A = \begin{pmatrix} 1 & 1 \\ 1 & 1.0001\end{pmatrix}. Solve with b=(2,2.0001)\mathbf{b} = (2, 2.0001), then with b2=2.0002b_2 = 2.0002.
1
det⁡A=0.0001\det A = 0.0001,   A−1=10.0001(1.0001−1−11)=(10001−10000−1000010000)\;A^{-1} = \dfrac{1}{0.0001}\begin{pmatrix} 1.0001 & -1 \\ -1 & 1 \end{pmatrix} = \begin{pmatrix} 10001 & -10000 \\ -10000 & 10000\end{pmatrix}
2
∥A∥∞=2.0001\|A\|_\infty = 2.0001,   ∥A−1∥∞=20001\;\|A^{-1}\|_\infty = 20001,   κ∞=40004\;\kappa_\infty = 40004: about 4–5 digits can be lost
3
b=(2,2.0001)\mathbf{b} = (2, 2.0001) gives x=(1,1)\mathbf{x} = (1, 1);   b2=2.0002\;b_2 = 2.0002 gives x=(0,2)\mathbf{x} = (0, 2)
4
Input changed by 5×10−55\times10^{-5}, answer by 100%: amplified 20000 times (bound: 40004)
Nearly parallel lines: a tiny change in the data moves the crossing point a long way.
Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
16 / 25
Classical vs numerical

Same circuit, two approaches

Formula

Classical (Cramer's rule)

  • Four 3×3 determinants: 291, 582, 291, 291
  • 59 operations, exact fractions by hand
  • x=(2,1,1)\mathbf{x} = (2, 1, 1)
vs
Algorithm

Numerical (Gaussian elimination, Lecture 12)

  • Eliminate I1I_1, then I2I_2, then back-substitute
  • 28 operations
  • x=(2,1,1)\mathbf{x} = (2, 1, 1)
When the classical approach cannot work

A circuit with 25 loops

Cramer's rule: 1.1×10271.1\times10^{27} operations, 3.5×10103.5\times10^{10} years at 10910^9 operations per second. Elimination: 11 325 operations, about 11 µs. Real circuit simulators (SPICE) solve systems with thousands of unknowns many times per second.

Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
17 / 25

Cramer, the inverse and κ in Python and C

  • det3 is cofactor expansion along row 1
  • Cramer: replace column ii by b\mathbf{b}, divide by DD
  • Inverse from cofactors (note the transpose: inv[j][i])
  • Then κ∞=∥A∥∞∥A−1∥∞\kappa_\infty = \|A\|_\infty\|A^{-1}\|_\infty
Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
18 / 25
Practice

Practice problem

Problem 4"Solve by Cramer's rule: x+y+z=6x + y + z = 6,   2x−y+z=3\;2x - y + z = 3,   x+2y−z=2\;x + 2y - z = 2. Explain why Cramer's rule is not used for large systems."
How to write a complete answer
  • Write [A∣b][A \mid \mathbf{b}]; compute DD and state D=7≠0D = 7 \ne 0 before anything else
  • Show each DiD_i with the replaced column: D1=7D_1 = 7, D2=14D_2 = 14, D3=21D_3 = 21
  • Answer x=1x = 1, y=2y = 2, z=3z = 3, and substitute back as a check
  • Cost: n+1n + 1 determinants, each about e⋅n!e\cdot n! operations by cofactors; give a number (e.g. n=20n = 20: 4400 years) and name the alternative (Gaussian elimination, ≈2n3/3\approx 2n^3/3)
Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
19 / 25
When to use it

Cramer's rule and the adjugate inverse: method profile

Best case
  • 2×2 and 3×3 systems by hand, with exact fractions
  • When a formula is needed, e.g. the slope of a regression line
  • Theory: shows the solution depends continuously on the data when det⁡A≠0\det A \ne 0
Worst case
  • n≥10n \ge 10: cost grows like n!n!
  • Very large or very small determinants: overflow, underflow
  • Nearly singular AA: huge A−1A^{-1}, digits lost
Best suited for
  • Hand calculation and small symbolic systems
  • Closed-form formulas: regression coefficients, 2×2 Newton steps (Lecture 10), small graphics transforms
  • Teaching what a solution means
Avoid when
  • Any program with n>3n > 3
  • Several right-hand sides (use LU, Lecture 13)
  • Ill-conditioned problems: these methods add rounding of their own

Rule of thumb: formulas for 2×2 and 3×3 on paper; elimination for everything a computer solves.

Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
20 / 25

Comparative analysis: methods for Ax=bA\mathbf{x} = \mathbf{b}

MethodOperations (about)n=3n = 3n=1000n = 1000New b\mathbf{b} costsBest for
Cramer (cofactors)e (n+1)!e\,(n+1)!59impossibleeverything again2×2, 3×3 by hand
Adjugate inversee n2(n−1)!e\,n^2 (n-1)!≈ 65impossible2n22n^2tiny matrices, formulas
Gaussian elimination23n3\tfrac23 n^3280.67 s23n3\tfrac23 n^3one system (L12)
LU factorisation23n3\tfrac23 n^3 once280.67 s2n22n^2many right-hand sides (L13)
Jacobi, Gauss–Seidelper sweep ≈2⋅\approx 2\cdotnonzeros—fast if sparseiterate againhuge sparse systems (L14)

Times assume 10910^9 operations per second. "Impossible" means more than 10250010^{2500} years.

Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
21 / 25
Roadmap

Limitations, and where we fix them

The formulas are exact but hopelessly slow, and blind to floating point. Each limitation has a fix:

What it does well (keep this)
  • Matrix form Ax=bA\mathbf{x} = \mathbf{b} and the augmented matrix
  • Existence: unique solution iff det⁡A≠0\det A \ne 0
  • Norms and the condition number κ(A)\kappa(A)
  • Closed formulas for 2×2 and 3×3
LimitationHow it is overcomeWhere
Cost grows like n!n!
→
Elimination: 23n3\tfrac23 n^3 operations, with pivoting for safety
Lecture 12 →
Many right-hand sides, same AA
→
Factor once (A=LUA = LU), then 2n22n^2 per b\mathbf{b}
Lecture 13 →
Millions of unknowns, mostly zeros
→
Iterative methods that never store the full matrix
Lecture 14 →
Ill-conditioned AA (large κ\kappa)
→
Cannot be cured by any solver; reformulate (e.g. least squares)
Lecture 23 →
Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
22 / 25
Applications

Where this method runs in the real world

Click a card: each one solves a small linear system, or inverts a matrix, at a specific step.

Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
23 / 25

Checkpoint

Checkpoint · think, then discuss with your neighbourCramer's rule for 2x+3y=82x + 3y = 8,   4x−y=2\;4x - y = 2. What is DyD_y?
A−28-28
B2828
C−14-14
D22
A. D=(2)(−1)−(3)(4)=−14D = (2)(-1) - (3)(4) = -14. Dy=∣2842∣=4−32=−28D_y = \begin{vmatrix} 2 & 8 \\ 4 & 2\end{vmatrix} = 4 - 32 = -28, so y=2y = 2; Dx=−8−6=−14D_x = -8 - 6 = -14, so x=1x = 1.
Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
24 / 25

Summary

Key points
  • Ax=bA\mathbf{x} = \mathbf{b} has a unique solution exactly when det⁡A≠0\det A \ne 0
  • Cramer: xi=Di/Dx_i = D_i/D; inverse: A−1=adj⁡A/det⁡AA^{-1} = \operatorname{adj}A/\det A; both fine for 2×2 and 3×3
  • Cofactor determinants cost about e⋅n!e\cdot n!: hopeless beyond n≈12n \approx 12
  • Norms measure size; κ(A)=∥A∥∥A−1∥\kappa(A) = \|A\|\|A^{-1}\| measures sensitivity; about log⁡10κ\log_{10}\kappa digits are lost
Opening problem: solved

Cramer: D=291D = 291, D1=582D_1 = 582, D2=D3=291D_2 = D_3 = 291, so I=(2,1,1)I = (2, 1, 1) A. The inverse gives the same. For 25 loops, Cramer would need 3.5×10103.5\times10^{10} years: we need elimination.

Homework
  1. Solve 2x+y+z=72x + y + z = 7,   x−y+2z=5\;x - y + 2z = 5,   3x+2y−z=4\;3x + 2y - z = 4 by Cramer's rule.
  2. Find the inverses of (2153)\begin{pmatrix} 2 & 1 \\ 5 & 3\end{pmatrix} and (1022−13418)\begin{pmatrix} 1 & 0 & 2 \\ 2 & -1 & 3 \\ 4 & 1 & 8\end{pmatrix}.
  3. For A=(4123)A = \begin{pmatrix} 4 & 1 \\ 2 & 3\end{pmatrix} find ∥A∥1\|A\|_1, ∥A∥∞\|A\|_\infty, A−1A^{-1} and κ∞(A)\kappa_\infty(A).
  4. With the cost explorer (or the lab program), find the smallest nn for which Cramer's rule takes more than one hour.
Next lecture

Gaussian and Gauss–Jordan elimination. The systematic version of school elimination: 23n3\tfrac23 n^3 operations, and pivoting to protect against rounding.

Md Mahbub E Noor
Lecture 11: Cramer's Rule and the Inverse
University of Barishal
25 / 25