A的LU分解
1 上节课的补充
1.1 矩阵乘积的逆
( A B ) − 1 = ? (AB)^{-1}=? (AB)−1=?
( A B ) × ( A B ) − 1 = I 或 ( A B ) − 1 × ( A B ) = I (AB)\times (AB)^{-1}=I\\ \quad\\ 或\\ \quad\\ (AB)^{-1}\times(AB)=I (AB)×(AB)−1=I或(AB)−1×(AB)=I
A × B × B − 1 × A − 1 = A × ( B × B − 1 ) × A − 1 = A × I × A − 1 = A × A − 1 = I A\times B\times B^{-1}\times A^{-1}\qquad=\qquad A\times (B\times B^{-1})\times A^{-1}\qquad=\qquad A\times I\times A^{-1}\qquad=\qquad A\times A^{-1}\quad=\qquad I A×B×B−1×A−1=A×(B×B−1)×A−1=A×I×A−1=A×A−1=I
B − 1 × A − 1 × A × B = I \quad\\ B^{-1}\times A^{-1}\times A\times B=I B−1×A−1×A×B=I
( A × B ) × ( B − 1 × A − 1 ) = I ( B − 1 × A − 1 ) × ( A × B ) = I (A\times B)\times (B^{-1}\times A^{-1})=I\\ \quad\\ (B^{-1}\times A^{-1})\times (A\times B)=I (A×B)×(B−1×A−1)=I(B−1×A−1)×(A×B)=I
( A B ) − 1 = B − 1 A − 1 (AB)^{-1}=B^{-1}A^{-1} (AB)−1=B−1A−1
1.2 转置的逆
( A B ) T = B T A T (AB)^{T}=B^TA^T (AB)T=BTAT
[ 1 2 3 4 ] T = [ 1 3 2 4 ] \begin{bmatrix} 1&2\\ 3&4 \end{bmatrix}^T= \begin{bmatrix} 1&3\\ 2&4 \end{bmatrix} [1324]T=[1234]
A B = C AB=C AB=C
( A B ) T = C T (AB)^T=C^T (AB)T=CT
A × B = C [ ] × [ ] = [ ] A_{}\qquad\times \qquad B_{}\qquad=\qquad C_{}\\ \quad \\ \quad \\ \left[ \begin{array}{ccc} & & \\\hline & &\\ & & \end{array} \right]_{}\times\quad \left[ \begin{array}{ccc} & & \\ & &\\ & & \end{array} \right]_{}=\quad \left[ \begin{array}{ccc} & & \\\hline & &\\ & & \end{array} \right]_{} A×B=C⎣⎡⎦⎤×⎣⎡⎦⎤=⎣⎡⎦⎤
B T × A T = C T [ ] × [ ] = [ ] B^T_{}\qquad\times \qquad A^T_{}\qquad=\qquad C^T_{}\\ \quad \\ \quad \\ \left[ \begin{array}{ccc} & & \\ & &\\ & & \end{array} \right]_{}\times\quad \left[ \begin{array}{c|cc} & & \\ & &\\ & & \end{array} \right]_{}=\quad \left[ \begin{array}{c|cc} & & \\ & &\\ & & \end{array} \right]_{} BT×AT=CT⎣⎡⎦⎤×⎣⎡⎦⎤=⎣⎡⎦⎤
( A B ) T = B T × A T (AB)^T=B^T\times A^T (AB)T=BT×AT
A × A − 1 = I A\times A^{-1}=I A×A−1=I
( A × A − 1 ) T = I T (A\times A^{-1})^T=I^T (A×A−1)T=IT
I T = I I^T=I IT=I
( A × B ) T = B T × A T (A\times B)^T=B^T\times A^T (A×B)T=BT×AT
( A × A − 1 ) T = ( A − 1 ) T × A T (A\times A^{-1})^T = (A^{-1} )^T\times A^T (A×A−1)T=(A−1)T×AT
A × A − 1 = I ↓ ( A × A − 1 ) T = I T ↓ ( A − 1 ) T × A T = I A\times A^{-1}=I\\ \quad\\ \stackrel{}{\downarrow}\\ \quad\\ (A\times A^{-1})^T=I^T\\ \quad\\ \stackrel{}{\downarrow}\\ \quad\\ (A^{-1} )^T\times A^T=I A×A−1=I↓(A×A−1)T=IT↓(A−1)T×AT=I
( A − 1 ) T × A T = I (A^{-1} )^T\times A^T=I (A−1)T×AT=I
2 A的LU分解
2.1 这是啥???
2.1.1 L和U是啥???
2.1.2 A咋分解成L和U???
E × A = U ↓ E − 1 × E × A = E − 1 × U ↓ A = E − 1 × U E\times A = U\\ \quad\\ \stackrel{}{\downarrow}\\ \quad\\ E^{-1}\times E\times A = E^{-1}\times U\\ \quad\\ \stackrel{}{\downarrow}\\ \quad\\ A = E^{-1}\times U E×A=U↓E−1×E×A=E−1×U↓A=E−1×U
A = [ 2 1 8 7 ] A=\begin{bmatrix} 2&1\\ 8&7 \end{bmatrix} A=[2817]
A ⟶ r o w 2 − 4 × r o w 1 U [ 2 1 8 7 ] ⟶ r o w 2 − 4 × r o w 1 [ 2 1 0 3 ] A\stackrel{row2-4\times row1}{\longrightarrow}U\\ \quad\\ \begin{bmatrix} \boxed2&1\\ 8&7 \end{bmatrix}\stackrel{row2-4\times row1}{\longrightarrow} \begin{bmatrix} 2&1\\ 0&\boxed3 \end{bmatrix} A⟶row2−4×row1U[2817]⟶row2−4×row1[2013]
E = [ 1 0 − 4 1 ] E=\begin{bmatrix} 1&0\\ -4&1 \end{bmatrix} E=[1−401]
[ 1 0 − 4 1 ] × [ 2 1 8 7 ] = [ 2 1 0 3 ] \begin{bmatrix} 1&0\\ -4&1 \end{bmatrix}\times \begin{bmatrix} 2&1\\ 8&7 \end{bmatrix}= \begin{bmatrix} 2&1\\ 0&3 \end{bmatrix} [1−401]×[2817]=[2013]
E = [ 1 0 − 4 1 ] E − 1 = [ 1 0 4 1 ] E=\begin{bmatrix} 1&0\\ -4&1 \end{bmatrix}\\ \quad\\ E^{-1}=\begin{bmatrix} 1&0\\ 4&1 \end{bmatrix} E=[1−401]E−1=[1401]
[ 2 1 8 7 ] = [ 1 0 4 1 ] × [ 2 1 0 3 ] \begin{bmatrix} 2&1\\ 8&7 \end{bmatrix}= \begin{bmatrix} 1&0\\ 4&1 \end{bmatrix}\times \begin{bmatrix} 2&1\\ 0&3 \end{bmatrix} [2817]=[1401]×[2013]
[ 2 1 8 7 ] = [ 1 0 4 1 ] × [ 2 0 0 3 ] × [ 1 1 2 0 1 ] \begin{bmatrix} 2&1\\ 8&7 \end{bmatrix}= \begin{bmatrix} 1&0\\ 4&1 \end{bmatrix}\times \begin{bmatrix} 2&0\\ 0&3 \end{bmatrix}\times \begin{bmatrix} 1&\frac{1}{2}\\ 0&1 \end{bmatrix} [2817]=[1401]×[2003]×[10211]
2.2 为啥要这么做???
A = [ 1 3 3 2 − 5 3 0 − 25 3 ] A=\begin{bmatrix} 1&3&3\\ 2&-5&3\\ 0&-25&3 \end{bmatrix} A=⎣⎡1203−5−25333⎦⎤
E 32 × E 31 × E 21 × A = U [ 1 0 0 0 1 0 0 − 5 1 ] × [ 1 0 0 0 1 0 0 0 1 ] × [ 1 0 0 − 2 1 0 0 0 1 ] × [ 1 3 3 2 − 5 3 0 − 55 3 ] = [ 1 3 3 0 − 11 − 3 0 0 18 ] ↓ E × A = U [ 1 0 0 − 2 1 0 10 − 5 1 ] × [ 1 3 3 2 − 5 3 0 − 55 3 ] = [ 1 3 3 0 − 11 − 3 0 0 18 ] E_{32}\quad \quad \times \quad \quad E_{31} \quad \quad \times \quad \quad E_{21} \quad \quad \times \quad \quad A \quad \quad = \quad \quad U\\ \quad\\ \begin{bmatrix} 1&0&0\\ 0&1&0\\ 0&-5&1 \end{bmatrix}\times \begin{bmatrix} 1&0&0\\ 0&1&0\\ 0&0&1 \end{bmatrix}\times \begin{bmatrix} 1&0&0\\ -2&1&0\\ 0&0&1 \end{bmatrix}\times \begin{bmatrix} 1&3&3\\ 2&-5&3\\ 0&-55&3 \end{bmatrix}= \begin{bmatrix} 1&3&3\\ 0&-11&-3\\ 0&0&18 \end{bmatrix}\\ \quad\\ \stackrel{}{\downarrow}\\ \quad\\ E\qquad \quad \times \qquad \quad A \qquad \quad= \qquad \quad U\\ \quad\\ \begin{bmatrix} 1&0&0\\ -2&1&0\\ 10&-5&1 \end{bmatrix}\times \begin{bmatrix} 1&3&3\\ 2&-5&3\\ 0&-55&3 \end{bmatrix}= \begin{bmatrix} 1&3&3\\ 0&-11&-3\\ 0&0&18 \end{bmatrix} E32×E31×E21×A=U⎣⎡10001−5001⎦⎤×⎣⎡100010001⎦⎤×⎣⎡1−20010001⎦⎤×⎣⎡1203−5−55333⎦⎤=⎣⎡1003−1103−318⎦⎤↓E×A=U⎣⎡1−21001−5001⎦⎤×⎣⎡1203−5−55333⎦⎤=⎣⎡1003−1103−318⎦⎤
A = [ 1 3 3 2 − 5 3 0 − 25 3 ] A=\begin{bmatrix} 1&3&3\\ 2&-5&3\\ 0&-25&3 \end{bmatrix} A=⎣⎡1203−5−25333⎦⎤
E 32 × E 31 × E 21 × A = U [ 1 0 0 0 1 0 0 − 5 1 ] × [ 1 0 0 0 1 0 0 0 1 ] × [ 1 0 0 − 2 1 0 0 0 1 ] × [ 1 3 3 2 − 5 3 0 − 55 3 ] = [ 1 3 3 0 − 11 − 3 0 0 18 ] ↓ A = E 21 − 1 × E 31 − 1 × E 32 − 1 × U E_{32}\quad \quad \times \quad \quad E_{31} \quad \quad \times \quad \quad E_{21} \quad \quad \times \quad \quad A \quad \quad = \quad \quad U\\ \quad\\ \begin{bmatrix} 1&0&0\\ 0&1&0\\ 0&-5&1 \end{bmatrix}\times \begin{bmatrix} 1&0&0\\ 0&1&0\\ 0&0&1 \end{bmatrix}\times \begin{bmatrix} 1&0&0\\ -2&1&0\\ 0&0&1 \end{bmatrix}\times \begin{bmatrix} 1&3&3\\ 2&-5&3\\ 0&-55&3 \end{bmatrix}= \begin{bmatrix} 1&3&3\\ 0&-11&-3\\ 0&0&18 \end{bmatrix}\\ \quad\\ \stackrel{}{\downarrow}\\ \quad\\ A= E_{21}^{-1}\times E_{31}^{-1}\times E_{32}^{-1}\times U E32×E31×E21×A=U⎣⎡10001−5001⎦⎤×⎣⎡100010001⎦⎤×⎣⎡1−20010001⎦⎤×⎣⎡1203−5−55333⎦⎤=⎣⎡1003−1103−318⎦⎤↓A=E21−1×E31−1×E32−1×U
A = E 21 − 1 × E 31 − 1 × E 32 − 1 × U ↓ [ 1 3 3 2 − 5 3 0 − 55 3 ] = [ 1 0 0 2 1 0 0 0 1 ] × [ 1 0 0 0 1 0 0 0 1 ] × [ 1 0 0 0 1 0 0 5 1 ] × [ 1 3 3 0 − 11 − 3 0 0 18 ] ↓ [ 1 3 3 2 − 5 3 0 − 55 3 ] = [ 1 0 0 2 1 0 0 5 1 ] × [ 1 3 3 0 − 11 − 3 0 0 18 ] ↓ A = L × U A= E_{21}^{-1}\times E_{31}^{-1}\times E_{32}^{-1}\times U\\ \quad\\ \stackrel{}{\downarrow}\\ \quad\\ \begin{bmatrix} 1&3&3\\ 2&-5&3\\ 0&-55&3 \end{bmatrix}= \begin{bmatrix} 1&0&0\\ 2&1&0\\ 0&0&1 \end{bmatrix}\times \begin{bmatrix} 1&0&0\\ 0&1&0\\ 0&0&1 \end{bmatrix}\times \begin{bmatrix} 1&0&0\\ 0&1&0\\ 0&5&1 \end{bmatrix}\times \begin{bmatrix} 1&3&3\\ 0&-11&-3\\ 0&0&18 \end{bmatrix}\\ \quad\\ \stackrel{}{\downarrow}\\ \quad\\ \begin{bmatrix} 1&3&3\\ 2&-5&3\\ 0&-55&3 \end{bmatrix}= \begin{bmatrix} 1&0&0\\ 2&1&0\\ 0&5&1 \end{bmatrix}\times \begin{bmatrix} 1&3&3\\ 0&-11&-3\\ 0&0&18 \end{bmatrix}\\ \quad\\ \stackrel{}{\downarrow}\\ \quad\\ A=L\times U A=E21−1×E31−1×E32−1×U↓⎣⎡1203−5−55333⎦⎤=⎣⎡120010001⎦⎤×⎣⎡100010001⎦⎤×⎣⎡100015001⎦⎤×⎣⎡1003−1103−318⎦⎤↓⎣⎡1203−5−55333⎦⎤=⎣⎡120015001⎦⎤×⎣⎡1003−1103−318⎦⎤↓A=L×U
[ 1 0 0 2 1 0 0 5 1 ] \begin{bmatrix} 1&0&0\\ 2&1&0\\ 0&5&1 \end{bmatrix} ⎣⎡120015001⎦⎤
E 21 = [ 1 0 0 − 2 1 0 0 0 1 ] E_{21}=\begin{bmatrix} 1&0&0\\ -2&1&0\\ 0&0&1 \end{bmatrix} E21=⎣⎡1−20010001⎦⎤
E 32 = [ 1 0 0 0 1 0 0 − 5 1 ] E_{32}=\begin{bmatrix} 1&0&0\\ 0&1&0\\ 0&-5&1 \end{bmatrix} E32=⎣⎡10001−5001⎦⎤
3 消元运算次数与方阵大小的关系
[ a 1 , 1 ⋯ a 1 , 100 ⋯ ⋯ ⋯ a 100 , 1 ⋯ a 100 , 100 ] \begin{bmatrix} a_{1,1}&\cdots&a_{1,100}\\ \cdots&\cdots&\cdots\\ a_{100,1}&\cdots&a_{100,100} \end{bmatrix} ⎣⎡a1,1⋯a100,1⋯⋯⋯a1,100⋯a100,100⎦⎤
[ a 1 , 1 ⋯ a 1 , 100 ⋯ ⋯ ⋯ 0 ⋯ a 100 , 100 ] \begin{bmatrix} a_{1,1}&\cdots&a_{1,100}\\ \cdots&\cdots&\cdots\\ 0&\cdots&a_{100,100} \end{bmatrix} ⎣⎡a1,1⋯0⋯⋯⋯a1,100⋯a100,100⎦⎤
99 × 100 + 98 × 99 + ⋯ + 1 × 2 99\times 100+98\times99+\cdots+1\times2 99×100+98×99+⋯+1×2
10 0 2 + 9 9 2 + ⋯ + 1 2 100^2+99^2+\cdots+1^2 1002+992+⋯+12
1 2 + 2 2 + ⋯ + n 2 1^2+2^2+\cdots+n^2 12+22+⋯+n2
1 2 + 2 2 + ⋯ + n 2 ≈ 1 3 × n 3 1^2+2^2+\cdots+n^2\approx\frac{1}{3}\times n^3 12+22+⋯+n2≈31×n3
[ a 1 , 1 ⋯ a 1 , 100 ⋯ ⋯ ⋯ a 100 , 1 ⋯ a 100 , 100 b 1 ⋯ b 100 ] \left [ \begin{array}{c:c} \begin{matrix} a_{1,1}&\cdots&a_{1,100}\\ \cdots&\cdots&\cdots\\ a_{100,1}&\cdots&a_{100,100} \end{matrix}& \begin{matrix} b_{1}\\ \cdots\\ b_{100} \end{matrix} \end{array} \right ] ⎣⎡a1,1⋯a100,1⋯⋯⋯a1,100⋯a100,100b1⋯b100⎦⎤
99 + 98 + 97 + ⋯ + 1 99+98+97+\cdots+1 99+98+97+⋯+1
n + ( n − 1 ) + ⋯ + 1 = n 2 + n 2 2 n+(n-1)+\cdots+1=\frac{n}{2}+\frac{n^2}{2} n+(n−1)+⋯+1=2n+2n2
n 2 2 \frac{n^2}{2} 2n2
n 2 2 \frac{n^2}{2} 2n2
n 2 2 + n 2 2 = n 2 \frac{n^2}{2}+\frac{n^2}{2}=n^2 2n2+2n2=n2
4 置换与转置
[ 1 0 0 0 1 0 0 0 1 ] [ 0 1 0 0 0 1 1 0 0 ] [ 0 0 1 1 0 0 0 1 0 ] [ 0 1 0 1 0 0 0 0 1 ] [ 0 0 1 0 1 0 1 0 0 ] [ 1 0 0 0 0 1 0 1 0 ] \begin{bmatrix} 1&0&0\\ 0&1&0\\ 0&0&1 \end{bmatrix} \begin{bmatrix} 0&1&0\\ 0&0&1\\ 1&0&0 \end{bmatrix} \begin{bmatrix} 0&0&1\\ 1&0&0\\ 0&1&0 \end{bmatrix}\\ \quad\\ \begin{bmatrix} 0&1&0\\ 1&0&0\\ 0&0&1 \end{bmatrix} \begin{bmatrix} 0&0&1\\ 0&1&0\\ 1&0&0 \end{bmatrix} \begin{bmatrix} 1&0&0\\ 0&0&1\\ 0&1&0 \end{bmatrix} ⎣⎡100010001⎦⎤⎣⎡001100010⎦⎤⎣⎡010001100⎦⎤⎣⎡010100001⎦⎤⎣⎡001010100⎦⎤⎣⎡100001010⎦⎤
P − 1 = P T P^{-1}=P^T P−1=PT