Numerical MethodUnit 28 min read
Direct Methods for Linear Algebraic Equations: Gaussian Elimination, LU Decomposition, Cholesky Factorization
Unit 2 of Numerical Method covers direct methods for solving linear algebraic equations, focusing on Gaussian elimination, matrix factorization (LU decomposition), and specialized techniques like Cholesky factorization for symmetric positive-definite matrices. This note explains algorithms, error analysis, computationa
1. Introduction to Direct Methods
Direct methods solve linear systems by transforming the system into an equivalent form that can be solved exactly (in theory). Unlike iterative methods, they provide the solution in a finite number of steps but may be computationally expensive for large systems.
Key Characteristics
- Exact solution (ignoring rounding errors).
- Three phases:
- Factorization: Decompose into simpler matrices (e.g., ).
- Forward/back substitution: Solve and .
- Time complexity: for matrices (dominant in numerical linear algebra).
2. Gaussian Elimination (GE) and Back Substitution
2.1 Algorithm Overview
Gaussian elimination transforms into upper triangular form via row operations:
- Forward elimination: Create zeros below the diagonal using row additions/subtractions.
- Back substitution: Solve (where is the transformed RHS).
Example: Solve
Step-by-Step Trace
- Augmented matrix:
- Eliminate from rows 2 and 3:
- Row2 = Row2 + (3/2)Row1
- Row3 = Row3 + Row1
- Eliminate from row 3:
- Row3 = Row3 - 4×Row2 Observation: Last row is → no solution (inconsistent system).
Pivoting for Numerical Stability
- Partial pivoting: Swap rows to place the largest absolute value in the pivot position.
- Scaled partial pivoting: Use row norms to avoid division by small numbers.
- Why? Prevents large rounding errors (e.g., dividing by near-zero pivots).
3. LU Decomposition
Factorize , where:
- : Lower triangular with unit diagonal (or 1s).
- : Upper triangular.
3.1 Doolittle’s Algorithm
For :
- For to :
- For to :
- For to :
- For to :
Example: Decompose
Steps:
- ,
- ,
- Final:
3.2 Crout’s Algorithm
Similar to Doolittle but stores with 1s on the diagonal in (less common in practice).
3.3 Applications
- Solve via:
- Solve (forward substitution).
- Solve (back substitution).
- Efficiency: for decomposition, per RHS (useful for multiple RHS vectors).
4. Cholesky Factorization
For symmetric positive-definite (SPD) matrices , where is lower triangular.
4.1 Algorithm
For :
- For to :
- For to :
- For to :
Example: Factorize
Steps:
-
Correction: → Error! Recompute:
→ Singular matrix? No, correct calculation:
is invalid. Actual:
→ Issue: Matrix is not SPD (det(A) = 0).
Valid SPD Example:
Let
4.2 Advantages
- Faster: ~50% fewer operations than LU for SPD matrices.
- Numerically stable: No pivoting needed if is SPD.
- Applications: Least squares, quadratic optimization.
5. Comparison of Direct Methods
| Method | Applicability | Pros | Cons | Time Complexity |
|---|---|---|---|---|
| Gaussian Elimination | General matrices | Simple to implement | Unstable without pivoting | |
| LU Decomposition | General matrices | Reusable for multiple RHS | Requires pivoting for stability | |
| Cholesky | Symmetric positive-definite | Faster, no pivoting needed | Only for SPD matrices |
6. Error Analysis in Direct Methods
6.1 Sources of Error
- Rounding errors: Accumulate during elimination/substitution.
- Pivoting errors: Ill-conditioned matrices amplify errors.
- Fill-in: LU decomposition may introduce non-zero entries where had zeros.
6.2 Condition Number
- Measures sensitivity to input changes: .
- High : Small changes in or cause large changes in .
- Example: has .
6.3 Partial Pivoting Impact
- Reduces error growth by ~100× in practice.
- Rule: Swap rows to maximize in the pivot column.
7. Worked Problems (Exam-Style)
Problem 1: Gaussian Elimination with Pivoting
Solve: Solution:
- Swap rows (pivoting).
- Eliminate from row 2:
- Back substitution:
Observation: Without pivoting, (wrong due to division by 0.0001).
Problem 2: LU Decomposition
Factorize: Solution:
- , ,
- ,
- ,
- , Final:
8. Exam Tip: What to Expect
8.1 Common Question Types
- Algorithm derivation: Derive LU decomposition steps or Gaussian elimination formulas.
- Numerical examples: Solve systems using GE/LU/Cholesky (assume pivoting if needed).
- Error analysis: Discuss pivoting, condition numbers, or rounding errors.
- Comparison: Contrast LU vs. Cholesky (when to use each).
- Theoretical questions:
- Why is partial pivoting necessary?
- When is Cholesky applicable?
- What is fill-in in LU factorization?
8.2 High-Scoring Strategies
- Show all steps: Even partial credit for correct intermediate steps.
- Justify pivoting: Always mention pivoting in GE/LU unless the matrix is well-conditioned.
- Check SPD: For Cholesky, verify is symmetric and positive-definite (e.g., all leading principal minors > 0).
- Error bounds: Relate to condition number if asked about stability.
- Pseudocode: For algorithms like Doolittle’s, write 3–4 lines of pseudocode to earn marks.
8.3 Pitfalls to Avoid
- Ignoring pivoting: Solutions without pivoting may lose marks for numerical instability.
- Incorrect factorization: Double-check diagonal entries in or .
- Assumptions: Never assume a matrix is SPD without verification.
- Units: In exams, state whether you’re using partial/scaled pivoting.
9. Summary Checklist
Before submitting, ensure your answer includes:
- Definitions: Clear explanation of , Cholesky, and pivoting.
- Algorithms: Step-by-step derivation or application.
- Examples: At least one worked problem with numerical results.
- Error discussion: Mention pivoting or condition numbers if relevant.
- Comparisons: Tables or bullet points contrasting methods.
- Exam tips: Highlighted key points for quick revision.
End of Note
Based on the TU BSc CSIT syllabus for Numerical Method (CSC212), unit 2.
Discussion
Loading…