LINEAR-ALGEBRA · Unit 4 · Video 3 · Interactive Practice
| Formula | Name | Description |
|---|---|---|
| Sum of squares | Exact formula for the total elimination cost | |
| Gaussian elimination cost | Approximate flop count for forward elimination | |
| Triangular solve cost | Forward sub () + back sub () | |
| LU with right-hand sides | Factor once, solve times |
The per-step costs stack into the area under , so the total is about .
Each elimination step works only on the shrinking active block, so its cost falls as .
Factor once for , then each of solves costs only — how big is the payoff over re-eliminating every time?
💡 Even at LU already wins, and the payoff climbs toward — which is why numerical libraries factor once and reuse and for every right-hand side.
Question 1
A matrix is . What is the approximate flop count for Gaussian elimination (forward elimination only)?
✅ Correct! Gaussian elimination costs approximately ⅓n³ flops, which comes from summing the squares n² + (n−1)² + ⋯ + 1².
❌ Not quite. Remember: the total cost is the sum of squares 1² + 2² + ⋯ + n², which equals approximately ⅓n³.
Solution:
The cost of Gaussian elimination is approximately flops.
For :
The exact sum is , which is within 2% of the approximation.
Question 2
True or False: Once you have the LU factorization stored, each additional right-hand side costs approximately flops to solve.
✅ Correct! Each additional RHS costs only about n² (two triangular solves), not ⅓n³. That's the whole benefit of LU factorization!
❌ Not quite. Think about what work remains once L and U are already computed — you only need forward and back substitution.
Solution: False
Once and are stored, each right-hand side requires only two triangular solves:
Combined cost per RHS — not .
This is the entire point of LU factorization: the expensive work is done once during factorization. Each subsequent solve is vastly cheaper at only .
Question 3
You have a system with 100 different right-hand sides. What is the approximate speedup of LU factorization over running naive Gaussian elimination 100 separate times?
Hint: Naive cost . LU cost .
✅ Correct! LU saves a factor of ~77 by avoiding 99 redundant eliminations. The speedup approaches n/3 = 333 as more RHS are added.
❌ Not quite. Try computing both costs explicitly: Naive = 100 × ⅓ × 10⁹ and LU = ⅓ × 10⁹ + 100 × 10⁶, then divide.
Solution:
With and :
Naive approach:
LU approach:
Speedup:
Same answers, 77 times less work!
Why not 333×? Because the first factorization still costs ⅓n³ in the LU approach. The speedup approaches only as .
Question 4
For a matrix, elimination proceeds through steps . At step , the active submatrix has size . What is the cost of the second elimination step ()?
✅ Correct! After step k=0 eliminates the first row and column, the active region is 4×4, costing (5−1)² = 16 flops.
❌ Not quite. At step k=1, one row and one column have already been eliminated. The active submatrix size is (n−k) = (5−1) = 4.
Solution:
For a matrix (), the cost at each step:
| Step | Active size | Cost |
|---|---|---|
| (first) | ||
| (second) | ||
| (third) | ||
| (fourth) | ||
| (fifth) |
At step , the first row and column have been eliminated, leaving a active submatrix. The cost is flops.
Verification: Total ✓
Solved: 0 / 4