solving linear system of equations the undo button for
play

Solving Linear System of Equations The Undo button for Linear - PowerPoint PPT Presentation

Solving Linear System of Equations The Undo button for Linear Operations Matrix-vector multiplication: given the data and the operator , we can find such that = transformation What if we know


  1. Solving Linear System of Equations

  2. The โ€œUndoโ€ button for Linear Operations Matrix-vector multiplication: given the data ๐’š and the operator ๐‘ฉ , we can find ๐’› such that ๐’› = ๐‘ฉ ๐’š ๐‘ฉ ๐’š ๐’› transformation What if we know ๐’› but not ๐’š ? How can we โ€œundoโ€ the transformation? ๐‘ฉ !๐Ÿ ๐’š ๐’› Solve ๐‘ฉ ๐’š = ๐’› for ๐’š ?

  3. Image Blurring Example โ€ข Image is stored as a 2D array of real numbers between 0 and 1 (0 represents a white pixel, 1 represents a black pixel) โ€ข ๐’š๐’๐’ƒ๐’– has 40 rows of pixels and 100 columns of pixels โ€ข Flatten the 2D array as a 1D array โ€ข ๐’š contains the 1D data with dimension 4000, โ€ข Apply blurring operation to data ๐’š, i.e. ๐’„ = ๐‘ฉ ๐’š where ๐‘ฉ is the blur operator and ๐’„ is the blurred image

  4. Blur operator ๐’š Blur operator ๐‘ฉ blurred "originalโ€ Blur operator ๐’„ image image (4000,4000) (4000,) (4000,) ๐’„ = ๐‘ฉ ๐’š

  5. โ€Undoโ€ Blur to recover original image ๐’„ Assumptions: 1. we know the blur operator ๐‘ฉ Solve 2. the data set ๐’„ does not ๐‘ฉ ๐’š = ๐’„ have any noise (โ€œclean for ๐’š dataโ€ ๐’š What happens if we add some noise to ๐’„ ?

  6. โ€Undoโ€ Blur to recover original image ๐’› + ๐‘ โˆ— 10 !" (๐‘ โˆˆ 0,1 ) ๐’› + ๐‘ โˆ— 10 !# (๐‘ โˆˆ 0,1 ) Solve ๐‘ฉ ๐’š = ๐’› for ๐’š How much noise can we add and still be able to recover meaningful information from the original image? At which point this inverse transformation fails? We will talk about sensitivity of the โ€œundoโ€ operation later.

  7. Linear System of Equations How do we actually solve ๐‘ฉ ๐’š = ๐’„ ? We can start with an โ€œeasierโ€ system of equationsโ€ฆ Letโ€™s consider triangular matrices (lower and upper): ๐‘ฆ ! ๐‘€ !! 0 ๐‘ โ€ฆ 0 ๐‘ฆ " ๐‘€ "! ๐‘€ "" ๐‘ " โ€ฆ 0 = โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฑ โ‹ฎ โ‹ฎ ๐‘ฆ # ๐‘€ #! ๐‘€ #" โ€ฆ ๐‘€ ## ๐‘ # ๐‘ฆ ! ๐‘‰ !! ๐‘‰ !" โ€ฆ ๐‘‰ !# ๐‘ ๐‘ฆ " 0 ๐‘‰ "" โ€ฆ ๐‘‰ "# ๐‘ " = โ‹ฎ โ‹ฑ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ ๐‘ฆ # โ€ฆ ๐‘‰ ## ๐‘ # 0 0

  8. Example: Forward-substitution for lower triangular systems ๐‘ฆ ! 2 0 0 0 2 ๐‘ฆ " 3 2 0 0 2 = ๐‘ฆ # 1 2 6 0 6 ๐‘ฆ $ 1 3 4 2 4 2 ๐‘ฆ $ = 2 โ†’ ๐‘ฆ $ = 1 3 ๐‘ฆ $ + 2 ๐‘ฆ % = 2 โ†’ ๐‘ฆ % = 2 โˆ’ 3 = โˆ’0.5 2 1 ๐‘ฆ $ + 2 ๐‘ฆ % + 6 ๐‘ฆ & = 6 โ†’ ๐‘ฆ & = 6 โˆ’ 1 + 1 = 1.0 6 1 ๐‘ฆ $ + 3 ๐‘ฆ % + 4 ๐‘ฆ & + 2 ๐‘ฆ # = 4 โ†’ ๐‘ฆ & = 4 โˆ’ 1 + 1.5 โˆ’ 4 = 0.25 ๐‘ฆ ! 1 2 ๐‘ฆ " โˆ’0.5 = ๐‘ฆ # 1.0 ๐‘ฆ $ 0.25

  9. Example: Backward-substitution for upper triangular systems ๐‘ฆ ! 2 8 4 2 2 ๐‘ฆ " 0 4 4 3 4 = ๐‘ฆ $ 0 0 6 2 4 ๐‘ฆ % 1 0 0 0 2 ๐‘ฆ # = 1 2 4 โˆ’ 2 1 = 1 2 ๐‘ฆ & = 6 2 4 โˆ’ 4 1 2 โˆ’ 3 1 = 1/2 = 1 2 ๐‘ฆ % = 4 4 8 2 โˆ’ 8 1 8 โˆ’ 4 1 2 โˆ’ 2 1 = โˆ’2 2 ๐‘ฆ $ = 2 = โˆ’1 2

  10. LU Factorization How do we solve ๐‘ฉ ๐’š = ๐’„ when ๐‘ฉ is a non-triangular matrix? We can perform LU factorization: given a ๐‘œร—๐‘œ matrix ๐‘ฉ , obtain lower triangular matrix ๐‘ด and upper triangular matrix ๐‘ฝ such that ๐‘ฉ = ๐‘ด๐‘ฝ where we set the diagonal entries of ๐‘ด to be equal to 1. 1 0 ๐‘‰ !! ๐‘‰ !" โ€ฆ ๐‘‰ !# ๐ต !! ๐ต !" โ€ฆ ๐ต !# โ€ฆ 0 ๐‘€ "! 1 0 ๐‘‰ "" โ€ฆ ๐‘‰ "# ๐ต "! ๐ต "" โ€ฆ ๐ต "# โ€ฆ 0 = โ‹ฎ โ‹ฎ โ‹ฑ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฑ โ‹ฎ โ‹ฑ โ‹ฎ โ‹ฎ โ‹ฎ ๐‘€ #! ๐‘€ #" โ€ฆ ๐‘‰ ## ๐ต #! ๐ต #" โ€ฆ ๐ต ## โ€ฆ 1 0 0

  11. LU Factorization โ€ฆ ๐‘‰ !# โ€ฆ ๐ต !# 1 0 ๐‘‰ !! ๐‘‰ !" ๐ต !! ๐ต !" โ€ฆ 0 ๐‘€ "! 1 0 ๐‘‰ "" โ€ฆ ๐‘‰ "# ๐ต "! ๐ต "" โ€ฆ ๐ต "# โ€ฆ 0 = โ‹ฎ โ‹ฎ โ‹ฑ โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฑ โ‹ฎ โ‹ฑ โ‹ฎ โ‹ฎ โ‹ฎ ๐‘€ #! ๐‘€ #" โ€ฆ ๐‘‰ ## ๐ต #! ๐ต #" โ€ฆ ๐ต ## โ€ฆ 1 0 0 Assuming the LU factorization is know, we can solve the general system

  12. LU Factorization (with pivoting) ๐‘ฉ = ๐‘ธ๐‘ด๐‘ฝ Factorize: ๐‘ธ๐‘ด๐‘ฝ ๐’š = ๐’„ ๐’› ๐‘ด ๐’› = ๐‘ธ ๐‘ผ ๐’„ (Solve for ๐’› ) Forward-substitution ๐‘ฝ ๐’š = ๐’› (Solve for ๐’š ) Backward-substitution

  13. Example Assume the ๐‘ฉ = ๐‘ด๐‘ฝ factorization is known, yielding: 1 0 0 0 2 8 4 1 0.5 1 0 0 0 โˆ’2 1 2.5 ๐‘ด = ๐‘ฝ = 0.5 1 1 0 0 0 3 โˆ’1 2 0.5 1 0.5 0.5 0 0 0 0.75 2 Determine the solution ๐’š that satisfies ๐‘ฉ๐’š = ๐’„ , when ๐’„ = 1 4 ๐‘ด ๐‘ฝ๐’š = ๐’„ ๐’› First, solve the lower-triangular Then, solve the upper-triangular system ๐‘ด ๐’› = ๐’„ for the variable ๐’› system ๐‘ฝ ๐’š = ๐’› for the variable ๐’š 1 0 0 0 2 2 8 4 1 2 0.5 1 0 0 0 โˆ’2 1 2.5 2 1 ๐’š = ๐’› = 0.5 1 1 0 1 0 0 3 โˆ’1 โˆ’1 0.5 0.5 0.5 1 4 0 0 0 0.75 3

  14. Methods to solve linear system of equations ๐‘ฉ ๐’š = ๐’„ โ€ข LU โ€ข Cholesky โ€ข Sparse

  15. LU Factorization - Algorithm

  16. 2x2 LU Factorization (simple example) ๐ต !! ๐ต !" ๐‘‰ !! ๐‘‰ !" 1 0 = ๐‘€ "! 1 ๐ต "! ๐ต "" 0 ๐‘‰ "" ๐ต !! ๐ต !" ๐‘‰ !! ๐‘‰ !" = ๐ต "! ๐ต "" ๐‘€ "! ๐‘‰ !! ๐‘€ "! ๐‘‰ !" + ๐‘‰ ""

  17. ๐‘ $$ : scalar LU Factorization ๐’ƒ $% : row vector (1ร—(๐‘œ โˆ’ 1)) ๐’ƒ %$ : column vector (๐‘œ โˆ’ 1)ร—1 ๐‘ $$ ๐’ƒ $% ๐‘ฉ %% : matrix (๐‘œ โˆ’ 1)ร—(๐‘œ โˆ’ 1) ๐ต !! ๐ต !" โ€ฆ ๐ต !# ๐‘ !! ๐’ƒ !" ๐‘ฃ !! ๐’— !" ๐ต "! ๐ต "" โ€ฆ ๐ต "# 1 ๐Ÿ = = ๐’ƒ "! ๐‘ฉ "" ๐Ÿ ๐‘ฝ "" ๐’Ž "! ๐‘ด "" โ‹ฎ โ‹ฎ โ‹ฑ โ‹ฎ ๐ต #! ๐ต #" โ€ฆ ๐ต ## ๐’ƒ %$ ๐‘ฉ %% ๐‘ !! ๐’ƒ !" ๐‘ฃ !! ๐’— !" = ๐’ƒ "! ๐‘ฉ "" ๐‘ฃ !! ๐’Ž "! ๐’Ž "! ๐’— !" + ๐‘ด "" ๐‘ฝ ""

  18. ๐‘ $$ : scalar LU Factorization ๐’ƒ $% : row vector (1ร—(๐‘œ โˆ’ 1)) ๐’ƒ %$ : column vector (๐‘œ โˆ’ 1)ร—1 ๐‘ $$ ๐’ƒ $% ๐‘ฉ %% : matrix (๐‘œ โˆ’ 1)ร—(๐‘œ โˆ’ 1) ๐ต !! ๐ต !" โ€ฆ ๐ต !# ๐‘ !! ๐’ƒ !" ๐‘ฃ !! ๐’— !" ๐ต "! ๐ต "" โ€ฆ ๐ต "# 1 ๐Ÿ = = ๐’ƒ "! ๐‘ฉ "" ๐Ÿ ๐‘ฝ "" ๐’Ž "! ๐‘ด "" โ‹ฎ โ‹ฎ โ‹ฑ โ‹ฎ ๐ต #! ๐ต #" โ€ฆ ๐ต ## ๐’ƒ %$ 1) First row of ๐‘ฝ is ๐‘ฉ %% the first row of ๐‘ฉ ๐‘ !! ๐’ƒ !" ๐‘ฃ !! ๐’— !" = ๐’ƒ "! ๐‘ฉ "" ๐‘ฃ !! ๐’Ž "! ๐’Ž "! ๐’— !" + ๐‘ด "" ๐‘ฝ "" 2) ๐’Ž <= = = Known! % !! ๐’ƒ <= 3) ๐‘ต = ๐‘ด "" ๐‘ฝ "" = ๐‘ฉ "" โˆ’ ๐’Ž "! ๐’— !" First column of ๐‘ด is the first column of ๐‘ฉ / ๐‘ฃ == Need another factorization!

  19. Example 1) First row of ๐‘ฝ is the first row of ๐‘ฉ 2 8 4 1 3 3 1 2 2) First column of ๐‘ด is the first column of ๐‘ฉ / ๐‘ฃ == ๐‘ต = 1 2 6 2 3) ๐‘ด "" ๐‘ฝ "" = ๐‘ฉ "" โˆ’ ๐’Ž "! ๐’— !" 1 3 4 2 1 0 0 0 2 8 4 1 0.5 0 0 0 0 0 0 0 ๐‘ด = ๐‘ฝ = 0.5 0 0 0 0 0 0 0 0.5 0 0 0 0 0 0 0 2 3 3 4 2 0.5 2 6 2 4 ๐‘ด %% ๐‘ฝ %% = ๐‘ฉ %% โˆ’ ๐’Ž %$ ๐’— $% = โˆ’ 2 0.5 3 4 2 4 2 0.5 2 8 4 1 1 โˆ’2 1 2.5 ๐‘ต = 1 โˆ’2 4 1.5 1 โˆ’1 2 1.5

  20. 2 8 4 1 1 โˆ’2 1 2.5 ๐‘ต = 1 โˆ’2 4 1.5 1 โˆ’1 2 1.5 1 0 0 0 2 8 4 1 0.5 1 0 0 0 โˆ’2 1 2.5 ๐‘ด = ๐‘ฝ = 0 0 0 0 0 0 0.5 1 0.5 0.5 0 0 0 0 0 0 ๐‘ด %% ๐‘ฝ %% = ๐‘ฉ %% โˆ’ ๐’Ž %$ ๐’— $% = 4 1.5 1 2.5 1.5 โˆ’ 2 0.5 1.25 2 8 4 1 1 โˆ’2 1 2.5 ๐‘ต = 3 โˆ’1 1 โˆ’2 1 โˆ’1 1.5 0.25

  21. 2 8 4 1 1 2.5 1 โˆ’2 ๐‘ต = 1 โˆ’2 3 โˆ’1 1 โˆ’1 1.5 0.25 1 0 0 0 2 8 4 1 0.5 1 0 0 0 โˆ’2 1 2.5 ๐‘ด = ๐‘ฝ = 0.5 1 1 0 0 0 3 โˆ’1 0.5 0 0.5 0.5 0 0 0 0 ๐‘ด %% ๐‘ฝ %% = ๐‘ฉ %% โˆ’ ๐’Ž %$ ๐’— $% = 0.25 โˆ’ โˆ’0.5 = 0.75 1 0 0 0 2 8 4 1 0.5 1 0 0 0 โˆ’2 1 2.5 ๐‘ด = ๐‘ฝ = 0.5 1 1 0 0 0 3 โˆ’1 0.5 1 0.5 0.5 0 0 0 0.75

  22. ๐‘ $$ : scalar LU Factorization ๐’ƒ $% : row vector (1ร—(๐‘œ โˆ’ 1)) ๐’ƒ %$ : column vector (๐‘œ โˆ’ 1)ร—1 ๐‘ $$ ๐’ƒ $% ๐‘ฉ %% : matrix (๐‘œ โˆ’ 1)ร—(๐‘œ โˆ’ 1) ๐ต !! ๐ต !" โ€ฆ ๐ต !# ๐‘ !! ๐’ƒ !" ๐‘ฃ !! ๐’— !" ๐ต "! ๐ต "" โ€ฆ ๐ต "# 1 ๐Ÿ = = ๐’ƒ "! ๐‘ฉ "" ๐Ÿ ๐‘ฝ "" ๐’Ž "! ๐‘ด "" โ‹ฎ โ‹ฎ โ‹ฑ โ‹ฎ ๐ต #! ๐ต #" โ€ฆ ๐ต ## ๐’ƒ %$ 1) First row of ๐‘ฝ is ๐‘ฉ %% the first row of ๐‘ฉ ๐‘ !! ๐’ƒ !" ๐‘ฃ !! ๐’— !" = ๐’ƒ "! ๐‘ฉ "" ๐‘ฃ !! ๐’Ž "! ๐’Ž "! ๐’— !" + ๐‘ด "" ๐‘ฝ "" 2) ๐’Ž <= = = Known! % !! ๐’ƒ <= 3) ๐‘ต = ๐‘ด "" ๐‘ฝ "" = ๐‘ฉ "" โˆ’ ๐’Ž "! ๐’— !" First column of ๐‘ด is the first column of ๐‘ฉ / ๐‘ฃ == Need another factorization!

  23. Cost of solving linear system of equations

  24. Cost of solving triangular systems * ๐‘ & โˆ’ โˆ‘ '(&)! ๐‘‰ &' ๐‘ฆ ' ๐‘ฆ * = ๐‘ * /๐‘‰ ** ๐‘ฆ & = , ๐‘— = ๐‘œ โˆ’ 1, ๐‘œ โˆ’ 2, โ€ฆ , 1 ๐‘‰ &&

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend