当前位置: 代码迷 >> 综合 >> Introduction to Linear Algebra, Chapter-2, Solving Linear Equations, Key Notes
  详细解决方案

Introduction to Linear Algebra, Chapter-2, Solving Linear Equations, Key Notes

热度:4   发布时间:2024-03-08 14:01:33.0

Introduction to Linear Algebra, Chapter-2, Solving Linear Equations, Key Notes

本人在阅读MIT数学教授Gilbert Strang所著线性代数教材"Introduction to Linear Algebra(Fifth Edition)"过程中敲下的笔记

我是用的教学视频是BV1uK4y187ep

课后习题答案及其它相关资料可参照math.mit.edu/linearalgebra

2.1 Vectors and Linear Equations

从两种角度看待线性方程组

Ax→=b→,假设A是3 by 3的矩阵A \overrightarrow{x} = \overrightarrow{b}, \text{假设A是3 by 3的矩阵} Ax =b ,假设A3 by 3的矩阵

  • 从行的角度看待(row picture)Ax→=b→A \overrightarrow{x} = \overrightarrow{b}Ax =b 表示在三维空间中有三个平面交于一点(A的一行定义一个平面)

  • 从列的角度看待(column picture)Ax→=b→A \overrightarrow{x} = \overrightarrow{b}Ax =b 表示要寻找一个关于AAA的列的线性组合来表示出b→\overrightarrow{b}b

两种方法计算Ax→A\overrightarrow{x}Ax

  • AAA的每一行与x→\overrightarrow{x}x 的点积(dot product)
  • AAA的列的线性组合

其它

For mmm by nnn matrices, Ax→=0→A \overrightarrow{x} = \overrightarrow{0}Ax =0 may have many solutions, those solutions will go into a vector space, the rank of AAA leads to the dimension of that vector space.

2.2 The Idea of Elimination

这章基本就一句重点:forward elimination and back substitution.

elimination在遇到为0的pivot的时候有可能会失败,如果能通过行交换找到非0的pivot,则消元可以继续,如果找不到非0的pivot,则遇到了permanent breakdown,这时候方程组没有解或者有无数解。

2.3 Elimination Using Matrices

从行和列两个角度看待矩阵与向量相乘(再次强调)

Ax→A \overrightarrow{x}Ax is a combination of the columns of AAA;
Components of Ax→A \overrightarrow{x}Ax are the dot products with rows of AAA;

Elimination Matrix(消元矩阵)

start with the identity matrix III, change one of its zeros to the multiplier ?l-l?l;
for a elimination matrix EijE_{ij}Eij?, it has nonzero entry ?l-l?l in the (i,j)(i, j)(i,j) position, so EijAE_{ij}AEij?A will subtract lll times of row jjj from row iii.

交换律和结合律

矩阵乘法满足结合律(associative law),即A(BC)=(AB)CA(BC)=(AB)CA(BC)=(AB)C
矩阵乘法不满足交换律(commutative law),即Often AB≠BA\text{Often } AB \neq BAOften AB??=BA

矩阵相乘(列视角)

Matrix Multiplication: AB=A[b1→b2→b3→]=[Ab1→Ab2→Ab3→]\text{Matrix Multiplication: } AB = A[\overrightarrow{b_1} \; \overrightarrow{b_2} \; \overrightarrow{b_3}] = [A\overrightarrow{b_1} \; A\overrightarrow{b_2} \; A\overrightarrow{b_3}] Matrix Multiplication: AB=A[b1? ?b2? ?b3? ?]=[Ab1? ?Ab2? ?Ab3? ?]

The beauty of matrix multiplication is that all three approaches(rows, columns, whole matrices) come out right(其他视角后续小节讲解)

Permutation Matrix(置换矩阵)

Row Exchange Matrix: PijP_{ij}Pij? is the identity matrix with rows iii and jjj reversed. When this “permutation matrixPijP_{ij}Pij? multiplies a matrix, it exchanges rows iii and jjj.

Argumented Matrix(增广矩阵)

We can include b→\overrightarrow{b}b as an extra column of AAA and follow it through elimination.

Argumented Matrix: [Ab→]\text{Argumented Matrix: } [A \; \overrightarrow{b}] Argumented Matrix: [Ab ]

Matrix multiplication works b rows and at the same time by columns:
ROWS: each row of EEE acts on [Ab→][A \; \overrightarrow{b}][Ab ] to give a row of [EAEb→][EA \; E\overrightarrow{b}][EAEb ];
COLUMNS: EEE acts on each column of [Ab→][A \; \overrightarrow{b}][Ab ] to give a column of [EAEb→][EA \; E\overrightarrow{b}][EAEb ];

2.4 Rules for Matrix Operations

看待矩阵乘法的第一种视角:每一个元素都是一个向量内积

The entry in row icolumn jof ABis (row iof A)?(column jof B)\text{The entry in row } i \text{ column } j \text{ of } AB \text{ is (row } i \text{ of } A) \cdot \text{(column } j \text{ of }B) The entry in row i column j of AB is (row i of A)?(column j of B)

看待矩阵乘法的第二种视角:Each column of AB is a combination of the columns of A

matrix A times every column of matrix B: A[b1→b2→?bp→]=[Ab1→Ab2→?Abp→]\text{matrix A times every column of matrix B: } A[\overrightarrow{b_1} \; \overrightarrow{b_2} \; \cdots \; \overrightarrow{b_p}] = [A\overrightarrow{b_1} \; A\overrightarrow{b_2} \; \cdots \; A\overrightarrow{b_p}] matrix A times every column of matrix B: A[b1? ?b2? ??bp? ?]=[Ab1? ?Ab2? ??Abp? ?]

看待矩阵乘法的第三种视角:Each row of AB is a combination of the rows of B

every row of A times matrix B: [a1→a2→?am→]B=[a1→Ba2→B?am→B]\text{every row of A times matrix B: } \begin{bmatrix} \overrightarrow{a_1} \\ \overrightarrow{a_2} \\ \cdots \\ \overrightarrow{a_m} \end{bmatrix} B = \begin{bmatrix} \overrightarrow{a_1} B \\ \overrightarrow{a_2} B \\ \cdots \\ \overrightarrow{a_m} B \end{bmatrix} every row of A times matrix B: ?????a1? ?a2? ??am? ???????B=?????a1? ?Ba2? ?B?am? ?B??????

看待矩阵乘法的第四种视角:columns of A multiply rows of B

[col1col2?coln]×[row1row2?rown]=col1×row1+col2×row2+?+coln×rown\begin{bmatrix} col_1 \; col_2 \cdots \; col_n \end{bmatrix} \times \begin{bmatrix} row_1 \\ row_2 \\ \cdots \\ row_n \end{bmatrix} = col_1 \times row_1 + col_2 \times row_2 + \cdots + col_n \times row_n [col1?col2??coln??]×?????row1?row2??rown???????=col1?×row1?+col2?×row2?+?+coln?×rown?

向量的内积和外积(inner product, outer product)

a row times a column is an inner product, or dot product(produce a single number), while a column times a row is an outer product(produce a matrix).

Laws for Matrix Operations

  • 矩阵加法满足交换律(commutative law):A+B=B+AA + B = B + AA+B=B+A

  • 矩阵加法满足分配律(distributive law):c(A+B)=cA+cBc(A+B)=cA+cBc(A+B)=cA+cB

  • 矩阵加法满足结合律(associative law):A+(B+C)=(A+B)+CA+(B+C)=(A+B)+CA+(B+C)=(A+B)+C

  • 矩阵乘法不满足交换律(the commutative law is usually broken):AB≠BAAB \neq BAAB??=BA

  • 矩阵乘法满足左分配律(distributive law from left):A(B+C)=AB+ACA(B+C)=AB+ACA(B+C)=AB+AC

  • 矩阵乘法满足右分配律(distributive law from right):(A+B)C=AC+BC(A+B)C=AC+BC(A+B)C=AC+BC

  • 矩阵乘法满足结合律(associative law):A(BC)=(AB)CA(BC)=(AB)CA(BC)=(AB)C

Matrix Power

(Ap)(Aq)=Ap+q,(Ap)q=Apq(A^p)(A^q) = A^{p+q} \; , \; (A^p)^q = A^{pq} (Ap)(Aq)=Ap+q,(Ap)q=Apq

矩阵分块及分块相乘

if blocks of A can multiply blocks of B, then block multiplication of AB is allowed. Cuts between columns of A match cuts of rows of B.

[A11A12A21A22][B11B21]=[A11B11+A12B21A21B11+A22B21]\begin{bmatrix} A_{11} \; A_{12} \\ A_{21} \; A_{22} \end{bmatrix} \begin{bmatrix} B_{11} \\ B_{21} \end{bmatrix} = \begin{bmatrix} A_{11} B_{11} + A_{12} B_{21} \\ A_{21} B_{11} + A_{22} B_{21} \end{bmatrix} [A11?A12?A21?A22??][B11?B21??]=[A11?B11?+A12?B21?A21?B11?+A22?B21??]

Block Elimination

[I0→?CA?1I][ABCD]=[AB0→D?CA?1B]\begin{bmatrix} I & \overrightarrow{0} \\ -CA^{-1} & I \end{bmatrix} \begin{bmatrix} A & B \\ C & D \end{bmatrix} = \begin{bmatrix} A & B \\ \overrightarrow{0} & D - CA^{-1}B \end{bmatrix} [I?CA?1?0 I?][AC?BD?]=[A0 ?BD?CA?1B?]

the entry “D?CA?1BD - CA^{-1}BD?CA?1B” is called Schur complement, 舒尔补

2.5 Inverse Matrices

Six Notes About A?1A^{-1}A?1

  1. the inverse exists if and onlt if the elimination produces n nonzero pivots(row exchange is allowed).
  2. the matrix A cannot have two different inverses.
  3. if A is invertible, the only solution to Ax→=b→A\overrightarrow{x} = \overrightarrow{b}Ax =b is x→=A?1b→\overrightarrow{x} = A^{-1}\overrightarrow{b}x =A?1b
  4. if there exists a nonzero vector x→\overrightarrow{x}x such that Ax→=0→A\overrightarrow{x} = \overrightarrow{0}Ax =0 , A is not invertible.
  5. for a 2×22 \times 22×2 matrix, if is invertible onlt if ad?bc≠0ad - bc \neq 0ad?bc??=0
    [abcd]?1=1ad?bc[d?b?ca]\begin{bmatrix} a & b \\ c & d \end{bmatrix} ^ {-1} = \frac{1}{ad - bc} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix} [ac?bd?]?1=ad?bc1?[d?c??ba?]
  6. a diagonal matrix has an inverse provided that no diagonal entries are zero.

Inverse of Matrix Product

if A and B are invertible, then:
(AB)?1=B?1A?1(AB)^{-1} = B^{-1}A^{-1} (AB)?1=B?1A?1

note that the order is reversed.

this works with three or more matrices:
(ABC)?1=C?1B?1A?1(ABC)^{-1} = C^{-1}B^{-1}A^{-1} (ABC)?1=C?1B?1A?1

Gauss-Jordan Elimination

AA?1=A[x1→x2→x3→]=[e1→e2→e3→]=IAA^{-1} = A \begin{bmatrix} \overrightarrow{x_1} & \overrightarrow{x_2} & \overrightarrow{x_3} \end{bmatrix} = \begin{bmatrix} \overrightarrow{e_1} & \overrightarrow{e_2} & \overrightarrow{e_3} \end{bmatrix} = I AA?1=A[x1? ??x2? ??x3? ??]=[e1? ??e2? ??e3? ??]=I

对于一个n×nn \times nn×n的矩阵来说,求解其逆矩阵相当于求解n个n元方程组,我们可以同时列出包含了这n个方程组的增广矩阵:

[2?10100?12?10100?12001]\begin{bmatrix} 2 & -1 & 0 & 1 & 0 & 0 \\ -1 & 2 & -1 & 0 & 1 & 0 \\ 0 & -1 & 2 & 0 & 0 & 1 \end{bmatrix} ???2?10??12?1?0?12?100?010?001????

先进行一轮forward elimination:

[2?10100032?11210004313230]\begin{bmatrix} 2 & -1 & 0 & 1 & 0 & 0 \\ 0 & \frac{3}{2} & -1 & \frac{1}{2} & 1 & 0 \\ 0 & 0 & \frac{4}{3} & \frac{1}{3} & \frac{2}{3} & 0 \end{bmatrix} ???200??123?0?0?134??121?31??0132??000????

然后反过来向上消元,将矩阵变为reduced echelon form(最简行阶梯矩阵),这部分由Jordan贡献。

[200321120320343234004313230]\begin{bmatrix} 2 & 0 & 0 & \frac{3}{2} & 1 & \frac{1}{2} \\ 0 & \frac{3}{2} & 0 & \frac{3}{4} & \frac{3}{2} & \frac{3}{4} \\ 0 & 0 & \frac{4}{3} & \frac{1}{3} & \frac{2}{3} & 0 \end{bmatrix} ???200?023?0?0034??23?43?31??123?32??21?43?0????

最后,divided each row by its pivots, then we finally get [IA?1][I \; A^{-1}][IA?1] in this argumented matrix;

[10034121401012112001141234]\begin{bmatrix} 1 & 0 & 0 & \frac{3}{4} & \frac{1}{2} & \frac{1}{4} \\ 0 & 1 & 0 & \frac{1}{2} & 1 & \frac{1}{2} \\ 0 & 0 & 1 & \frac{1}{4} & \frac{1}{2} & \frac{3}{4} \end{bmatrix} ???100?010?001?43?21?41??21?121??41?21?43?????

the total cost for A?1A^{-1}A?1 is n3n^3n3 multiplications and subtractions.

Diagonally dominant matrices are intertible

对角优势矩阵是可逆的(充分不必要);
对角优势矩阵,对角线上的每一个元素,都大于这一行上其余元素的绝对值的和;
对角优势矩阵之所以可逆,是因为其一定满足Ax→=0→A\overrightarrow{x} = \overrightarrow{0}Ax =0 没有非零向量解;

2.6 Elimination = Factorization: A=LUA = LUA=LU

矩阵的LU分解

A=LUA = LU A=LU

或者

A=LDUA = LDU A=LDU

其中,L代表下三角矩阵(lower triangular),储存了高斯消元时所有的lijl_{ij}lij?
D代表对角矩阵(diagonal matrix),储存了所有的pivots(如果愿意写成这种形式的话);
U代表上三角矩阵(upper triangular),储存了A高斯消元后的结果(LU形式)或者将高斯消元后的矩阵每一行除以其pivot的结果(LDU形式);

从LU分解的角度看待线性方程组的求解

方程组Ax→=b→A\overrightarrow{x} = \overrightarrow{b}Ax =b ,如果写成LUx→=b→LU\overrightarrow{x} = \overrightarrow{b}LUx =b ,相当于解决两个三角形的方程组,先解决Lc→=b→L\overrightarrow{c} = \overrightarrow{b}Lc =b (forward substitution),再解决Ux→=c→U\overrightarrow{x} = \overrightarrow{c}Ux =c (backward substitution)。

The Cost of Elimination

Elimination on a n×nn \times nn×n square matrix A needs 13n(n+12)(n+1)\frac{1}{3}n(n + \frac{1}{2})(n+1)31?n(n+21?)(n+1) multiplications and 13n(n+12)(n+1)\frac{1}{3}n(n + \frac{1}{2})(n+1)31?n(n+21?)(n+1) subtractions.

To solve each right side of the equation, n2n^2n2 muliplications and n2n^2n2 substractions are needed.

对于带宽为ω\omegaω的带状矩阵(band matrix)来说,消元只需要消耗nω2n \omega^2nω2次乘法和减法,求解只需要消耗2nω2n\omega2nω次乘法和减法。

2.7 Transposes and Permutations

转置矩阵(Transpose)的一些性质

Sum: (A+B)T=AT+BTProduct: (AB)T=BTATInverse: (A?1)T=(AT)?1(ABC)T=CTBTATif A is invertible, ATis invertible, too\text{Sum: } (A + B)^T = A^T + B^T \\ \text{Product: } (AB)^T = B^T A^T \\ \text{Inverse: } (A^{-1})^T = (A^T)^{-1} \\ (ABC)^T = C^T B^T A^T \\ \text{if A is invertible, } A^T \text{is invertible, too} Sum: (A+B)T=AT+BTProduct: (AB)T=BTATInverse: (A?1)T=(AT)?1(ABC)T=CTBTATif A is invertible, ATis invertible, too

使用矩阵转置表示向量的内积和外积

Inner Product: x→Ty→, T is insideOuter Product: x→y→T, T is outside\text{Inner Product: } \overrightarrow{x}^T \overrightarrow{y} \text{ , T is inside} \\ \text{Outer Product: } \overrightarrow{x} \overrightarrow{y} ^ T \text{ , T is outside} Inner Product: x Ty ? , T is insideOuter Product: x y ?T , T is outside

关于转置矩阵更加“数学”的定义

ATA^TAT is the matrix that makes the following two inner product equal:
Ax→y→=x→ATy→A \overrightarrow{x} \overrightarrow{y} = \overrightarrow{x} A^T \overrightarrow{y} Ax y ?=x ATy ?
because (Ax→)Ty→=x→TATy→(A\overrightarrow{x})^T \overrightarrow{y} = \overrightarrow{x}^T A^T \overrightarrow{y}(Ax )Ty ?=x TATy ?, 使用转置矩阵表示的内积。

斜对称矩阵(Symmetric Matrix)

斜对称矩阵的转置等于本身PT=PP^T = PPT=P

对于任意矩阵,AATA A^TAAT的结果是一个斜对称矩阵;

对斜对称矩阵进行高斯消元,计算量可以减半,因为:P=LDU=LDLTP = LDU = LDL^TP=LDU=LDLT

置换矩阵(Permutation Matrix)

DEFINITION: A Permutation Matrix has the rows of an Indetity Matrix I in any order.

P?1P^{-1}P?1也是一个置换矩阵。

P?1=PTP^{-1} = P^TP?1=PT,置换矩阵的逆矩阵与转置矩阵相同。

带有行交换的矩阵的LU分解

两种形式:
PA=LUA=LPUPA = LU \\ A = LPU PA=LUA=LPU
第一种形式更加常用;

课后习题

作业里的截图都缺了一角,问题应该出在使用CloudConvert将SVG图像转化成PNG图像的步骤上,先不管。

2.1

在这里插入图片描述

2.2

在这里插入图片描述

2.3

在这里插入图片描述

2.4

在这里插入图片描述

2.5

在这里插入图片描述

2.6

在这里插入图片描述

2.7

在这里插入图片描述

  相关解决方案