lecture 4: lu decomposition and matrix inversethanghuynh.org/teaching/math102_lecture_4.pdfgaussian...

Post on 26-Mar-2018

214 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Lecture 4: 𝐿𝑈 Decomposition and MatrixInverse

Thang Huynh, UC San Diego1/17/2018

Gaussian elimination revisited

▶ Example. Keeping track of the elementary matrices duringGaussian elimination on 𝐎:

𝐎 = ⎡⎢⎣2 14 −6

⎀⎥⎊

𝐞𝐎 = ⎡⎢⎣

1 0−2 1

⎀⎥⎊

⎡⎢⎣2 14 −6

⎀⎥⎊

= ⎡⎢⎣2 10 −8

⎀⎥⎊

.

Note that𝐎 = 𝐞−1 ⎡⎢

⎣2 10 −8

⎀⎥⎊

= ⎡⎢⎣1 02 1

⎀⎥⎊

⎡⎢⎣2 10 −8

⎀⎥⎊

We factored 𝐎 as the product of a lower and upper triangularmatrix! We say that 𝐎 has triangular factorization.

1

Gaussian elimination revisited

▶ Example. Keeping track of the elementary matrices duringGaussian elimination on 𝐎:

𝐎 = ⎡⎢⎣2 14 −6

⎀⎥⎊

𝐞𝐎 = ⎡⎢⎣

1 0−2 1

⎀⎥⎊

⎡⎢⎣2 14 −6

⎀⎥⎊

= ⎡⎢⎣2 10 −8

⎀⎥⎊

.

Note that𝐎 = 𝐞−1 ⎡⎢

⎣2 10 −8

⎀⎥⎊

= ⎡⎢⎣1 02 1

⎀⎥⎊

⎡⎢⎣2 10 −8

⎀⎥⎊

We factored 𝐎 as the product of a lower and upper triangularmatrix! We say that 𝐎 has triangular factorization.

1

Gaussian elimination revisited

▶ Example. Keeping track of the elementary matrices duringGaussian elimination on 𝐎:

𝐎 = ⎡⎢⎣2 14 −6

⎀⎥⎊

𝐞𝐎 = ⎡⎢⎣

1 0−2 1

⎀⎥⎊

⎡⎢⎣2 14 −6

⎀⎥⎊

= ⎡⎢⎣2 10 −8

⎀⎥⎊

.

Note that𝐎 = 𝐞−1 ⎡⎢

⎣2 10 −8

⎀⎥⎊

= ⎡⎢⎣1 02 1

⎀⎥⎊

⎡⎢⎣2 10 −8

⎀⎥⎊

We factored 𝐎 as the product of a lower and upper triangularmatrix! We say that 𝐎 has triangular factorization.

1

Gaussian elimination revisited

▶ Example. Keeping track of the elementary matrices duringGaussian elimination on 𝐎:

𝐎 = ⎡⎢⎣2 14 −6

⎀⎥⎊

𝐞𝐎 = ⎡⎢⎣

1 0−2 1

⎀⎥⎊

⎡⎢⎣2 14 −6

⎀⎥⎊

= ⎡⎢⎣2 10 −8

⎀⎥⎊

.

Note that𝐎 = 𝐞−1 ⎡⎢

⎣2 10 −8

⎀⎥⎊

= ⎡⎢⎣1 02 1

⎀⎥⎊

⎡⎢⎣2 10 −8

⎀⎥⎊

We factored 𝐎 as the product of a lower and upper triangularmatrix! We say that 𝐎 has triangular factorization.

1

Gaussian elimination revisited

𝐎 = 𝐿𝑈 is known as the LU decomposition of 𝐎.

▶ Definition.lower triangular

⎡⎢⎢⎢⎢⎢⎢⎣

∗ 0 0 0 0∗ ∗ 0 0 0∗ ∗ ∗ 0 0∗ ∗ ∗ ∗ 0∗ ∗ ∗ ∗ ∗

⎀⎥⎥⎥⎥⎥⎥⎊

upper triangular

⎡⎢⎢⎢⎢⎢⎢⎣

∗ ∗ ∗ ∗ ∗0 ∗ ∗ ∗ ∗0 0 ∗ ∗ ∗0 0 0 ∗ ∗0 0 0 0 ∗

⎀⎥⎥⎥⎥⎥⎥⎊

2

Gaussian elimination revisited

𝐎 = 𝐿𝑈 is known as the LU decomposition of 𝐎.

▶ Definition.lower triangular

⎡⎢⎢⎢⎢⎢⎢⎣

∗ 0 0 0 0∗ ∗ 0 0 0∗ ∗ ∗ 0 0∗ ∗ ∗ ∗ 0∗ ∗ ∗ ∗ ∗

⎀⎥⎥⎥⎥⎥⎥⎊

upper triangular

⎡⎢⎢⎢⎢⎢⎢⎣

∗ ∗ ∗ ∗ ∗0 ∗ ∗ ∗ ∗0 0 ∗ ∗ ∗0 0 0 ∗ ∗0 0 0 0 ∗

⎀⎥⎥⎥⎥⎥⎥⎊

2

𝐿𝑈 decompostion

▶ Example. Factor 𝐎 =⎡⎢⎢⎣

2 1 14 −6 0

−2 7 2

⎀⎥⎥⎊

as 𝐎 = 𝐿𝑈.

▶ Solution.

𝐞1𝐎 =⎡⎢⎢⎣

1 0 0−2 1 00 0 1

⎀⎥⎥⎊

⎡⎢⎢⎣

2 1 14 −6 0

−2 7 2

⎀⎥⎥⎊

=⎡⎢⎢⎣

2 1 10 −8 −2

−2 7 2

⎀⎥⎥⎊

𝐞2(𝐞1𝐎) =⎡⎢⎢⎣

1 0 00 1 01 0 1

⎀⎥⎥⎊

⎡⎢⎢⎣

2 1 10 −8 −2

−2 7 2

⎀⎥⎥⎊

=⎡⎢⎢⎣

2 1 10 −8 −20 8 3

⎀⎥⎥⎊

𝐞3𝐞2𝐞1𝐎 =⎡⎢⎢⎣

1 0 00 1 00 1 1

⎀⎥⎥⎊

⎡⎢⎢⎣

2 1 10 −8 −20 8 3

⎀⎥⎥⎊

=⎡⎢⎢⎣

2 1 10 −8 −20 0 1

⎀⎥⎥⎊

= 𝑈

3

𝐿𝑈 decompostion

▶ Example. Factor 𝐎 =⎡⎢⎢⎣

2 1 14 −6 0

−2 7 2

⎀⎥⎥⎊

as 𝐎 = 𝐿𝑈.

▶ Solution.

𝐞1𝐎 =⎡⎢⎢⎣

1 0 0−2 1 00 0 1

⎀⎥⎥⎊

⎡⎢⎢⎣

2 1 14 −6 0

−2 7 2

⎀⎥⎥⎊

=⎡⎢⎢⎣

2 1 10 −8 −2

−2 7 2

⎀⎥⎥⎊

𝐞2(𝐞1𝐎) =⎡⎢⎢⎣

1 0 00 1 01 0 1

⎀⎥⎥⎊

⎡⎢⎢⎣

2 1 10 −8 −2

−2 7 2

⎀⎥⎥⎊

=⎡⎢⎢⎣

2 1 10 −8 −20 8 3

⎀⎥⎥⎊

𝐞3𝐞2𝐞1𝐎 =⎡⎢⎢⎣

1 0 00 1 00 1 1

⎀⎥⎥⎊

⎡⎢⎢⎣

2 1 10 −8 −20 8 3

⎀⎥⎥⎊

=⎡⎢⎢⎣

2 1 10 −8 −20 0 1

⎀⎥⎥⎊

= 𝑈

3

𝐿𝑈 decompostion

▶ Example. Factor 𝐎 =⎡⎢⎢⎣

2 1 14 −6 0

−2 7 2

⎀⎥⎥⎊

as 𝐎 = 𝐿𝑈.

▶ Solution.

𝐞1𝐎 =⎡⎢⎢⎣

1 0 0−2 1 00 0 1

⎀⎥⎥⎊

⎡⎢⎢⎣

2 1 14 −6 0

−2 7 2

⎀⎥⎥⎊

=⎡⎢⎢⎣

2 1 10 −8 −2

−2 7 2

⎀⎥⎥⎊

𝐞2(𝐞1𝐎) =⎡⎢⎢⎣

1 0 00 1 01 0 1

⎀⎥⎥⎊

⎡⎢⎢⎣

2 1 10 −8 −2

−2 7 2

⎀⎥⎥⎊

=⎡⎢⎢⎣

2 1 10 −8 −20 8 3

⎀⎥⎥⎊

𝐞3𝐞2𝐞1𝐎 =⎡⎢⎢⎣

1 0 00 1 00 1 1

⎀⎥⎥⎊

⎡⎢⎢⎣

2 1 10 −8 −20 8 3

⎀⎥⎥⎊

=⎡⎢⎢⎣

2 1 10 −8 −20 0 1

⎀⎥⎥⎊

= 𝑈

3

𝐿𝑈 decompostion

▶ Example. Factor 𝐎 =⎡⎢⎢⎣

2 1 14 −6 0

−2 7 2

⎀⎥⎥⎊

as 𝐎 = 𝐿𝑈.

▶ Solution.

𝐞1𝐎 =⎡⎢⎢⎣

1 0 0−2 1 00 0 1

⎀⎥⎥⎊

⎡⎢⎢⎣

2 1 14 −6 0

−2 7 2

⎀⎥⎥⎊

=⎡⎢⎢⎣

2 1 10 −8 −2

−2 7 2

⎀⎥⎥⎊

𝐞2(𝐞1𝐎) =⎡⎢⎢⎣

1 0 00 1 01 0 1

⎀⎥⎥⎊

⎡⎢⎢⎣

2 1 10 −8 −2

−2 7 2

⎀⎥⎥⎊

=⎡⎢⎢⎣

2 1 10 −8 −20 8 3

⎀⎥⎥⎊

𝐞3𝐞2𝐞1𝐎 =⎡⎢⎢⎣

1 0 00 1 00 1 1

⎀⎥⎥⎊

⎡⎢⎢⎣

2 1 10 −8 −20 8 3

⎀⎥⎥⎊

=⎡⎢⎢⎣

2 1 10 −8 −20 0 1

⎀⎥⎥⎊

= 𝑈

3

𝐿𝑈 decompostion

𝐞3𝐞2𝐞1𝐎 = 𝑈

⟹ 𝐎 = 𝐞−11 𝐞−1

2 𝐞−13 𝑈

The factor 𝐿 is given by

𝐿 = 𝐞−11 𝐞−1

2 𝐞−13

=⎡⎢⎢⎣

1 0 02 1 00 0 1

⎀⎥⎥⎊

⎡⎢⎢⎣

1 0 00 1 0

−1 0 1

⎀⎥⎥⎊

⎡⎢⎢⎣

1 0 00 1 00 −1 1

⎀⎥⎥⎊

=⎡⎢⎢⎣

1 0 02 1 0

−1 −1 1

⎀⎥⎥⎊

4

𝐿𝑈 decompostion

𝐞3𝐞2𝐞1𝐎 = 𝑈 ⟹ 𝐎 = 𝐞−11 𝐞−1

2 𝐞−13 𝑈

The factor 𝐿 is given by

𝐿 = 𝐞−11 𝐞−1

2 𝐞−13

=⎡⎢⎢⎣

1 0 02 1 00 0 1

⎀⎥⎥⎊

⎡⎢⎢⎣

1 0 00 1 0

−1 0 1

⎀⎥⎥⎊

⎡⎢⎢⎣

1 0 00 1 00 −1 1

⎀⎥⎥⎊

=⎡⎢⎢⎣

1 0 02 1 0

−1 −1 1

⎀⎥⎥⎊

4

𝐿𝑈 decompostion

𝐞3𝐞2𝐞1𝐎 = 𝑈 ⟹ 𝐎 = 𝐞−11 𝐞−1

2 𝐞−13 𝑈

The factor 𝐿 is given by

𝐿 = 𝐞−11 𝐞−1

2 𝐞−13

=⎡⎢⎢⎣

1 0 02 1 00 0 1

⎀⎥⎥⎊

⎡⎢⎢⎣

1 0 00 1 0

−1 0 1

⎀⎥⎥⎊

⎡⎢⎢⎣

1 0 00 1 00 −1 1

⎀⎥⎥⎊

=⎡⎢⎢⎣

1 0 02 1 0

−1 −1 1

⎀⎥⎥⎊

4

𝐿𝑈 decompostion

We found the following 𝐿𝑈 decomposition of 𝐎:

𝐎 =⎡⎢⎢⎣

2 1 14 −6 0

−2 7 2

⎀⎥⎥⎊

= 𝐿𝑈 =⎡⎢⎢⎣

1 0 02 1 0

−1 −1 1

⎀⎥⎥⎊

⎡⎢⎢⎣

2 1 10 −8 −20 0 1

⎀⎥⎥⎊

.

5

Why 𝐿𝑈 decomposition?Once we have 𝐎 = 𝐿𝑈, it is simple to solve 𝐎𝑥𝑥𝑥 = 𝑏𝑏𝑏.

𝐎𝑥𝑥𝑥 = 𝑏𝑏𝑏𝐿(𝑈𝑥𝑥𝑥) = 𝑏𝑏𝑏

𝐿𝑐𝑐𝑐 = 𝑏𝑏𝑏 and 𝑈𝑥𝑥𝑥 = 𝑐𝑐𝑐.Both of the final systems are triangular and hence easily solved:

• 𝐿𝑐𝑐𝑐 = 𝑏𝑏𝑏 by forward substitution to find 𝑐𝑐𝑐, and then• 𝑈𝑥𝑥𝑥 = 𝑐𝑐𝑐 by backward substitution to find 𝑥𝑥𝑥.

▶ Example. Solve

⎡⎢⎢⎣

2 1 14 −6 0

−2 7 2

⎀⎥⎥⎊

𝑥𝑥𝑥 =⎡⎢⎢⎣

410−3

⎀⎥⎥⎊

.

6

Why 𝐿𝑈 decomposition?Once we have 𝐎 = 𝐿𝑈, it is simple to solve 𝐎𝑥𝑥𝑥 = 𝑏𝑏𝑏.

𝐎𝑥𝑥𝑥 = 𝑏𝑏𝑏𝐿(𝑈𝑥𝑥𝑥) = 𝑏𝑏𝑏

𝐿𝑐𝑐𝑐 = 𝑏𝑏𝑏 and 𝑈𝑥𝑥𝑥 = 𝑐𝑐𝑐.Both of the final systems are triangular and hence easily solved:

• 𝐿𝑐𝑐𝑐 = 𝑏𝑏𝑏 by forward substitution to find 𝑐𝑐𝑐, and then• 𝑈𝑥𝑥𝑥 = 𝑐𝑐𝑐 by backward substitution to find 𝑥𝑥𝑥.

▶ Example. Solve

⎡⎢⎢⎣

2 1 14 −6 0

−2 7 2

⎀⎥⎥⎊

𝑥𝑥𝑥 =⎡⎢⎢⎣

410−3

⎀⎥⎥⎊

.

6

Why 𝐿𝑈 decomposition?Once we have 𝐎 = 𝐿𝑈, it is simple to solve 𝐎𝑥𝑥𝑥 = 𝑏𝑏𝑏.

𝐎𝑥𝑥𝑥 = 𝑏𝑏𝑏𝐿(𝑈𝑥𝑥𝑥) = 𝑏𝑏𝑏

𝐿𝑐𝑐𝑐 = 𝑏𝑏𝑏 and 𝑈𝑥𝑥𝑥 = 𝑐𝑐𝑐.Both of the final systems are triangular and hence easily solved:

• 𝐿𝑐𝑐𝑐 = 𝑏𝑏𝑏 by forward substitution to find 𝑐𝑐𝑐, and then• 𝑈𝑥𝑥𝑥 = 𝑐𝑐𝑐 by backward substitution to find 𝑥𝑥𝑥.

▶ Example. Solve

⎡⎢⎢⎣

2 1 14 −6 0

−2 7 2

⎀⎥⎥⎊

𝑥𝑥𝑥 =⎡⎢⎢⎣

410−3

⎀⎥⎥⎊

.

6

The inverse of a matrix

▶ Definition. An 𝑛 × 𝑛 matrix 𝐎 is invertible if there is a matrix 𝐵such that

𝐎𝐵 = 𝐵𝐎 = 𝐌𝑛×𝑛.

In that case, 𝐵 is the inverse of 𝐎 and is denoted by 𝐎−1.

▶ Remark.

• The inverse of a matrix is unique. (Why?)• Do not write 𝐎

𝐵 .

7

The inverse of a matrix

▶ Definition. An 𝑛 × 𝑛 matrix 𝐎 is invertible if there is a matrix 𝐵such that

𝐎𝐵 = 𝐵𝐎 = 𝐌𝑛×𝑛.

In that case, 𝐵 is the inverse of 𝐎 and is denoted by 𝐎−1.▶ Remark.

• The inverse of a matrix is unique. (Why?)

• Do not write 𝐎𝐵 .

7

The inverse of a matrix

▶ Definition. An 𝑛 × 𝑛 matrix 𝐎 is invertible if there is a matrix 𝐵such that

𝐎𝐵 = 𝐵𝐎 = 𝐌𝑛×𝑛.

In that case, 𝐵 is the inverse of 𝐎 and is denoted by 𝐎−1.▶ Remark.

• The inverse of a matrix is unique. (Why?)• Do not write 𝐎

𝐵 .

7

The inverse of a matrix

▶ Example. Let 𝐎 = ⎡⎢⎣𝑎 𝑏𝑐 𝑑

⎀⎥⎊

. If 𝑎𝑑 − 𝑏𝑐 ≠ 0, then

𝐎−1 = 1𝑎𝑑 − 𝑏𝑐

⎡⎢⎣

𝑑 −𝑏−𝑐 𝑎

⎀⎥⎊

.

▶ Example. The matrix 𝐎 = ⎡⎢⎣0 10 0

⎀⎥⎊

is not invertible.

▶ Example. A 2 × 2 matrix ⎡⎢⎣𝑎 𝑏𝑐 𝑑

⎀⎥⎊

is invertible if and only if

𝑎𝑑 − 𝑏𝑐 ≠ 0.

8

The inverse of a matrix

▶ Example. Let 𝐎 = ⎡⎢⎣𝑎 𝑏𝑐 𝑑

⎀⎥⎊

. If 𝑎𝑑 − 𝑏𝑐 ≠ 0, then

𝐎−1 = 1𝑎𝑑 − 𝑏𝑐

⎡⎢⎣

𝑑 −𝑏−𝑐 𝑎

⎀⎥⎊

.

▶ Example. The matrix 𝐎 = ⎡⎢⎣0 10 0

⎀⎥⎊

is not invertible.

▶ Example. A 2 × 2 matrix ⎡⎢⎣𝑎 𝑏𝑐 𝑑

⎀⎥⎊

is invertible if and only if

𝑎𝑑 − 𝑏𝑐 ≠ 0.

8

The inverse of a matrix

▶ Example. Let 𝐎 = ⎡⎢⎣𝑎 𝑏𝑐 𝑑

⎀⎥⎊

. If 𝑎𝑑 − 𝑏𝑐 ≠ 0, then

𝐎−1 = 1𝑎𝑑 − 𝑏𝑐

⎡⎢⎣

𝑑 −𝑏−𝑐 𝑎

⎀⎥⎊

.

▶ Example. The matrix 𝐎 = ⎡⎢⎣0 10 0

⎀⎥⎊

is not invertible.

▶ Example. A 2 × 2 matrix ⎡⎢⎣𝑎 𝑏𝑐 𝑑

⎀⎥⎊

is invertible if and only if

𝑎𝑑 − 𝑏𝑐 ≠ 0.

8

The inverse of a matrix

Suppose 𝐎 and 𝐵 are invertible. Then

• 𝐎−1 is invertible and (𝐎−1)−1 = 𝐎.

• 𝐎𝑇 is invertible and (𝐎𝑇 )−1 = (𝐎−1)𝑇 .• 𝐎𝐵 is invertible and (𝐎𝐵)−1 = 𝐵−1𝐎−1. (Why?)

9

The inverse of a matrix

Suppose 𝐎 and 𝐵 are invertible. Then

• 𝐎−1 is invertible and (𝐎−1)−1 = 𝐎.• 𝐎𝑇 is invertible and (𝐎𝑇 )−1 = (𝐎−1)𝑇 .

• 𝐎𝐵 is invertible and (𝐎𝐵)−1 = 𝐵−1𝐎−1. (Why?)

9

The inverse of a matrix

Suppose 𝐎 and 𝐵 are invertible. Then

• 𝐎−1 is invertible and (𝐎−1)−1 = 𝐎.• 𝐎𝑇 is invertible and (𝐎𝑇 )−1 = (𝐎−1)𝑇 .• 𝐎𝐵 is invertible and (𝐎𝐵)−1 = 𝐵−1𝐎−1. (Why?)

9

Solving systems using matrix inverse

Theorem. Let 𝐎 be invertible. Then the system 𝐎𝑥𝑥𝑥 = 𝑏𝑏𝑏 has theunique solution 𝑥𝑥𝑥 = 𝐎−1𝑏𝑏𝑏.

10

Computing the inverse

▶ To solve 𝐎𝑥𝑥𝑥 = 𝑏𝑏𝑏, we do row reduction on [ 𝐎 ∣ 𝑏 ].

▶ To solve 𝐎𝑋 = 𝐌, we do row reduction on [ 𝐎 ∣ 𝐌 ].▶ To compute 𝐎−1 (The Gauss-Jordan Method):

• Form the augmented matrix [ 𝐎 ∣ 𝐌 ].• Compute the reduced echelon form.• If 𝐎 is invertible, the result is of the form [ 𝐌 ∣ 𝐎−1 ].

11

Computing the inverse

▶ To solve 𝐎𝑥𝑥𝑥 = 𝑏𝑏𝑏, we do row reduction on [ 𝐎 ∣ 𝑏 ].▶ To solve 𝐎𝑋 = 𝐌, we do row reduction on [ 𝐎 ∣ 𝐌 ].

▶ To compute 𝐎−1 (The Gauss-Jordan Method):

• Form the augmented matrix [ 𝐎 ∣ 𝐌 ].• Compute the reduced echelon form.• If 𝐎 is invertible, the result is of the form [ 𝐌 ∣ 𝐎−1 ].

11

Computing the inverse

▶ To solve 𝐎𝑥𝑥𝑥 = 𝑏𝑏𝑏, we do row reduction on [ 𝐎 ∣ 𝑏 ].▶ To solve 𝐎𝑋 = 𝐌, we do row reduction on [ 𝐎 ∣ 𝐌 ].▶ To compute 𝐎−1 (The Gauss-Jordan Method):

• Form the augmented matrix [ 𝐎 ∣ 𝐌 ].• Compute the reduced echelon form.• If 𝐎 is invertible, the result is of the form [ 𝐌 ∣ 𝐎−1 ].

11

Computing the inverse

▶ Example. Find the inverse of 𝐎 =⎡⎢⎢⎣

2 1 14 −6 0

−2 7 2

⎀⎥⎥⎊, if it exists.

▶ Solution.

⎡⎢⎢⎣

2 1 1 1 0 04 −6 0 0 1 0

−2 7 2 0 0 1

⎀⎥⎥⎊

𝑅2⟶𝑅2−2𝑅1−−−−−−−−−−→𝑅3⟶𝑅3+𝑅1

⎡⎢⎢⎣

2 1 1 1 0 00 −8 −2 −2 1 00 8 3 1 0 1

⎀⎥⎥⎊

𝑅3⟶𝑅3+𝑅2−−−−−−−−−→⎡⎢⎢⎣

2 1 1 1 0 00 −8 −2 −2 1 00 0 1 −1 1 1

⎀⎥⎥⎊

−−−−−−→ 


12

Computing the inverse

▶ Example. Find the inverse of 𝐎 =⎡⎢⎢⎣

2 1 14 −6 0

−2 7 2

⎀⎥⎥⎊, if it exists.

▶ Solution.

⎡⎢⎢⎣

2 1 1 1 0 04 −6 0 0 1 0

−2 7 2 0 0 1

⎀⎥⎥⎊

𝑅2⟶𝑅2−2𝑅1−−−−−−−−−−→𝑅3⟶𝑅3+𝑅1

⎡⎢⎢⎣

2 1 1 1 0 00 −8 −2 −2 1 00 8 3 1 0 1

⎀⎥⎥⎊

𝑅3⟶𝑅3+𝑅2−−−−−−−−−→⎡⎢⎢⎣

2 1 1 1 0 00 −8 −2 −2 1 00 0 1 −1 1 1

⎀⎥⎥⎊

−−−−−−→ 


12

Computing the inverse

▶ Example. Find the inverse of 𝐎 =⎡⎢⎢⎣

2 1 14 −6 0

−2 7 2

⎀⎥⎥⎊, if it exists.

▶ Solution.

⎡⎢⎢⎣

2 1 1 1 0 04 −6 0 0 1 0

−2 7 2 0 0 1

⎀⎥⎥⎊

𝑅2⟶𝑅2−2𝑅1−−−−−−−−−−→𝑅3⟶𝑅3+𝑅1

⎡⎢⎢⎣

2 1 1 1 0 00 −8 −2 −2 1 00 8 3 1 0 1

⎀⎥⎥⎊

𝑅3⟶𝑅3+𝑅2−−−−−−−−−→⎡⎢⎢⎣

2 1 1 1 0 00 −8 −2 −2 1 00 0 1 −1 1 1

⎀⎥⎥⎊

−−−−−−→ 


12

Computing the inverse

▶ Example. Find the inverse of 𝐎 =⎡⎢⎢⎣

2 1 14 −6 0

−2 7 2

⎀⎥⎥⎊, if it exists.

▶ Solution.

⎡⎢⎢⎣

2 1 1 1 0 04 −6 0 0 1 0

−2 7 2 0 0 1

⎀⎥⎥⎊

𝑅2⟶𝑅2−2𝑅1−−−−−−−−−−→𝑅3⟶𝑅3+𝑅1

⎡⎢⎢⎣

2 1 1 1 0 00 −8 −2 −2 1 00 8 3 1 0 1

⎀⎥⎥⎊

𝑅3⟶𝑅3+𝑅2−−−−−−−−−→⎡⎢⎢⎣

2 1 1 1 0 00 −8 −2 −2 1 00 0 1 −1 1 1

⎀⎥⎥⎊

−−−−−−→ 


12

Computing the inverse

▶ Example. Find the inverse of 𝐎 =⎡⎢⎢⎣

2 1 14 −6 0

−2 7 2

⎀⎥⎥⎊, if it exists.

▶ Solution.

⎡⎢⎢⎣

2 1 1 1 0 04 −6 0 0 1 0

−2 7 2 0 0 1

⎀⎥⎥⎊

𝑅2⟶𝑅2−2𝑅1−−−−−−−−−−→𝑅3⟶𝑅3+𝑅1

⎡⎢⎢⎣

2 1 1 1 0 00 −8 −2 −2 1 00 8 3 1 0 1

⎀⎥⎥⎊

𝑅3⟶𝑅3+𝑅2−−−−−−−−−→⎡⎢⎢⎣

2 1 1 1 0 00 −8 −2 −2 1 00 0 1 −1 1 1

⎀⎥⎥⎊

−−−−−−→ 


12

Computing the inverse

−−−−−−→⎡⎢⎢⎣

1 0 0 1216

−516

−616

0 1 0 48

−38

−28

0 0 1 −1 1 1

⎀⎥⎥⎊

𝐎−1 =⎡⎢⎢⎣

1216

−516

−616

48

−38

−28

−1 1 1

⎀⎥⎥⎊

13

Why does it work?

• Each row reduction corresponds to multiplying with anelementary matrix 𝐞:

[ 𝐎∣ 𝐌 ] → [ 𝐞1𝐎∣ 𝐞1𝐌 ] → [ 𝐞2𝐞1𝐎∣ 𝐞2𝐞1 ] → 



 → [ 𝐹𝐎 ∣ 𝐹] where 𝐹 = 𝐞𝑟 
 𝐞2𝐞1.

• If we manage to reduce [ 𝐎∣ 𝐌 ] to [ 𝐌∣ 𝐹 ], this means

𝐹𝐎 = 𝐌 ⟹ 𝐎−1 = 𝐹.

14

Why does it work?

• Each row reduction corresponds to multiplying with anelementary matrix 𝐞:

[ 𝐎∣ 𝐌 ] → [ 𝐞1𝐎∣ 𝐞1𝐌 ] → [ 𝐞2𝐞1𝐎∣ 𝐞2𝐞1 ] → 



 → [ 𝐹𝐎 ∣ 𝐹] where 𝐹 = 𝐞𝑟 
 𝐞2𝐞1.

• If we manage to reduce [ 𝐎∣ 𝐌 ] to [ 𝐌∣ 𝐹 ], this means

𝐹𝐎 = 𝐌 ⟹ 𝐎−1 = 𝐹.

14

Why does it work?

• Each row reduction corresponds to multiplying with anelementary matrix 𝐞:

[ 𝐎∣ 𝐌 ] → [ 𝐞1𝐎∣ 𝐞1𝐌 ] → [ 𝐞2𝐞1𝐎∣ 𝐞2𝐞1 ] → 



 → [ 𝐹𝐎 ∣ 𝐹] where 𝐹 = 𝐞𝑟 
 𝐞2𝐞1.

• If we manage to reduce [ 𝐎∣ 𝐌 ] to [ 𝐌∣ 𝐹 ], this means

𝐹𝐎 = 𝐌 ⟹ 𝐎−1 = 𝐹.

14

top related