Chapter 2 · Computation
Matrices and Gaussian Elimination
One question
When, and how, can we solve ?
Before the code
Four ideas to keep in view
Each active line shows its action, array shape, and mathematical change.
- 01System
Rows are equations; columns are the directions combined by x.
- 02Product
Matrix multiplication repeats one matrix–vector product by columns.
- 03Elimination
Choose m so one target entry becomes exactly zero.
- 04Factorization
A row order and all elimination multipliers can be stored and reused.
Lecture bridge
See the zeros before writing the loop
One small system shows the pivot-and-cancel pattern used in the labs.
02210
44012
23214
- 01
R₁ ↔ R₂move 4 into the pivot - 02
R₃ ← R₃ − 0.5R₁2 → 0 - 03
R₃ ← R₃ − 0.5R₂1 → 0
44012
02210
0013
Back-substitution
Practice sequence
Choose a lab
- 2.1Gaussian EliminationSolve one small 3×3 system by following the notebook’s LU → LDU → triangular-solve idea.
row order → LDU → solveOpen lab - 2.2Block Matrices and GraphsBuild one small block matrix, multiply it blockwise, and count two-step graph walks.
join blocks → multiply → count walksOpen lab - 2.3Testing LU DecompositionBuild one deterministic rank-2 matrix, read SciPy’s LU factors, and verify the result.
low rank → LU → checkOpen lab - 2.4Gaussian Elimination in DetailOpen the LU black box with one row swap and two visible cancellations.
choose pivot → swap → cancelOpen lab