An online calculator that computes the LU decomposition of a square matrix.
An \( LU \) decomposition of a given matrix \( A \) is expressed as:
\[ A = L U \]
where \( L \) is a lower triangular matrix and \( U \) is an upper triangular matrix.
Note: Not all square matrices have an LU decomposition. An invertible matrix \( A \) has an \( LU \) decomposition if and only if all its leading principal minors are non-zero.
Matrix Input
Enter the number of columns (and rows) \( n = \)
This will generate a matrix with random values.
Results
Note: Any decomposition with outputs such as "NaN" or "Infinity" is invalid, indicating that the matrix does not possess a valid LU decomposition.
What is LU Decomposition and Why is it Important?
LU decomposition (also called LU factorization) is a fundamental linear algebra technique that decomposes a square matrix \(A\) into the product of a lower triangular matrix \(L\) and an upper triangular matrix \(U\):
\[ A = L \times U \]
Key Applications & Importance:
Solving Linear Systems: Once \(A = LU\) is established, solving \(Ax = b\) simplifies to solving \(Ly = b\) (forward substitution) followed by \(Ux = y\) (backward substitution).
Computing Determinants: The determinant of \(A\) equals the product of the diagonal elements of \(U\).
Matrix Inversion: Facilitates efficient computation of matrix inverses.
Numerical Stability: Provides robust solutions when paired with partial pivoting.
Efficiency: Lowers computational complexity to \(O(n^2)\) for solving multiple systems with identical coefficient matrices.
How LU Decomposition is Calculated:
Computed using Gaussian elimination steps:
Step 1: Start with the original matrix \(A\).
Step 2: For each column \(k\) from 1 to \(n-1\), compute multipliers \(m_{ik} = \frac{a_{ik}}{a_{kk}}\) for rows \(i > k\) and eliminate sub-diagonal entries.
Step 3: The resulting upper triangular matrix forms \(U\).
Step 4: Construct \(L\) with ones on the diagonal and the multipliers \(m_{ik}\) stored in their respective positions.