Lab 2.1
Gaussian Elimination
Lab goal
Explain why the rows of b must follow the rows of A, then read the solution from three simple triangular solves.
- Gaussian elimination
- Pivoted LU
- LDU
- Ax = b
Code extensionThe full notebook repeats this flow on a seeded 10×10 system and writes out forward and backward substitution.
Key ideas
Terms you will use
- Row permutation
Q A = L U_raw; rhs = Q b Pivoting reorders the equations, so the same row order must be applied to b.
- Diagonal scaling
U_raw = D U_unit The pivots of U_raw become a diagonal matrix; the remaining upper factor has ones on its diagonal.
- Triangular solve
L y = Qb → D z = y → U_unit x = z Solve from left to right through L, D, and U_unit instead of forming an inverse.
Lab 2.1 · Guided example
Solve a 3×3 system through LDU
This is a smaller teaching example, not a copy of every notebook cell. It keeps the same factor-and-solve idea with values that fit on one screen.
Select a line to see its action, array shape, and concrete operation.
A[0,0] is zero, so another row must supply the first pivot.
Start with one question
Find the vector x that makes A @ x equal b.
Reveal to compare.
A.shapenot stored → ?Three equations.bnot stored → ?Three target values.