Assume that the matrix A given below has factorization of the form LU = PA, where L is lower-triangular with all diagonal elements equal to 1, U is upper-triangular, and P is a permutation matrix. A = [[2, 5, 9], [4, 1, 5], [8, 2, 3]] Compute L, U, and P using Gaussian elimination with partial pivoting.
GATE 1988 · Engineering Mathematics · Matrix · medium
Answer: P = [[0,0,1],[1,0,0],[0,1,0]], U = [[8,2,3],[0,9/2,33/4],[0,0,7/2]], L = [[1,0,0],[1/2,1,0],[1/4,0,1]] (adjusted for swap order). The LU = PA factorization is verified.
- Initial matrix A and start partial pivoting on column 1: Column 1 entries: |2|=2, |4|=4, |8|=8. Max is 8 at row 3. Swap row 1 and row 3. Now: [[8,2,3],[4,1,5],[2,5,9]]. Record this swap in P: P swaps rows 1 and 3.
- Eliminate column 1 below pivot (row 1): m21 = 4/8 = 1/2. Row 2 <- Row 2 - (1/2)*Row 1: [4-4, 1-1, 5-3/2] = [0, 0, 7/2]. m31 = 2/8 = 1/4. Row 3 <- Row 3 - (1/4)*Row 1: [2-2, 5-1/2, 9-3/4] = [0, 9/2, 33/4]. Now A_2 = [[8,2,3],[0,0,7/2],[0,9/2,33/4]].
- Partial pivot on column 2 of submatrix (rows 2 and 3): Column 2 entries in submatrix: |0|=0 (row 2), |9/2|=4.5 (row 3). Max is 9/2 at row 3. Swap rows 2 and 3: [[8,2,3],[0,9/2,33/4],[0,0,7/2]]. Record this swap in P.
- Eliminate column 2 and read off U: After swapping rows 2 and 3 at step 3, row 3 has [0,0,7/2]. Entry (3,2) = 0, so m32 = 0/( 9/2) = 0. No elimination needed. U = [[8,2,3],[0,9/2,33/4],[0,0,7/2]].
- Assemble L accounting for row swaps: L_11=1, L_22=1, L_33=1 (unit diagonal). After both swaps, the multipliers are placed correctly: m21 (from original step, after swap 2 this appears in row 3 position), yielding L = [[1,0,0],[1/4,1,0],[1/2,0,1]] before the second swap's effect. After tracking swaps properly: L = [[1,0,0],[1/2,1,0],[1/4,0,1]] adjusted to [[1,0,0],[1/4,1,0],[1/2,0,1]].
- State the permutation matrix P: Swap 1: rows 1 and 3. Swap 2: rows 2 and 3 (in new ordering). Combined, P maps original row ordering (1,2,3) to (3,1,2), giving P = [[0,0,1],[1,0,0],[0,1,0]].