Docsity

LU decomposition my goat, Summaries of Computer science

Toggle sidebar
bg1
Elementary matrices
Matrices that represent the elementary row operations:
Swapping rows
•
Scaling rows
•
Adding multiples of one row to another
•
And also their inverses
They start with the identity matrix, then add some operation - e.g. swapping rows is the original matrix multiplied by the identity matrix with its rows
swapped to swap the rows
The identity matrix but instead of 1, you get k in some row (in the diagonal) to scale it
The inverse is given by the same thing but 1/k in part of the diagonal
Swapping rows
Identity matrix but you just swap the rows - multiply the original matrix to swap its rows
The inverse of swapping rows is itself - swapping row 1 and 2 then swapping them again gives the same thing
Adding (multiples of) rows
K goes in the row you want to scale. It goes in the column with the index of the row you want to add to it e.g. the 2 in the bottom left corner will add
2xrow1 to row 2. e.g2. the k in the middle right of the 3x3 will add k lots of row 3 to row 2
The inverse is given by -k in the same location
LU decomposition
Decomposition methods turn a matrix into a group of other matrices that can be multiplied to make the original matrix
The smaller matrices have useful properties
Recall elementary row operations (above) - gaussian elimination
LU decompositions aren't unique - there can be many for a given matrix
Application of LU decompositions for solving linear systems:
For swapping 1st and 2nd row
Example showing swap - if you do the
multiplication you get this
With LU decomposition
Example
LU Decomposition
20 November 2026
11:26
MCS - Maths for Computer Science Page 1
pf3

Partial preview of the text

Download LU decomposition my goat and more Summaries Computer science in PDF only on Docsity!

Elementary matrices Matrices that represent the elementary row operations:

  • Swapping rows
  • Scaling rows
  • Adding multiples of one row to another And also their inverses They start with the identity matrix, then add some operation - e.g. swapping rows is the original matrix multiplied by the identity matrix with its rows swapped to swap the rows Scaling a row The identity matrix but instead of 1, you get k in some row (in the diagonal) to scale it The inverse is given by the same thing but 1/k in part of the diagonal Swapping rows Identity matrix but you just swap the rows - multiply the original matrix to swap its rows The inverse of swapping rows is itself - swapping row 1 and 2 then swapping them again gives the same thing Adding (multiples of) rows K goes in the row you want to scale. It goes in the column with the index of the row you want to add to it e.g. the 2 in the bottom left corner will add 2xrow1 to row 2. e.g2. the k in the middle right of the 3x3 will add k lots of row 3 to row 2 The inverse is given by - k in the same location LU decomposition Decomposition methods turn a matrix into a group of other matrices that can be multiplied to make the original matrix The smaller matrices have useful properties Recall elementary row operations (above) - gaussian elimination LU decompositions aren't unique - there can be many for a given matrix Application of LU decompositions for solving linear systems: For swapping 1st and 2nd row Example showing swap - if you do the multiplication you get this With LU decomposition Example

LU Decomposition

20 November 2026 11:

The condition for being able to perform LU decomposition on a square matrix is (square matrix, no row swaps to get ref) To actually get a LU decomposition: Example: To get A to ref we want to get 1 as the leading digit (top left) therefore, divide by 2. This gives the elementary matrix cor responding to scaling a row by 1/2. we find the inverse of that. (matrix is identity matrix with 1/2 in top left - the inverse is the same but 1/top left, giving 2 in the top left) We then want to make 1 in the bottom right. To do this, we have 1 and - 2 in the top row, so subtract 3 lots of this from row 2 to get 0 4 in the bottom row. This operation gives E2 = identity matrix with - 3 in bottom left, E2^-1 = identity with 3 in the bottom left We have 0 4 on the bottom row, so divide it by 4 to get 0 1. this does the same as the first operation, and gets the ref of A , which is the upper triangular matrix U We then have the three inverse elementary matrices The product of these matrices gives the lower triangular matrix L We can then check this is correct by multiplying L and U In summary: U is the product of all the elementary matrices applied to A (ref of A): E1 * E2 * E3 * A = U L is the product of all the inverse elementary matrices applied to A: E1^ - 1 * E2^-1 * E3^-1 * A = L As we can see, multiplying L and U means multiplying each Ex with Ex^ - 1, cancelling out to give A (this isnt on the exam - to calculate, but understanding of this is tested) LU decomposition method fails when row swaps must be made to get ref(A) To get around this we can permute rows in advance e.g. a permutation matrix made from permutating the rows of the identity matrix: It is invertible with inverse being the transpose of itself Imma leave this here With LU decomposition