111
The PA = LU Factorization Math 218 Brian D. Fitzpatrick Duke University November 1, 2019 MATH

The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU FactorizationMath 218

Brian D. Fitzpatrick

Duke University

November 1, 2019

MATH

Page 2: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Overview

Background“Big Picture” Overview of PA = LUComputational Limitations of rrefRounding ErrorsPermutation MatricesForward Elimination

The PA = LU AlgorithmDescriptionExample

Row EquivalencyA and U are Row-Equivalent

Page 3: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Background“Big Picture” Overview of PA = LU

The PA = LU algorithm produces a factorization used in numericallinear algebra.

I P is a permutation matrix

I L is lower triangular

I U is upper triangular

I PA = LU algorithm is faster than EA = rref(A)

I PA = LU algorithm uses only row swaps and row addition

I row swaps are determined by the method of partial pivoting

I A #»x =#»

b is equivalent to U #»x = #»y where #»y solves L #»y = P#»

b

Page 4: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Background“Big Picture” Overview of PA = LU

The PA = LU algorithm produces a factorization used in numericallinear algebra.

I P is a permutation matrix

I L is lower triangular

I U is upper triangular

I PA = LU algorithm is faster than EA = rref(A)

I PA = LU algorithm uses only row swaps and row addition

I row swaps are determined by the method of partial pivoting

I A #»x =#»

b is equivalent to U #»x = #»y where #»y solves L #»y = P#»

b

Page 5: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Background“Big Picture” Overview of PA = LU

The PA = LU algorithm produces a factorization used in numericallinear algebra.

I P is a permutation matrix

I L is lower triangular

I U is upper triangular

I PA = LU algorithm is faster than EA = rref(A)

I PA = LU algorithm uses only row swaps and row addition

I row swaps are determined by the method of partial pivoting

I A #»x =#»

b is equivalent to U #»x = #»y where #»y solves L #»y = P#»

b

Page 6: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Background“Big Picture” Overview of PA = LU

The PA = LU algorithm produces a factorization used in numericallinear algebra.

I P is a permutation matrix

I L is lower triangular

I U is upper triangular

I PA = LU algorithm is faster than EA = rref(A)

I PA = LU algorithm uses only row swaps and row addition

I row swaps are determined by the method of partial pivoting

I A #»x =#»

b is equivalent to U #»x = #»y where #»y solves L #»y = P#»

b

Page 7: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Background“Big Picture” Overview of PA = LU

The PA = LU algorithm produces a factorization used in numericallinear algebra.

I P is a permutation matrix

I L is lower triangular

I U is upper triangular

I PA = LU algorithm is faster than EA = rref(A)

I PA = LU algorithm uses only row swaps and row addition

I row swaps are determined by the method of partial pivoting

I A #»x =#»

b is equivalent to U #»x = #»y where #»y solves L #»y = P#»

b

Page 8: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Background“Big Picture” Overview of PA = LU

The PA = LU algorithm produces a factorization used in numericallinear algebra.

I P is a permutation matrix

I L is lower triangular

I U is upper triangular

I PA = LU algorithm is faster than EA = rref(A)

I PA = LU algorithm uses only row swaps and row addition

I row swaps are determined by the method of partial pivoting

I A #»x =#»

b is equivalent to U #»x = #»y where #»y solves L #»y = P#»

b

Page 9: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Background“Big Picture” Overview of PA = LU

The PA = LU algorithm produces a factorization used in numericallinear algebra.

I P is a permutation matrix

I L is lower triangular

I U is upper triangular

I PA = LU algorithm is faster than EA = rref(A)

I PA = LU algorithm uses only row swaps and row addition

I row swaps are determined by the method of partial pivoting

I A #»x =#»

b is equivalent to U #»x = #»y where #»y solves L #»y = P#»

b

Page 10: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundComputational Limitations of rref

RecallThe Gauß-Jordan algorithm produces a matrix factorizationEA = rref(A).

The matrix E is of the form

E = Er · · ·E2E1

where E1,E2, . . . ,Er are the elementary matrices corresponding tothe row operations used in the Gauß-Jordan algorithm.

Utility

Solving A #»x =#»

b is equivalent to solving rref(A) #»x = E#»

b .

Page 11: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundComputational Limitations of rref

RecallThe Gauß-Jordan algorithm produces a matrix factorizationEA = rref(A). The matrix E is of the form

E = Er · · ·E2E1

where E1,E2, . . . ,Er are the elementary matrices corresponding tothe row operations used in the Gauß-Jordan algorithm.

Utility

Solving A #»x =#»

b is equivalent to solving rref(A) #»x = E#»

b .

Page 12: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundComputational Limitations of rref

RecallThe Gauß-Jordan algorithm produces a matrix factorizationEA = rref(A). The matrix E is of the form

E = Er · · ·E2E1

where E1,E2, . . . ,Er are the elementary matrices corresponding tothe row operations used in the Gauß-Jordan algorithm.

Utility

Solving A #»x =#»

b is equivalent to solving rref(A) #»x = E#»

b .

Page 13: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundComputational Limitations of rref

ProblemThe matrix E is the product of a lot of elementary matrices. Themore row operations used, the more time it takes to compute E .

Page 14: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundComputational Limitations of rref

ExampleThe Gauß-Jordan algorithm gives

9 38 −204 17 −93 17 −11

A

(1/9)·R1→R1−−−−−−−−→

1 38/9 −20/94 17 −93 17 −11

R2 + (−4) · R1 → R2R3 + (−3) · R1 → R3−−−−−−−−−−−−−−−−→

1 38/9 −20/90 1/9 −1/90 13/3 −13/3

9·R2→R2−−−−−−→

1 38/9 −20/90 1 −10 13/3 −13/3

R1 + (−38/9) · R2 → R1R3 + (−13/3) · R2 → R3−−−−−−−−−−−−−−−−−→

1 0 20 1 −10 0 0

rref(A)

The EA = rref(A) factorization is

17 −38 0−4 9 017 −39 1

E

9 38 −204 17 −93 17 −11

A

=

1 0 20 1 −10 0 0

rref(A)

Where did the entries in E come from?

Page 15: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundComputational Limitations of rref

ExampleThe Gauß-Jordan algorithm gives

9 38 −204 17 −93 17 −11

A

(1/9)·R1→R1−−−−−−−−→

1 38/9 −20/94 17 −93 17 −11

R2 + (−4) · R1 → R2R3 + (−3) · R1 → R3−−−−−−−−−−−−−−−−→

1 38/9 −20/90 1/9 −1/90 13/3 −13/3

9·R2→R2−−−−−−→

1 38/9 −20/90 1 −10 13/3 −13/3

R1 + (−38/9) · R2 → R1R3 + (−13/3) · R2 → R3−−−−−−−−−−−−−−−−−→

1 0 20 1 −10 0 0

rref(A)

The EA = rref(A) factorization is

17 −38 0−4 9 017 −39 1

E

9 38 −204 17 −93 17 −11

A

=

1 0 20 1 −10 0 0

rref(A)

Where did the entries in E come from?

Page 16: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundComputational Limitations of rref

ExampleThe Gauß-Jordan algorithm gives

9 38 −204 17 −93 17 −11

A

(1/9)·R1→R1−−−−−−−−→

1 38/9 −20/94 17 −93 17 −11

R2 + (−4) · R1 → R2R3 + (−3) · R1 → R3−−−−−−−−−−−−−−−−→

1 38/9 −20/90 1/9 −1/90 13/3 −13/3

9·R2→R2−−−−−−→

1 38/9 −20/90 1 −10 13/3 −13/3

R1 + (−38/9) · R2 → R1R3 + (−13/3) · R2 → R3−−−−−−−−−−−−−−−−−→

1 0 20 1 −10 0 0

rref(A)

The EA = rref(A) factorization is

17 −38 0−4 9 017 −39 1

E

9 38 −204 17 −93 17 −11

A

=

1 0 20 1 −10 0 0

rref(A)

Where did the entries in E come from?

Page 17: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundRounding Errors

NoteUsing rational numbers to reduce a system produces an exactanswer.

rref

7/1000 306/5 93/1000 613/10481/100 −148/25 111/100 0

407/5 28/25 59/50 837/10

=

1 0 0 10 1 0 10 0 1 1

Page 18: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundRounding Errors

In practice, computers use floating point numbers to store data.After each computation, the computer rounds each entry to agiven number of significant digits.

Page 19: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundRounding Errors

Applying Gauß-Jordan algorithm to the previous example withrounding to three significant digits gives

0.007 61.2 0.093 61.34.81 −5.92 1.11 0.081.4 1.12 1.18 83.7

→ 1.0 8740.0 13.3 8760.0

4.81 −5.92 1.11 0.081.4 1.12 1.18 83.7

1.0 8740.0 13.3 8760.00.0 −42000.0 −62.9 −42100.00.0 −711000.0 −1080.0 −713000.0

1.0 8740.0 13.3 8760.00.0 1.0 0.0015 1.00.0 −711000.0 −1080.0 −713000.0

1.0 0.0 0.19 20.00.0 1.0 0.0015 1.00.0 0.0 −13.5 −2000.0

1.0 0.0 0.19 20.00.0 1.0 0.0015 1.00.0 0.0 1.0 148.0

1.0 0.0 0.0 −8.120.0 1.0 0.0 0.7780.0 0.0 1.0 148.0

The exact solution is #»x = 〈1, 1, 1〉 . Rounding “destabilized” thealgorithm.

Page 20: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundRounding Errors

Applying Gauß-Jordan algorithm to the previous example withrounding to three significant digits gives

0.007 61.2 0.093 61.34.81 −5.92 1.11 0.081.4 1.12 1.18 83.7

→ 1.0 8740.0 13.3 8760.0

4.81 −5.92 1.11 0.081.4 1.12 1.18 83.7

1.0 8740.0 13.3 8760.00.0 −42000.0 −62.9 −42100.00.0 −711000.0 −1080.0 −713000.0

1.0 8740.0 13.3 8760.00.0 1.0 0.0015 1.00.0 −711000.0 −1080.0 −713000.0

1.0 0.0 0.19 20.00.0 1.0 0.0015 1.00.0 0.0 −13.5 −2000.0

1.0 0.0 0.19 20.00.0 1.0 0.0015 1.00.0 0.0 1.0 148.0

1.0 0.0 0.0 −8.120.0 1.0 0.0 0.7780.0 0.0 1.0 148.0

The exact solution is #»x = 〈1, 1, 1〉 .

Rounding “destabilized” thealgorithm.

Page 21: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundRounding Errors

Applying Gauß-Jordan algorithm to the previous example withrounding to three significant digits gives

0.007 61.2 0.093 61.34.81 −5.92 1.11 0.081.4 1.12 1.18 83.7

→ 1.0 8740.0 13.3 8760.0

4.81 −5.92 1.11 0.081.4 1.12 1.18 83.7

1.0 8740.0 13.3 8760.00.0 −42000.0 −62.9 −42100.00.0 −711000.0 −1080.0 −713000.0

1.0 8740.0 13.3 8760.00.0 1.0 0.0015 1.00.0 −711000.0 −1080.0 −713000.0

1.0 0.0 0.19 20.00.0 1.0 0.0015 1.00.0 0.0 −13.5 −2000.0

1.0 0.0 0.19 20.00.0 1.0 0.0015 1.00.0 0.0 1.0 148.0

1.0 0.0 0.0 −8.120.0 1.0 0.0 0.7780.0 0.0 1.0 148.0

The exact solution is #»x = 〈1, 1, 1〉 . Rounding “destabilized” thealgorithm.

Page 22: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundRounding Errors

The method of partial pivoting uses the largest possible number (inabsolute value) to create pivots. This minimizes rounding errors.

Page 23: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundRounding Errors

Using partial pivoting, we have 0.007 61.2 0.093 61.34.81 −5.92 1.11 0.081.4 1.12 1.18 83.7

→ 81.4 1.12 1.18 83.7

4.81 −5.92 1.11 0.00.007 61.2 0.093 61.3

1.0 0.0138 0.0145 1.034.81 −5.92 1.11 0.0

0.007 61.2 0.093 61.3

→ 1.0 0.0138 0.0145 1.03

0.0 −5.99 1.04 −4.950.0 61.2 0.0929 61.3

1.0 0.0138 0.0145 1.030.0 61.2 0.0929 61.30.0 −5.99 1.04 −4.95

→ 1.0 0.0138 0.0145 1.03

0.0 1.0 0.00152 1.00.0 −5.99 1.04 −4.95

1.0 0.0 0.0145 1.020.0 1.0 0.00152 1.00.0 0.0 1.05 1.04

→ 1.0 0.0 0.0145 1.02

0.0 1.0 0.00152 1.00.0 0.0 1.0 0.99

1.0 0.0 0.0 1.010.0 1.0 0.0 0.9980.0 0.0 1.0 0.99

By using partial pivoting, we have reduced the rounding error.

Page 24: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundRounding Errors

Using partial pivoting, we have 0.007 61.2 0.093 61.34.81 −5.92 1.11 0.081.4 1.12 1.18 83.7

→ 81.4 1.12 1.18 83.7

4.81 −5.92 1.11 0.00.007 61.2 0.093 61.3

1.0 0.0138 0.0145 1.034.81 −5.92 1.11 0.0

0.007 61.2 0.093 61.3

→ 1.0 0.0138 0.0145 1.03

0.0 −5.99 1.04 −4.950.0 61.2 0.0929 61.3

1.0 0.0138 0.0145 1.030.0 61.2 0.0929 61.30.0 −5.99 1.04 −4.95

→ 1.0 0.0138 0.0145 1.03

0.0 1.0 0.00152 1.00.0 −5.99 1.04 −4.95

1.0 0.0 0.0145 1.020.0 1.0 0.00152 1.00.0 0.0 1.05 1.04

→ 1.0 0.0 0.0145 1.02

0.0 1.0 0.00152 1.00.0 0.0 1.0 0.99

1.0 0.0 0.0 1.010.0 1.0 0.0 0.9980.0 0.0 1.0 0.99

By using partial pivoting, we have reduced the rounding error.

Page 25: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundPermutation Matrices

DefinitionA permutation matrix is a matrix obtained by performing rowswaps on an identity matrix.

Example

[1 00 1

] 0 0 10 1 01 0 0

0 1 0 00 0 0 10 0 1 01 0 0 0

Page 26: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundPermutation Matrices

DefinitionA permutation matrix is a matrix obtained by performing rowswaps on an identity matrix.

Example

[1 00 1

] 0 0 10 1 01 0 0

0 1 0 00 0 0 10 0 1 01 0 0 0

Page 27: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundPermutation Matrices

TheoremLet P be an elementary matrix corresponding to a row swap. ThenP is a permutation matrix, P is symmetric (Pᵀ = P), and P is selfinverse (P2 = I ).

Page 28: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundPermutation Matrices

TheoremLet P be a permutation matrix. Then P is the product ofelementary matrices corresponding to row swaps.

Page 29: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundPermutation Matrices

DefinitionAn orthogonal matrix is a matrix Q satisfying Q−1 = Qᵀ.

Example

Consider the matrix Q given by

Q =

[35/37 12/37−12/37 35/37

]Then Q is orthogonal since

QQᵀ =

[35/37 12/37−12/37 35/37

] [35/37 −12/3712/37 35/37

]=

[1 00 1

]

Page 30: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundPermutation Matrices

DefinitionAn orthogonal matrix is a matrix Q satisfying Q−1 = Qᵀ.

Example

Consider the matrix Q given by

Q =

[35/37 12/37−12/37 35/37

]

Then Q is orthogonal since

QQᵀ =

[35/37 12/37−12/37 35/37

] [35/37 −12/3712/37 35/37

]=

[1 00 1

]

Page 31: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundPermutation Matrices

DefinitionAn orthogonal matrix is a matrix Q satisfying Q−1 = Qᵀ.

Example

Consider the matrix Q given by

Q =

[35/37 12/37−12/37 35/37

]Then Q is orthogonal since

QQᵀ =

[35/37 12/37−12/37 35/37

] [35/37 −12/3712/37 35/37

]=

[1 00 1

]

Page 32: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundPermutation Matrices

TheoremEvery permutation matrix is an orthogonal matrix.

Proof.Write P as the product of elementary matrices corresponding torow swaps P = P1P2 · · ·Pk .

Then P is invertible since each Pi isinvertible. Furthermore, we have

P−1 = (P1P2 · · ·Pk)−1

= P−1k · · ·P−12 P−11

= Pk · · ·P2P1

= Pᵀk · · ·P

ᵀ2P

ᵀ1

= (P1P2 · · ·Pk)ᵀ

= Pᵀ

Page 33: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundPermutation Matrices

TheoremEvery permutation matrix is an orthogonal matrix.

Proof.Write P as the product of elementary matrices corresponding torow swaps P = P1P2 · · ·Pk .

Then P is invertible since each Pi isinvertible. Furthermore, we have

P−1 = (P1P2 · · ·Pk)−1

= P−1k · · ·P−12 P−11

= Pk · · ·P2P1

= Pᵀk · · ·P

ᵀ2P

ᵀ1

= (P1P2 · · ·Pk)ᵀ

= Pᵀ

Page 34: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundPermutation Matrices

TheoremEvery permutation matrix is an orthogonal matrix.

Proof.Write P as the product of elementary matrices corresponding torow swaps P = P1P2 · · ·Pk . Then P is invertible since each Pi isinvertible.

Furthermore, we have

P−1 = (P1P2 · · ·Pk)−1

= P−1k · · ·P−12 P−11

= Pk · · ·P2P1

= Pᵀk · · ·P

ᵀ2P

ᵀ1

= (P1P2 · · ·Pk)ᵀ

= Pᵀ

Page 35: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundPermutation Matrices

TheoremEvery permutation matrix is an orthogonal matrix.

Proof.Write P as the product of elementary matrices corresponding torow swaps P = P1P2 · · ·Pk . Then P is invertible since each Pi isinvertible. Furthermore, we have

P−1 = (P1P2 · · ·Pk)−1

= P−1k · · ·P−12 P−11

= Pk · · ·P2P1

= Pᵀk · · ·P

ᵀ2P

ᵀ1

= (P1P2 · · ·Pk)ᵀ

= Pᵀ

Page 36: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundPermutation Matrices

TheoremEvery permutation matrix is an orthogonal matrix.

Proof.Write P as the product of elementary matrices corresponding torow swaps P = P1P2 · · ·Pk . Then P is invertible since each Pi isinvertible. Furthermore, we have

P−1 =

(P1P2 · · ·Pk)−1

= P−1k · · ·P−12 P−11

= Pk · · ·P2P1

= Pᵀk · · ·P

ᵀ2P

ᵀ1

= (P1P2 · · ·Pk)ᵀ

= Pᵀ

Page 37: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundPermutation Matrices

TheoremEvery permutation matrix is an orthogonal matrix.

Proof.Write P as the product of elementary matrices corresponding torow swaps P = P1P2 · · ·Pk . Then P is invertible since each Pi isinvertible. Furthermore, we have

P−1 = (P1P2 · · ·Pk)−1

=

P−1k · · ·P−12 P−11

= Pk · · ·P2P1

= Pᵀk · · ·P

ᵀ2P

ᵀ1

= (P1P2 · · ·Pk)ᵀ

= Pᵀ

Page 38: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundPermutation Matrices

TheoremEvery permutation matrix is an orthogonal matrix.

Proof.Write P as the product of elementary matrices corresponding torow swaps P = P1P2 · · ·Pk . Then P is invertible since each Pi isinvertible. Furthermore, we have

P−1 = (P1P2 · · ·Pk)−1

= P−1k · · ·P−12 P−11

=

Pk · · ·P2P1

= Pᵀk · · ·P

ᵀ2P

ᵀ1

= (P1P2 · · ·Pk)ᵀ

= Pᵀ

Page 39: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundPermutation Matrices

TheoremEvery permutation matrix is an orthogonal matrix.

Proof.Write P as the product of elementary matrices corresponding torow swaps P = P1P2 · · ·Pk . Then P is invertible since each Pi isinvertible. Furthermore, we have

P−1 = (P1P2 · · ·Pk)−1

= P−1k · · ·P−12 P−11

= Pk · · ·P2P1

=

Pᵀk · · ·P

ᵀ2P

ᵀ1

= (P1P2 · · ·Pk)ᵀ

= Pᵀ

Page 40: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundPermutation Matrices

TheoremEvery permutation matrix is an orthogonal matrix.

Proof.Write P as the product of elementary matrices corresponding torow swaps P = P1P2 · · ·Pk . Then P is invertible since each Pi isinvertible. Furthermore, we have

P−1 = (P1P2 · · ·Pk)−1

= P−1k · · ·P−12 P−11

= Pk · · ·P2P1

= Pᵀk · · ·P

ᵀ2P

ᵀ1

=

(P1P2 · · ·Pk)ᵀ

= Pᵀ

Page 41: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundPermutation Matrices

TheoremEvery permutation matrix is an orthogonal matrix.

Proof.Write P as the product of elementary matrices corresponding torow swaps P = P1P2 · · ·Pk . Then P is invertible since each Pi isinvertible. Furthermore, we have

P−1 = (P1P2 · · ·Pk)−1

= P−1k · · ·P−12 P−11

= Pk · · ·P2P1

= Pᵀk · · ·P

ᵀ2P

ᵀ1

= (P1P2 · · ·Pk)ᵀ

=

Pᵀ

Page 42: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundPermutation Matrices

TheoremEvery permutation matrix is an orthogonal matrix.

Proof.Write P as the product of elementary matrices corresponding torow swaps P = P1P2 · · ·Pk . Then P is invertible since each Pi isinvertible. Furthermore, we have

P−1 = (P1P2 · · ·Pk)−1

= P−1k · · ·P−12 P−11

= Pk · · ·P2P1

= Pᵀk · · ·P

ᵀ2P

ᵀ1

= (P1P2 · · ·Pk)ᵀ

= Pᵀ

Page 43: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundForward Elimination

The PA = LU algorithm uses forward elimination.

Page 44: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundForward Elimination

Consider the row reductions 1 −2 11 0 2−1 1 0

A

R2 − R1 → R2R3 + R1 → R3−−−−−−−−−→

1 −2 10 2 10 −1 1

R3+(1/2)·R2→R3−−−−−−−−−−→

1 −2 10 2 10 0 3/2

U

The EA = U factorization is 1 0 0−1 1 01/2 1/2 1

E

1 −2 11 0 2−1 1 0

A

=

1 −2 10 2 10 0 3/2

U

Putting L = E−1 gives A = LU where 1 −2 11 0 2−1 1 0

A

=

1 0 01 1 0−1 −1/2 1

L

1 −2 10 2 10 0 3/2

U

The entries of L are the “multipliers” used in the row reductions.

Page 45: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundForward Elimination

Consider the row reductions 1 −2 11 0 2−1 1 0

A

R2 − R1 → R2R3 + R1 → R3−−−−−−−−−→

1 −2 10 2 10 −1 1

R3+(1/2)·R2→R3−−−−−−−−−−→

1 −2 10 2 10 0 3/2

U

The EA = U factorization is 1 0 0−1 1 01/2 1/2 1

E

1 −2 11 0 2−1 1 0

A

=

1 −2 10 2 10 0 3/2

U

Putting L = E−1 gives A = LU where 1 −2 11 0 2−1 1 0

A

=

1 0 01 1 0−1 −1/2 1

L

1 −2 10 2 10 0 3/2

U

The entries of L are the “multipliers” used in the row reductions.

Page 46: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundForward Elimination

Consider the row reductions 1 −2 11 0 2−1 1 0

A

R2 − R1 → R2R3 + R1 → R3−−−−−−−−−→

1 −2 10 2 10 −1 1

R3+(1/2)·R2→R3−−−−−−−−−−→

1 −2 10 2 10 0 3/2

U

The EA = U factorization is 1 0 0−1 1 01/2 1/2 1

E

1 −2 11 0 2−1 1 0

A

=

1 −2 10 2 10 0 3/2

U

Putting L = E−1 gives A = LU where 1 −2 11 0 2−1 1 0

A

=

1 0 01 1 0−1 −1/2 1

L

1 −2 10 2 10 0 3/2

U

The entries of L are the “multipliers” used in the row reductions.

Page 47: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

BackgroundForward Elimination

Consider the row reductions 1 −2 11 0 2−1 1 0

A

R2 − R1 → R2R3 + R1 → R3−−−−−−−−−→

1 −2 10 2 10 −1 1

R3+(1/2)·R2→R3−−−−−−−−−−→

1 −2 10 2 10 0 3/2

U

The EA = U factorization is 1 0 0−1 1 01/2 1/2 1

E

1 −2 11 0 2−1 1 0

A

=

1 −2 10 2 10 0 3/2

U

Putting L = E−1 gives A = LU where 1 −2 11 0 2−1 1 0

A

=

1 0 01 1 0−1 −1/2 1

L

1 −2 10 2 10 0 3/2

U

The entries of L are the “multipliers” used in the row reductions.

Page 48: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmDescription

Algorithm (PA = LU Factorization with Partial Pivoting)

Suppose A is m × n. Start with i = j = 1 and L = P = Im.

Step 1 Find k ≥ i where |akj | > 0 is as large as possible.Perform Ri ↔ Rk on A, P, and the multipliers in L.If not possible, increase j by one and repeat this step.

Step 2 Eliminate all entries below aij by subtracting suitiblemultiples mkj of Rowi . Put `kj = −mkj .

Step 3 Increase i and j by one and return to Step 1.

The algorithm terminates after the last row or column is processed.

Page 49: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmDescription

Algorithm (PA = LU Factorization with Partial Pivoting)

Suppose A is m × n. Start with i = j = 1 and L = P = Im.

Step 1 Find k ≥ i where |akj | > 0 is as large as possible.Perform Ri ↔ Rk on A, P, and the multipliers in L.If not possible, increase j by one and repeat this step.

Step 2 Eliminate all entries below aij by subtracting suitiblemultiples mkj of Rowi . Put `kj = −mkj .

Step 3 Increase i and j by one and return to Step 1.

The algorithm terminates after the last row or column is processed.

Page 50: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmDescription

Algorithm (PA = LU Factorization with Partial Pivoting)

Suppose A is m × n. Start with i = j = 1 and L = P = Im.

Step 1 Find k ≥ i where |akj | > 0 is as large as possible.Perform Ri ↔ Rk on A, P, and the multipliers in L.If not possible, increase j by one and repeat this step.

Step 2 Eliminate all entries below aij by subtracting suitiblemultiples mkj of Rowi . Put `kj = −mkj .

Step 3 Increase i and j by one and return to Step 1.

The algorithm terminates after the last row or column is processed.

Page 51: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmDescription

Algorithm (PA = LU Factorization with Partial Pivoting)

Suppose A is m × n. Start with i = j = 1 and L = P = Im.

Step 1 Find k ≥ i where |akj | > 0 is as large as possible.Perform Ri ↔ Rk on A, P, and the multipliers in L.If not possible, increase j by one and repeat this step.

Step 2 Eliminate all entries below aij by subtracting suitiblemultiples mkj of Rowi . Put `kj = −mkj .

Step 3 Increase i and j by one and return to Step 1.

The algorithm terminates after the last row or column is processed.

Page 52: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmDescription

QuestionHow does PA = LU help us solve A #»x =

b ?

AnswerA #»x =

b is equivalent to PA #»x = P#»

b . This gives LU #»x = P#»

b .

Step 1 Use “forward substitution” to solve L #»y = P#»

b for #»y .

Step 2 Use “back substitution” to solve U #»x = #»y for #»x .

Page 53: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmDescription

QuestionHow does PA = LU help us solve A #»x =

b ?

AnswerA #»x =

b is equivalent to PA #»x = P#»

b . This gives LU #»x = P#»

b .

Step 1 Use “forward substitution” to solve L #»y = P#»

b for #»y .

Step 2 Use “back substitution” to solve U #»x = #»y for #»x .

Page 54: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmDescription

QuestionHow does PA = LU help us solve A #»x =

b ?

AnswerA #»x =

b is equivalent to PA #»x = P#»

b . This gives LU #»x = P#»

b .

Step 1 Use “forward substitution” to solve L #»y = P#»

b for #»y .

Step 2 Use “back substitution” to solve U #»x = #»y for #»x .

Page 55: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2

−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3

−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3

−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3

−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 56: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2

−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3

−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3

−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3

−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 57: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3

−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3

−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3

−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 58: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 00 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3

−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3

−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3

−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 59: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 01 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3

−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3

−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3

−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 60: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3

−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3

−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3

−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 61: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3

−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3

−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3

−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 62: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3

−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3

−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 63: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3

−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3

−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 64: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3

−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3

−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 65: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3

−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3

−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 66: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3

−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3

−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 67: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3

−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 68: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3

−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 69: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3

−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 70: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3

−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 71: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3

−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 72: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 73: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 74: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 75: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 76: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 77: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 78: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 79: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 80: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

The PA = LU agorithm with partial pivoting gives

A 1 2 04 −3 −53 2 13

R1↔R2−−−−−→

U 4 −3 −51 2 03 2 13

L 1 0 0

0 1 00 0 1

P 0 1 0

1 0 00 0 1

R2 − (1/4) · R1 → R2R3 − (3/4) · R1 → R3−−−−−−−−−−−−−−−→

4 −3 −50 11/4 5/40 17/4 67/4

1 0 01/4 1 03/4 0 1

0 1 01 0 00 0 1

R2↔R3−−−−−→

4 −3 −50 17/4 67/40 11/4 5/4

1 0 03/4 1 01/4 0 1

0 1 00 0 11 0 0

R3−(11/17)·R2→R3−−−−−−−−−−−−→

4 −3 −50 17/4 67/40 0 −163/17

1 0 03/4 1 01/4 11/17 1

0 1 00 0 11 0 0

This gives the PA = LU factorization

0 1 00 0 11 0 0

P

1 2 04 −3 −53 2 13

A

=

1 0 03/4 1 01/4 11/17 1

L

4 −3 −50 17/4 67/40 0 −163/17

U

Page 81: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

For#»

b = 〈326, −326, −163〉 , the system L #»y = P#»

b is

y1 = −326 → y1 = −326(3/4) · y1 + y2 = −163 → y2 = 163/2(1/4) · y1 + (11/17) · y2 + y3 = 326 → y3 = 6031/17

For #»y = 〈−326, 163/2, 6031/17〉 , the system U #»x = #»y is

4 x1 − 3 x2 − 5 x3 = −326 → x1 = −4(17/4) · x2 + (67/4) · x3 = 163/2 → x2 = 165

(−163/17) · x3 = 6031/17

→ x3 = −37

The solution to A #»x =#»

b is #»x = 〈−4, 165, −37〉 .

Page 82: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

For#»

b = 〈326, −326, −163〉 , the system L #»y = P#»

b is

y1 = −326

→ y1 = −326

(3/4) · y1 + y2 = −163

→ y2 = 163/2

(1/4) · y1 + (11/17) · y2 + y3 = 326

→ y3 = 6031/17

For #»y = 〈−326, 163/2, 6031/17〉 , the system U #»x = #»y is

4 x1 − 3 x2 − 5 x3 = −326 → x1 = −4(17/4) · x2 + (67/4) · x3 = 163/2 → x2 = 165

(−163/17) · x3 = 6031/17

→ x3 = −37

The solution to A #»x =#»

b is #»x = 〈−4, 165, −37〉 .

Page 83: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

For#»

b = 〈326, −326, −163〉 , the system L #»y = P#»

b is

y1 = −326 → y1 = −326(3/4) · y1 + y2 = −163

→ y2 = 163/2

(1/4) · y1 + (11/17) · y2 + y3 = 326

→ y3 = 6031/17

For #»y = 〈−326, 163/2, 6031/17〉 , the system U #»x = #»y is

4 x1 − 3 x2 − 5 x3 = −326 → x1 = −4(17/4) · x2 + (67/4) · x3 = 163/2 → x2 = 165

(−163/17) · x3 = 6031/17

→ x3 = −37

The solution to A #»x =#»

b is #»x = 〈−4, 165, −37〉 .

Page 84: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

For#»

b = 〈326, −326, −163〉 , the system L #»y = P#»

b is

y1 = −326 → y1 = −326(3/4) · y1 + y2 = −163 → y2 = 163/2(1/4) · y1 + (11/17) · y2 + y3 = 326

→ y3 = 6031/17

For #»y = 〈−326, 163/2, 6031/17〉 , the system U #»x = #»y is

4 x1 − 3 x2 − 5 x3 = −326 → x1 = −4(17/4) · x2 + (67/4) · x3 = 163/2 → x2 = 165

(−163/17) · x3 = 6031/17

→ x3 = −37

The solution to A #»x =#»

b is #»x = 〈−4, 165, −37〉 .

Page 85: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

For#»

b = 〈326, −326, −163〉 , the system L #»y = P#»

b is

y1 = −326 → y1 = −326(3/4) · y1 + y2 = −163 → y2 = 163/2(1/4) · y1 + (11/17) · y2 + y3 = 326 → y3 = 6031/17

For #»y = 〈−326, 163/2, 6031/17〉 , the system U #»x = #»y is

4 x1 − 3 x2 − 5 x3 = −326 → x1 = −4(17/4) · x2 + (67/4) · x3 = 163/2 → x2 = 165

(−163/17) · x3 = 6031/17

→ x3 = −37

The solution to A #»x =#»

b is #»x = 〈−4, 165, −37〉 .

Page 86: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

For#»

b = 〈326, −326, −163〉 , the system L #»y = P#»

b is

y1 = −326 → y1 = −326(3/4) · y1 + y2 = −163 → y2 = 163/2(1/4) · y1 + (11/17) · y2 + y3 = 326 → y3 = 6031/17

For #»y = 〈−326, 163/2, 6031/17〉 , the system U #»x = #»y is

4 x1 − 3 x2 − 5 x3 = −326 → x1 = −4(17/4) · x2 + (67/4) · x3 = 163/2 → x2 = 165

(−163/17) · x3 = 6031/17

→ x3 = −37

The solution to A #»x =#»

b is #»x = 〈−4, 165, −37〉 .

Page 87: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

For#»

b = 〈326, −326, −163〉 , the system L #»y = P#»

b is

y1 = −326 → y1 = −326(3/4) · y1 + y2 = −163 → y2 = 163/2(1/4) · y1 + (11/17) · y2 + y3 = 326 → y3 = 6031/17

For #»y = 〈−326, 163/2, 6031/17〉 , the system U #»x = #»y is

4 x1 − 3 x2 − 5 x3 = −326

→ x1 = −4

(17/4) · x2 + (67/4) · x3 = 163/2

→ x2 = 165

(−163/17) · x3 = 6031/17

→ x3 = −37

The solution to A #»x =#»

b is #»x = 〈−4, 165, −37〉 .

Page 88: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

For#»

b = 〈326, −326, −163〉 , the system L #»y = P#»

b is

y1 = −326 → y1 = −326(3/4) · y1 + y2 = −163 → y2 = 163/2(1/4) · y1 + (11/17) · y2 + y3 = 326 → y3 = 6031/17

For #»y = 〈−326, 163/2, 6031/17〉 , the system U #»x = #»y is

4 x1 − 3 x2 − 5 x3 = −326

→ x1 = −4

(17/4) · x2 + (67/4) · x3 = 163/2

→ x2 = 165

(−163/17) · x3 = 6031/17 → x3 = −37

The solution to A #»x =#»

b is #»x = 〈−4, 165, −37〉 .

Page 89: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

For#»

b = 〈326, −326, −163〉 , the system L #»y = P#»

b is

y1 = −326 → y1 = −326(3/4) · y1 + y2 = −163 → y2 = 163/2(1/4) · y1 + (11/17) · y2 + y3 = 326 → y3 = 6031/17

For #»y = 〈−326, 163/2, 6031/17〉 , the system U #»x = #»y is

4 x1 − 3 x2 − 5 x3 = −326

→ x1 = −4

(17/4) · x2 + (67/4) · x3 = 163/2 → x2 = 165(−163/17) · x3 = 6031/17 → x3 = −37

The solution to A #»x =#»

b is #»x = 〈−4, 165, −37〉 .

Page 90: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

For#»

b = 〈326, −326, −163〉 , the system L #»y = P#»

b is

y1 = −326 → y1 = −326(3/4) · y1 + y2 = −163 → y2 = 163/2(1/4) · y1 + (11/17) · y2 + y3 = 326 → y3 = 6031/17

For #»y = 〈−326, 163/2, 6031/17〉 , the system U #»x = #»y is

4 x1 − 3 x2 − 5 x3 = −326 → x1 = −4(17/4) · x2 + (67/4) · x3 = 163/2 → x2 = 165

(−163/17) · x3 = 6031/17 → x3 = −37

The solution to A #»x =#»

b is #»x = 〈−4, 165, −37〉 .

Page 91: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

The PA = LU AlgorithmExample

For#»

b = 〈326, −326, −163〉 , the system L #»y = P#»

b is

y1 = −326 → y1 = −326(3/4) · y1 + y2 = −163 → y2 = 163/2(1/4) · y1 + (11/17) · y2 + y3 = 326 → y3 = 6031/17

For #»y = 〈−326, 163/2, 6031/17〉 , the system U #»x = #»y is

4 x1 − 3 x2 − 5 x3 = −326 → x1 = −4(17/4) · x2 + (67/4) · x3 = 163/2 → x2 = 165

(−163/17) · x3 = 6031/17 → x3 = −37

The solution to A #»x =#»

b is #»x = 〈−4, 165, −37〉 .

Page 92: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

NoteThe U in PA = LU factorization is obtained by performingelementary row operations on A.

Aop1−−→ A1

op2−−→ A2op3−−→ · · · opr−−→ U

This means that A and U are row equivalent. In particular,rank(A) = rank(U) and nullity(A) = nullity(U).

Page 93: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

NoteThe U in PA = LU factorization is obtained by performingelementary row operations on A.

A

op1−−→ A1op2−−→ A2

op3−−→ · · · opr−−→ U

This means that A and U are row equivalent. In particular,rank(A) = rank(U) and nullity(A) = nullity(U).

Page 94: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

NoteThe U in PA = LU factorization is obtained by performingelementary row operations on A.

Aop1−−→ A1

op2−−→ A2op3−−→ · · · opr−−→ U

This means that A and U are row equivalent. In particular,rank(A) = rank(U) and nullity(A) = nullity(U).

Page 95: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

NoteThe U in PA = LU factorization is obtained by performingelementary row operations on A.

Aop1−−→ A1

op2−−→ A2

op3−−→ · · · opr−−→ U

This means that A and U are row equivalent. In particular,rank(A) = rank(U) and nullity(A) = nullity(U).

Page 96: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

NoteThe U in PA = LU factorization is obtained by performingelementary row operations on A.

Aop1−−→ A1

op2−−→ A2op3−−→ · · ·

opr−−→ U

This means that A and U are row equivalent. In particular,rank(A) = rank(U) and nullity(A) = nullity(U).

Page 97: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

NoteThe U in PA = LU factorization is obtained by performingelementary row operations on A.

Aop1−−→ A1

op2−−→ A2op3−−→ · · · opr−−→ U

This means that A and U are row equivalent. In particular,rank(A) = rank(U) and nullity(A) = nullity(U).

Page 98: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

NoteThe U in PA = LU factorization is obtained by performingelementary row operations on A.

Aop1−−→ A1

op2−−→ A2op3−−→ · · · opr−−→ U

This means that A and U are row equivalent.

In particular,rank(A) = rank(U) and nullity(A) = nullity(U).

Page 99: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

NoteThe U in PA = LU factorization is obtained by performingelementary row operations on A.

Aop1−−→ A1

op2−−→ A2op3−−→ · · · opr−−→ U

This means that A and U are row equivalent. In particular,rank(A) =

rank(U) and nullity(A) = nullity(U).

Page 100: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

NoteThe U in PA = LU factorization is obtained by performingelementary row operations on A.

Aop1−−→ A1

op2−−→ A2op3−−→ · · · opr−−→ U

This means that A and U are row equivalent. In particular,rank(A) = rank(U)

and nullity(A) = nullity(U).

Page 101: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

NoteThe U in PA = LU factorization is obtained by performingelementary row operations on A.

Aop1−−→ A1

op2−−→ A2op3−−→ · · · opr−−→ U

This means that A and U are row equivalent. In particular,rank(A) = rank(U) and nullity(A) =

nullity(U).

Page 102: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

NoteThe U in PA = LU factorization is obtained by performingelementary row operations on A.

Aop1−−→ A1

op2−−→ A2op3−−→ · · · opr−−→ U

This means that A and U are row equivalent. In particular,rank(A) = rank(U) and nullity(A) = nullity(U).

Page 103: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

TheoremGiven PA = LU, we have

rank(A) = rank(U) nullity(A) = nullity(U)

Advantage

We can compute U faster than we can compute rref(A). ThePA = LU algorithm improves our rank algorithm!

Page 104: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

TheoremGiven PA = LU, we have

rank(A) = rank(U) nullity(A) = nullity(U)

Advantage

We can compute U faster than we can compute rref(A).

ThePA = LU algorithm improves our rank algorithm!

Page 105: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

TheoremGiven PA = LU, we have

rank(A) = rank(U) nullity(A) = nullity(U)

Advantage

We can compute U faster than we can compute rref(A). ThePA = LU algorithm improves our rank algorithm!

Page 106: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

Example

Consider the PA = LU factorization

P0 1 0 00 0 0 11 0 0 00 0 1 0

A

1 −5 −4 −21 −18 −14 −6−2 11 16 68 54 45 −2

0 0 1 3 2 2 −2−2 13 16 72 58 47 2

=

L1 0 0 01 1 0 0

−1/2 1/4 1 00 0 1/4 1

U

−2 11 16 68 54 45 −20 2 0 4 4 2 40 0 4 12 8 8 −80 0 0 0 0 0 0

Here, we have

rank(A) = 3 nullity(A) = 4

Page 107: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

Example

Consider the PA = LU factorization

P0 1 0 00 0 0 11 0 0 00 0 1 0

A

1 −5 −4 −21 −18 −14 −6−2 11 16 68 54 45 −2

0 0 1 3 2 2 −2−2 13 16 72 58 47 2

=

L1 0 0 01 1 0 0

−1/2 1/4 1 00 0 1/4 1

U

−2 11 16 68 54 45 −20 2 0 4 4 2 40 0 4 12 8 8 −80 0 0 0 0 0 0

Here, we have

rank(A) = 3 nullity(A) = 4

Page 108: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

Example

Consider the PA = LU factorization

P0 1 0 00 0 0 11 0 0 00 0 1 0

A

1 −5 −4 −21 −18 −14 −6−2 11 16 68 54 45 −2

0 0 1 3 2 2 −2−2 13 16 72 58 47 2

=

L1 0 0 01 1 0 0

−1/2 1/4 1 00 0 1/4 1

U

−2 11 16 68 54 45 −20 2 0 4 4 2 40 0 4 12 8 8 −80 0 0 0 0 0 0

Here, we have

rank(A) =

3 nullity(A) = 4

Page 109: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

Example

Consider the PA = LU factorization

P0 1 0 00 0 0 11 0 0 00 0 1 0

A

1 −5 −4 −21 −18 −14 −6−2 11 16 68 54 45 −2

0 0 1 3 2 2 −2−2 13 16 72 58 47 2

=

L1 0 0 01 1 0 0

−1/2 1/4 1 00 0 1/4 1

U

−2 11 16 68 54 45 −20 2 0 4 4 2 40 0 4 12 8 8 −80 0 0 0 0 0 0

Here, we have

rank(A) = 3

nullity(A) = 4

Page 110: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

Example

Consider the PA = LU factorization

P0 1 0 00 0 0 11 0 0 00 0 1 0

A

1 −5 −4 −21 −18 −14 −6−2 11 16 68 54 45 −2

0 0 1 3 2 2 −2−2 13 16 72 58 47 2

=

L1 0 0 01 1 0 0

−1/2 1/4 1 00 0 1/4 1

U

−2 11 16 68 54 45 −20 2 0 4 4 2 40 0 4 12 8 8 −80 0 0 0 0 0 0

Here, we have

rank(A) = 3 nullity(A) =

4

Page 111: The PA=LU Factorization - Math 218bfitzpat/teaching/218s20/...Background \Big Picture" Overview of PA = LU The PA = LU algorithm produces a factorization used in numerical linear algebra

Row EquivalencyA and U are Row-Equivalent

Example

Consider the PA = LU factorization

P0 1 0 00 0 0 11 0 0 00 0 1 0

A

1 −5 −4 −21 −18 −14 −6−2 11 16 68 54 45 −2

0 0 1 3 2 2 −2−2 13 16 72 58 47 2

=

L1 0 0 01 1 0 0

−1/2 1/4 1 00 0 1/4 1

U

−2 11 16 68 54 45 −20 2 0 4 4 2 40 0 4 12 8 8 −80 0 0 0 0 0 0

Here, we have

rank(A) = 3 nullity(A) = 4