标量除、矢量除、正交化

引言

我的都知道标量乘和矢量乘,标量乘就是两个矢量各项元素相乘之和,得到的是一个标量;矢量乘就是两个矢量相乘得到一个新的矢量,该矢量垂直于这两个矢量。对于除法呢,矢量是否有除法呢?是否也是标量除和矢量除呢?

标量除

说到矢量的除法,可能第一反应就是两个向量做比较,可能是模的比值。可以做这个定义,但这个定义用处并不是很大,我有一种用处更大的定义。众所周知,当你用一个尺子测量你的身高,结果是178。常识告诉我们身高是178cm。为什么要写上单位,因为你量取一个东西时,都是用东西的长度除以尺子的单位长度,用下数学式表示:
L / i = 178 L/i=178 L/i=178
式中: L L L是身高, i i i是尺子的单位,常用cm。
如果用两把尺子垂直摆放,则不仅来测量你的身高,还能测量胖瘦。这样可以用两个式子表示
{ L / i = 178 W / j = 34 \left\{ \begin{array}{l} L/i=178& \\ W/j=34 \\ \end{array} \right. {L/i=178W/j=34
式中 i i i j j j组成一组矢量基 M M M L L L W W W是被衡量的对象矢量 P P P分解到 i i i方向和 j j j方向的两个矢量,数学可以这样描述:
P / M = ( P / i P / j ) = ( L / i W / j ) = ( ∣ L ∣ / ∣ i ∣ ∣ W ∣ / ∣ j ∣ ) = ( 178 34 ) P/M=(\begin{array}{l}P/i&P/j\end{array})=(\begin{array}{l}L/i&W/j\end{array})=(\begin{array}{l}|L|/|i|&|W|/|j|\end{array})=(\begin{array}{l}178&34\end{array}) P/M=(P/iP/j)=(L/iW/j)=(L/iW/j)=(17834)这里的 P / i P/i P/i P / j P/j P/j L / i L/i L/i W / j W/j W/j就是矢量之间的除法。 P / M P/M P/M是矢量与矢量基的除法,由于矢量基有多个矢量,矢量对矢量基的除法是矢量对基内的每个矢量进行除法。我们定义一个矢量A对另一个矢量B的标量除为该矢量A在矢量B中的投影长度除以矢量B的长度。上式中 L L L就是 P P P i i i中的投影, W W W就是 P P P j j j中的投影,所以
P / i = L / i , P / j = W / j P/i=L/i,P/j=W/j P/i=L/iP/j=W/j对于两个相互平行的矢量,将两个矢量的模相除才有意义,两个相互平行的矢量的标量除就是两个矢量的模相除。所以 L / i = 178 , W / j = 34 L/i=178,W/j=34 L/i=178,W/j=34标量除法的数学定义如下。 a ⃗ / b ⃗ = p r o j b a ⃗ / b ⃗ = ∣ p r o j b a ⃗ ∣ ∣ b ⃗ ∣ \vec{a}/\vec{b}=proj_b\vec{a}/\vec{b}=\frac{|proj_b\vec{a}|}{|\vec{b}|} a /b =projba /b =b projba 几何表示如下
标量除、矢量除、正交化_第1张图片根据上述的定义可以进一步拓展,
a ⃗ / b ⃗ = ∣ a ⃗ ∣ c o s < a , b > ∣ b ⃗ ∣ = ∣ a ⃗ ∣ ∣ b ⃗ ∣ ∣ a ⃗ b ⃗ ∣ ∣ b ⃗ ∣ = a ⃗ b ⃗ ∣ b ⃗ ∣ 2 \vec{a}/\vec{b}=\frac{|\vec{a}|cos}{|\vec{b}|}=\frac{|\vec{a}|}{|\vec{b}|}\frac{|\vec{a}\vec{b}|}{|\vec{b}|}=\frac{\vec{a}\vec{b}}{|\vec{b}|^2} a /b =b a cos<a,b>=b a b a b =b 2a b
a ⃗ = ( a x , a y , a z ) \vec{a}=(a_x,a_y,a_z) a =(ax,ay,az), b ⃗ = ( b x , b y , b z ) \vec{b}=(b_x,b_y,b_z) b =(bx,by,bz)
a ⃗ / b ⃗ = a x b x + a y b y + a z b z b x 2 + b y 2 + b z 2 \vec{a}/\vec{b}= \frac{a_xb_x+a_yb_y+a_zb_z}{b^2_x+b^2_y+b^2_z} a /b =bx2+by2+bz2axbx+ayby+azbz标量除有线性的关系,若 a = a 1 + a 2 a=a_1+a_2 a=a1+a2,那么 a / b = a 1 / b + a 2 / b a/b=a_1/b+a_2/b a/b=a1/b+a2/b
如果 a a a b b b垂直,那么 a / b = 0 a/b=0 a/b=0
可以简单证明得到

矢量除

有标量除,是否也有矢量除。不管有没有这个自然概念,但可以创造啊。数学早已经走出了从0,1,2,3…和长宽高等自然概念中提取素材的时代,走向了从数学本身来提取素材或者创造概念的时代。
矢量乘有两个特点:1、垂直于参与乘法的矢量,2、模与正弦有关。类比这个,可以按下图定义矢量除
标量除、矢量除、正交化_第2张图片
图中 a ÷ b a\div b a÷b就是 a a a b b b的矢量除,它部分满足两个特点,与 b b b垂直,与 a a a模存在正弦的关系。矢量除可以这么定义:矢量 a a a对矢量 b b b的矢量除就是矢量 a a a对垂直于矢量 b b b且与矢量 a a a和矢量 b b b共面的矢量的投影。根据定义
a ÷ b = a − a / b ⋅ b a\div b=a-a/b \cdot b a÷b=aa/bb
a ⃗ = ( a x , a y , a z ) \vec{a}=(a_x,a_y,a_z) a =(ax,ay,az), b ⃗ = ( b x , b y , b z ) \vec{b}=(b_x,b_y,b_z) b =(bx,by,bz)
a ÷ b = ( a x − a x b x + a y b y + a z b z b x 2 + b y 2 + b z 2 b x a y − a x b x + a y b y + a z b z b x 2 + b y 2 + b z 2 b y a y − a x b x + a y b y + a z b z b x 2 + b y 2 + b z 2 b y ) = ( a x b y 2 + a x b z 2 − a y b y b x − a z b z b x a y b x 2 + a y b z 2 − a x b x b y − a z b z b y a z b x 2 + a z b y 2 − a x b x b z − a y b y b z ) / ( b x 2 + b y 2 + b z 2 ) = ( b y ∣ a x a y b x b y ∣ − b z ∣ a z a x b x b y ∣ b z ∣ a y a z b y b z ∣ − b x ∣ a x a y b x b y ∣ b x ∣ a z a x b z b x ∣ − b y ∣ a y a z b y b z ∣ ) / ( b x 2 + b y 2 + b z 2 ) = b × a × b / ∣ b ∣ 2 a \div b=\begin{pmatrix} a_x-\frac{a_x b_x+a_y b_y+a_z b_z}{b^2_x+b^2_y+b^2_z}b_x \\ a_y-\frac{a_x b_x+a_y b_y+a_z b_z}{b^2_x+b^2_y+b^2_z}b_y \\ a_y-\frac{a_x b_x+a_y b_y+a_z b_z}{b^2_x+b^2_y+b^2_z}b_y \end{pmatrix}\\ =\begin{pmatrix} a_xb^2_y+a_xb^2_z-a_yb_yb_x-a_zb_zb_x \\ a_yb^2_x+a_yb^2_z-a_xb_xb_y-a_zb_zb_y \\ a_zb^2_x+a_zb^2_y-a_xb_xb_z-a_yb_yb_z \end{pmatrix}/(b^2_x+b^2_y+b^2_z)\\ =\begin{pmatrix} b_y\begin{vmatrix}a_x & a_y \\b_x & b_y\end{vmatrix}-b_z\begin{vmatrix}a_z & a_x \\b_x & b_y\end{vmatrix} \\ b_z\begin{vmatrix}a_y & a_z \\b_y & b_z\end{vmatrix}-b_x\begin{vmatrix}a_x & a_y \\b_x & b_y\end{vmatrix} \\ b_x\begin{vmatrix}a_z & a_x \\b_z & b_x\end{vmatrix}-b_y\begin{vmatrix}a_y & a_z \\b_y & b_z\end{vmatrix} \end{pmatrix}/(b^2_x+b^2_y+b^2_z)\\=b\times a\times b/|b|^2 a÷b=axbx2+by2+bz2axbx+ayby+azbzbxaybx2+by2+bz2axbx+ayby+azbzbyaybx2+by2+bz2axbx+ayby+azbzby=axby2+axbz2aybybxazbzbxaybx2+aybz2axbxbyazbzbyazbx2+azby2axbxbzaybybz/(bx2+by2+bz2)=byaxbxaybybzazbxaxbybzaybyazbzbxaxbxaybybxazbzaxbxbyaybyazbz/(bx2+by2+bz2)=b×a×b/b2 a ÷ b = b × a × b / ∣ b ∣ 2 a \div b=b\times a\times b/|b|^2 a÷b=b×a×b/b2
矢量除有线性的关系,若 a = a 1 + a 2 a=a_1+a_2 a=a1+a2,那么 a ÷ b = a 1 ÷ b + a 2 ÷ b a\div b=a_1\div b+a_2\div b a÷b=a1÷b+a2÷b
如果 a a a b b b垂直,那么 a ÷ b = a c ÷ a ÷ b = c ÷ b ÷ a = c − c / a ⋅ a − c / b ⋅ b a\div b=a\\c\div a\div b=c\div b\div a=c-c/a\cdot a-c/b\cdot b a÷b=ac÷a÷b=c÷b÷a=cc/aac/bb
矢量除与标量除的混合运算
( a ÷ b ) / c = a / c − a / b ⋅ b / c (a\div b)/c=a/c-a/b\cdot b/c (a÷b)/c=a/ca/bb/c
还有很多混合运算,后续我将一个一个推导
a / ( b ÷ c ) = ? a ⋅ ( b ÷ c ) = ? a/(b\div c)=?\\ a\cdot (b\div c)=? a/(b÷c)=?a(b÷c)=?

投影

矢量 a a a向矢量 b b b投影我们记为 p r o j b a proj_ba projba,在平面内,矢量 a a a向垂直于矢量 b b b矢量投影我们记为 p r e p b a prep_ba prepba,也可以称其为垂矢。他们与标量除和矢量除有如下关系
p r o j b a = a / b ⋅ b p r e p b a = a ÷ b proj_ba=a/b\cdot b\\ prep_ba=a \div b projba=a/bbprepba=a÷b矢量向平面的投影又如何,矢量向平面的垂矢又如何呢?已知某平面内两个向量 a a a b b b,平面外的一个矢量 c c c,如图所示
标量除、矢量除、正交化_第3张图片
可以肯定c在平面的投影 p r o p a b c = k a ⋅ a + k b ⋅ b prop_{ab}c=k_a \cdot a+k_b \cdot b propabc=kaa+kbb,当然还有很多种表达都可以,这种在几何上体现形式更好,符合矢量合成的平行四边形的美感。可知
p r o j a b c / a = c / a p r o j a b c / b = c / b proj_{ab}c/a=c/a\\proj_{ab}c/b=c/b projabc/a=c/aprojabc/b=c/b
所以
( k a ⋅ a + k b ⋅ b ) / a = k a + k b ⋅ b / a ( k a ⋅ b + k b ⋅ b ) / b = k a ⋅ a / b + k b (k_a\cdot a+k_b\cdot b)/a=k_a+k_b\cdot b/a\\(k_a\cdot b+k_b\cdot b)/b=k_a\cdot a/b+k_b (kaa+kbb)/a=ka+kbb/a(kab+kbb)/b=kaa/b+kb

求解 k a k_a ka k b k_b kb
k a = c / b ⋅ b / a − c / a b / a ⋅ a / b − 1 = ( c ÷ b ) / a 1 − b / a ⋅ a / b k b = c / a ⋅ a / b − c / b b / a ⋅ a / b − 1 = ( c ÷ a ) / b 1 − b / a ⋅ a / b k_a=\frac{c/b\cdot b/a-c/a}{b/a\cdot a/b-1}=\frac{(c\div b)/a}{1-b/a\cdot a/b}\\k_b=\frac{c/a\cdot a/b-c/b}{b/a\cdot a/b-1}=\frac{(c\div a)/b}{1-b/a\cdot a/b} ka=b/aa/b1c/bb/ac/a=1b/aa/b(c÷b)/akb=b/aa/b1c/aa/bc/b=1b/aa/b(c÷a)/b
a a a b b b垂直时 a / b = 0 , b / a = 0 a/b=0,b/a=0 a/b=0,b/a=0,所以
k a = c / a k b = c / b k_a=c/a\\k_b=c/b ka=c/akb=c/b
垂矢的求法为 c c c先对 a a a求垂矢得 c ÷ a c\div a c÷a,再对 a a a在平面上垂直矢量 b ÷ a b\div a b÷a求垂矢,即 ( c ÷ a ) ÷ ( b ÷ a ) (c\div a)\div (b\div a) (c÷a)÷(b÷a),可以证明此矢量垂直于 a a a b ÷ a b\div a b÷a,所以此矢量垂直于平面,所以
p r e p a b c = ( c ÷ a ) ÷ ( b ÷ a ) prep_{ab}c=(c\div a)\div (b\div a) prepabc=(c÷a)÷(b÷a)
也可以表达为
p r e p a b c = ( c ÷ b ) ÷ ( a ÷ b ) prep_{ab}c=(c\div b)\div (a\div b) prepabc=(c÷b)÷(a÷b)
因此 c c c在平面上投影的另一种表达为
p r o p a b c = c − ( c ÷ a ) ÷ ( b ÷ a ) prop_{ab}c=c-(c\div a)\div (b\div a) propabc=c(c÷a)÷(b÷a)
存在如下两个关系 ( c ÷ a ) ÷ ( b ÷ a ) + ( c ÷ b ) / a 1 − b / a ⋅ a / b ⋅ a + ( c ÷ a ) / b 1 − b / a ⋅ a / b ⋅ b = c (c\div a)\div (b\div a)+\frac{(c\div b)/a}{1-b/a\cdot a/b}\cdot a+\frac{(c\div a)/b}{1-b/a\cdot a/b} \cdot b=c (c÷a)÷(b÷a)+1b/aa/b(c÷b)/aa+1b/aa/b(c÷a)/bb=c
( c ÷ a ) ÷ ( b ÷ a ) / / a × b (c\div a)\div (b\div a)//a\times b (c÷a)÷(b÷a)//a×b
后续证明

正交化

正交化是指已知一系列的不平行矢量 a 1 , a 2 , a 3 , a 4 . . . a n a_1,a_2,a_3,a_4...a_n a1,a2,a3,a4...an求其所在空间的正交基 b 1 , b 2 , b 3 , b 4 . . . b n b_1,b_2,b_3,b_4...b_n b1,b2,b3,b4...bn。有了这些正交的基,继续单位化,就构建了一套坐标系。之前投影讲到矢量 a a a b b b的垂矢,矢量 c c c到矢量 a a a b b b组建的平面的垂矢就是一个正交化的过程。用 a 1 a_1 a1代替 a a a a 2 a_2 a2代替 b b b a 3 a_3 a3代替 c c c b 1 , b 2 , b 3 b_1,b_2,b_3 b1,b2,b3为生成的正交矩阵,其过程如下
b 1 = a 1 b 2 = a 2 ÷ b 1 b 3 = ( a 3 ÷ b 1 ) ÷ b 2 b_1=a_1\\ b_2=a_2\div b_1\\ b_3=(a_3\div b_1)\div b_2 b1=a1b2=a2÷b1b3=(a3÷b1)÷b2
扩展到四维呢?扩展到多维呢?大胆假设
b 1 = a 1 b 2 = a 2 ÷ b 1 b 3 = a 3 ÷ b 1 ÷ b 2 b 4 = a 4 ÷ b 1 ÷ b 2 ÷ b 3 ⋮ b n = a n ÷ b 1 ÷ b 2 ÷ b 3 ÷ ⋯ ÷ b n − 1 b_1=a_1\\ b_2=a_2\div b_1\\ b_3=a_3\div b_1\div b_2\\ b_4=a_4\div b_1\div b_2\div b_3\\ \vdots\\ b_n=a_n\div b_1\div b_2\div b_3\div \cdots \div b_{n-1} b1=a1b2=a2÷b1b3=a3÷b1÷b2b4=a4÷b1÷b2÷b3bn=an÷b1÷b2÷b3÷÷bn1
小心求证: 求证的目标就是 b 1 , b 2 , b 3 , ⋯   , b n − 1 , b n b_1,b_2,b_3,\cdots,b_{n-1},b_n b1,b2,b3,,bn1,bn相互两两垂直,采用递推法进行证明:
n = 2 n=2 n=2时,因为 b 2 = a 2 ÷ b 1 b_2=a_2\div b_1 b2=a2÷b1根据矢量除的定义就可知 b 2 b_2 b2 b 1 b_1 b1垂直
n = 3 n=3 n=3时, b 3 = a 3 ÷ b 1 ÷ b 2 b 3 = ( a 3 − a 3 / b 1 ⋅ b 1 ) ÷ b 2 b 3 = a 3 ÷ b 2 − a 3 / b 1 ⋅ b 1 ÷ b 2 b_3=a_3\div b_1\div b_2\\ b_3=(a_3-a_3/b_1\cdot b_1)\div b_2\\ b_3=a_3\div b_2-a_3/b_1 \cdot b_1\div b_2 b3=a3÷b1÷b2b3=(a3a3/b1b1)÷b2b3=a3÷b2a3/b1b1÷b2
因为 b 1 b_1 b1 b 2 b_2 b2垂直,所以 b 1 ÷ b 2 = b 1 b_1\div b_2=b_1 b1÷b2=b1,所以 b 3 = a 3 − a 3 / b 2 ⋅ b 2 − a 3 / b 1 ⋅ b 1 b_3=a_3-a_3/b_2 \cdot b_2-a_3/b_1\cdot b_1 b3=a3a3/b2b2a3/b1b1
所以
b 3 / b 1 = ( a 3 − a 3 / b 2 ⋅ b 2 − a 3 / b 1 ⋅ b 1 ) b 3 / b 1 = a 3 / b 1 − a 3 / b 2 ⋅ b 2 / b 1 − a 3 / b 1 ⋅ b 1 / b 1 b_3/b_1=(a_3-a_3/b_2 \cdot b_2-a_3/b_1\cdot b_1)\\ b_3/b_1=a_3/b_1-a_3/b_2 \cdot b_2/b_1-a_3/b_1\cdot b_1/b_1 b3/b1=(a3a3/b2b2a3/b1b1)b3/b1=a3/b1a3/b2b2/b1a3/b1b1/b1
因为 b 2 b_2 b2 b 1 b_1 b1垂直,所以 b 2 / b 1 = 0 b_2/b_1=0 b2/b1=0,所以
b 3 / b 1 = a 3 / b 1 − a 3 / b 1 ⋅ b 1 / b 1 b 3 / b 1 = a 3 / b 1 − a 3 / b 1 = 0 b_3/b_1=a_3/b_1-a_3/b_1\cdot b_1/b_1\\ b_3/b_1=a_3/b_1-a_3/b_1=0 b3/b1=a3/b1a3/b1b1/b1b3/b1=a3/b1a3/b1=0
所以 b 3 b_3 b3 b 1 b_1 b1垂直, b 3 b_3 b3 b 2 b_2 b2的垂直关系可采用同样的方式证明,当然如果熟悉矢量除的定义,也可以直接看出 b 3 b_3 b3 b 2 b_2 b2的关系。
n = k − 1 n=k-1 n=k1 b 1 , b 2 , b 3 , ⋯   , b k − 1 b_1,b_2,b_3,\cdots,b_{k-1} b1,b2,b3,,bk1相互两两垂直,那么 n = k n=k n=k
b k = a k ÷ b 1 ÷ b 2 ÷ b 3 ÷ ⋯ ÷ b k − 1 b k = a k − a k / b 1 ⋅ b 1 − a k / b 2 ⋅ b 2 − a k / b 3 ⋅ b 3 − ⋯ − a k / b n − 1 ⋅ b n − 1 b_k=a_k\div b_1\div b_2\div b_3\div \cdots \div b_{k-1}\\ b_k=a_k-a_k/b_1\cdot b_1-a_k/b_2\cdot b_2-a_k/b_3\cdot b_3-\cdots -a_k/b_{n-1}\cdot b_{n-1} bk=ak÷b1÷b2÷b3÷÷bk1bk=akak/b1b1ak/b2b2ak/b3b3ak/bn1bn1
b 1 , b 2 , b 3 , ⋯   , b k − 1 b_1,b_2,b_3,\cdots,b_{k-1} b1,b2,b3,,bk1任意选择一个 k i k_i ki,计算 b k / b i b_k/b_i bk/bi
b k / b i = a k / b i − a k / b 1 ⋅ b 1 / b i − a k / b 2 ⋅ b 2 / b i − a k / b 3 ⋅ b 3 / b i − ⋯ − a k / b i ⋅ b i / b i − ⋯ − a k / b n − 1 ⋅ b n − 1 / b i b_k/b_i=a_k/b_i-a_k/b_1\cdot b_1/b_i-a_k/b_2\cdot b_2/b_i-a_k/b_3\cdot b_3/b_i-\cdots\\-a_k/b_i\cdot b_i/b_i-\cdots -a_k/b_{n-1}\cdot b_{n-1}/b_i bk/bi=ak/biak/b1b1/biak/b2b2/biak/b3b3/biak/bibi/biak/bn1bn1/bi所以 b k / b i = a k / b i − a k / b i ⋅ b i / b i = 0 b_k/b_i=a_k/b_i-a_k/b_i\cdot b_i/b_i=0 bk/bi=ak/biak/bibi/bi=0
所以 b k b_k bk b 1 , b 2 , b 3 , ⋯   , b k − 1 b_1,b_2,b_3,\cdots,b_{k-1} b1,b2,b3,,bk1任意一个矢量垂直,也就是 b 1 , b 2 , b 3 , ⋯   , b k b_1,b_2,b_3,\cdots,b_k b1,b2,b3,,bk内的所以矢量都相互两两垂直。证明完毕!
等等,或许有人疑问,为啥 b k = a k − a k / b 1 ⋅ b 1 − a k / b 2 ⋅ b 2 − a k / b 3 ⋅ b 3 − ⋯ − a k / b n − 1 ⋅ b n − 1 b_k=a_k-a_k/b_1\cdot b_1-a_k/b_2\cdot b_2-a_k/b_3\cdot b_3-\cdots -a_k/b_{n-1}\cdot b_{n-1} bk=akak/b1b1ak/b2b2ak/b3b3ak/bn1bn1这个可以自行递推证明一下。
提示一下,对于 b 1 , b 2 , b 3 , ⋯   , b m b_1,b_2,b_3,\cdots,b_m b1,b2,b3,,bm内的所有矢量相互两两垂直,若下式成立 a ÷ b 1 ÷ b 2 ÷ ⋯ ÷ b m − 1 = a − a / b 1 ⋅ b 1 − a / b 2 ⋅ b 2 − ⋯ − a / b m − 1 ⋅ b m − 1 a\div b_1 \div b_2 \div \cdots \div b_{m-1}=a-a/b_1 \cdot b_1-a/b_2 \cdot b_2-\cdots -a/b_{m-1} \cdot b_{m-1} a÷b1÷b2÷÷bm1=aa/b1b1a/b2b2a/bm1bm1 a ÷ b 1 ÷ b 2 ÷ ⋯ ÷ b m = a − a / b 1 ⋅ b 1 − a / b 2 ⋅ b 2 − ⋯ − a / b m − 1 ⋅ b m − 1 − a / b m ⋅ b m a\div b_1 \div b_2 \div \cdots \div b_{m}=a-a/b_1 \cdot b_1-a/b_2 \cdot b_2-\cdots -a/b_{m-1} \cdot b_{m-1}-a/b_{m} \cdot b_{m} a÷b1÷b2÷÷bm=aa/b1b1a/b2b2a/bm1bm1a/bmbm

施密特正交化与QR分解

根据上节内容,我们知道
b 1 = a 1 b 2 = a 2 ÷ b 1 b 3 = a 3 ÷ b 1 ÷ b 2 b 4 = a 4 ÷ b 1 ÷ b 2 ÷ b 3 ⋮ b n = a n ÷ b 1 ÷ b 2 ÷ b 3 ÷ ⋯ ÷ b n − 1 b_1=a_1\\ b_2=a_2\div b_1\\ b_3=a_3\div b_1\div b_2\\ b_4=a_4\div b_1\div b_2\div b_3\\ \vdots\\ b_n=a_n\div b_1\div b_2\div b_3\div \cdots \div b_{n-1} b1=a1b2=a2÷b1b3=a3÷b1÷b2b4=a4÷b1÷b2÷b3bn=an÷b1÷b2÷b3÷÷bn1 b k = a k − a k / b 1 ⋅ b 1 − a k / b 2 ⋅ b 2 − a k / b 3 ⋅ b 3 − ⋯ − a k / b n − 1 ⋅ b n − 1 b_k=a_k-a_k/b_1\cdot b_1-a_k/b_2\cdot b_2-a_k/b_3\cdot b_3-\cdots -a_k/b_{n-1}\cdot b_{n-1} bk=akak/b1b1ak/b2b2ak/b3b3ak/bn1bn1
那么可以将 b 1 , b 2 , b 3 ⋯ b n b_1,b_2,b_3\cdots b_n b1,b2,b3bn展开来,
b 1 = a 1 b 2 = a 2 − a 2 / b 1 ⋅ b 1 b 3 = a 3 − a 3 / b 1 ⋅ b 1 − a 3 / b 2 ⋅ b 2 b 4 = a 4 − a 4 / b 1 ⋅ b 1 − a 4 / b 2 ⋅ b 2 − a 4 / b 3 ⋅ b 3 ⋮ b n = a n − a n / b 1 ⋅ b 1 − a n / b 2 ⋅ b 2 − a n / b 3 ⋅ b 3 − ⋯ − a n / b n − 1 ⋅ b n − 1 b_1=a_1\\ b_2=a_2-a_2/ b_1\cdot b_1\\ b_3=a_3-a_3/ b_1\cdot b_1-a_3/ b_2\cdot b_2\\ b_4=a_4-a_4/ b_1\cdot b_1-a_4/ b_2\cdot b_2-a_4/ b_3\cdot b_3\\ \vdots\\ b_n=a_n-a_n/ b_1\cdot b_1-a_n/ b_2\cdot b_2-a_n/ b_3\cdot b_3-\cdots-a_n/ b_{n-1}\cdot b_{n-1} b1=a1b2=a2a2/b1b1b3=a3a3/b1b1a3/b2b2b4=a4a4/b1b1a4/b2b2a4/b3b3bn=anan/b1b1an/b2b2an/b3b3an/bn1bn1
所以
b 1 = a 1 b 2 = a 2 − k 2 , 1 ⋅ b 1 b 3 = a 3 − k 3 , 1 ⋅ b 1 − k 3 , 2 ⋅ b 2 b 4 = a 4 − k 4 , 1 ⋅ b 1 − k 4 , 2 ⋅ b 2 − k 4 , 3 ⋅ b 3 ⋮ b n = a n − k n , 1 ⋅ b 1 − k n , 2 ⋅ b 2 − k n , 3 ⋅ b 3 − ⋯ − k n , n − 1 ⋅ b n − 1 b_1=a_1\\ b_2=a_2-k_{2,1}\cdot b_1\\ b_3=a_3-k_{3,1}\cdot b_1-k_{3,2}\cdot b_2\\ b_4=a_4-k_{4,1}\cdot b_1-k_{4,2}\cdot b_2-k_{4,3}\cdot b_3\\ \vdots\\ b_n=a_n-k_{n,1}\cdot b_1-k_{n,2}\cdot b_2-k_{n,3}\cdot b_3-\cdots-k_{n,n-1}\cdot b_{n-1} b1=a1b2=a2k2,1b1b3=a3k3,1b1k3,2b2b4=a4k4,1b1k4,2b2k4,3b3bn=ankn,1b1kn,2b2kn,3b3kn,n1bn1其中
k i , j = { a i / b j = a i ⋅ b j ∣ a i ∣ 2 ; ( i > j ) 1 , ( i = j ) k_{i,j}= \begin{cases} a_i/b_j=\frac{a_i\cdot b_j}{|a_i|^2}; &(i>j) \\ 1, &(i=j) \end{cases} ki,j={ai/bj=ai2aibj;1,(i>j)(i=j)这就是施密特正交化,将所有 a a a放在等号左边,所有 b b b放在等号右边
a 1 = b 1 a 2 = k 2 , 1 ⋅ b 1 + b 2 a 3 = k 3 , 1 ⋅ b 1 + k 3 , 2 ⋅ b 2 + b 3 a 4 = k 4 , 1 ⋅ b 1 + k 4 , 2 ⋅ b 2 + k 4 , 3 ⋅ b 3 + b 4 ⋮ a n = k n , 1 ⋅ b 1 + k n , 2 ⋅ b 2 + k n , 3 ⋅ b 3 + ⋯ + k n , n − 1 ⋅ b n − 1 + b n a_1=b_1\\ a_2=k_{2,1}\cdot b_1+b_2\\ a_3=k_{3,1}\cdot b_1+k_{3,2}\cdot b_2+b_3\\ a_4=k_{4,1}\cdot b_1+k_{4,2}\cdot b_2+k_{4,3}\cdot b_3+b_4\\ \vdots\\ a_n=k_{n,1}\cdot b_1+k_{n,2}\cdot b_2+k_{n,3}\cdot b_3+\cdots+k_{n,n-1}\cdot b_{n-1}+b_n a1=b1a2=k2,1b1+b2a3=k3,1b1+k3,2b2+b3a4=k4,1b1+k4,2b2+k4,3b3+b4an=kn,1b1+kn,2b2+kn,3b3++kn,n1bn1+bn将所有 b b b换成其单位向量 q q q,则有
a 1 = ∣ b 1 ∣ ⋅ q 1 a 2 = k 2 , 1 ∣ b 1 ∣ ⋅ q 1 + ∣ b 2 ∣ ⋅ q 2 a 3 = k 3 , 1 ∣ b 1 ∣ ⋅ q 1 + k 3 , 2 ∣ b 2 ∣ ⋅ q 2 + ∣ b 3 ∣ ⋅ q 3 a 4 = k 4 , 1 ∣ b 1 ∣ ⋅ q 1 + k 4 , 2 ∣ b 2 ∣ ⋅ q 2 + k 4 , 3 ∣ b 3 ∣ ⋅ q 3 + ∣ b 4 ∣ ⋅ q 4 ⋮ a n = k n , 1 ∣ b 1 ∣ ⋅ q 1 + k n , 2 ∣ b 2 ∣ ⋅ q 2 + k n , 3 ∣ b 3 ∣ ⋅ q 3 + ⋯ + k n , n − 1 ∣ b n 1 ∣ ⋅ q n − 1 + ∣ b n ∣ ⋅ q n a_1=|b_1|\cdot q_1\\ a_2=k_{2,1}|b_1|\cdot q_1+|b_2|\cdot q_2\\ a_3=k_{3,1}|b_1|\cdot q_1+k_{3,2}|b_2|\cdot q_2+|b_3|\cdot q_3\\ a_4=k_{4,1}|b_1|\cdot q_1+k_{4,2}|b_2|\cdot q_2+k_{4,3}|b_3|\cdot q_3+|b_4|\cdot q_4\\ \vdots\\ a_n=k_{n,1}|b_1|\cdot q_1+k_{n,2}|b_2|\cdot q_2+k_{n,3}|b_3|\cdot q_3+\cdots+k_{n,n-1}|b_{n_1}|\cdot q_{n-1}+|b_n|\cdot q_n a1=b1q1a2=k2,1b1q1+b2q2a3=k3,1b1q1+k3,2b2q2+b3q3a4=k4,1b1q1+k4,2b2q2+k4,3b3q3+b4q4an=kn,1b1q1+kn,2b2q2+kn,3b3q3++kn,n1bn1qn1+bnqn
若写成矩阵的形式就是
( a 1 a 2 a 3 ⋯ a n ) = ( r 1 , 1 0 0 ⋯ 0 r 2 , 1 r 2 , 2 0 ⋯ 0 r 3 , 1 r 3 , 2 r 3 , 3 ⋯ 0 ⋮ ⋮ ⋮ ⋱ ⋮ r n , 1 r n , 2 r n , 3 ⋯ r n , n ) ( q 1 q 2 q 3 ⋯ q n ) \begin{pmatrix} a_1\\a_2\\a_3\\ \cdots \\a_n \end{pmatrix}= \begin{pmatrix} r_{1,1} & 0&0&\cdots&0 \\ r_{2,1} & r_{2,2} &0&\cdots&0\\ r_{3,1} & r_{3,2}&r_{3,3} &\cdots&0\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ r_{n,1}&r_{n,2}&r_{n,3}&\cdots&r_{n,n} \end{pmatrix} \begin{pmatrix} q_1\\q_2\\q_3\\ \cdots \\q_n \end{pmatrix} a1a2a3an=r1,1r2,1r3,1rn,10r2,2r3,2rn,200r3,3rn,3000rn,nq1q2q3qn
其中 r i , j = k i , j ∣ b j ∣ r_{i,j}=k_{i,j}|b_j| ri,j=ki,jbj
这就是QR分解, Q Q Q是一个单位正交矩阵,放在复域,称为酉矩阵
Q = ( q 1 q 2 q 3 ⋯ q n ) Q=\begin{pmatrix} q_1\\q_2\\q_3\\ \cdots \\q_n \end{pmatrix} Q=q1q2q3qn
经过QR分解,一个满秩矩阵可以分解成一个下三角矩阵乘单位正交矩阵,这可以用于线性最小二乘问题的求解和矩阵特征值的计算。

你可能感兴趣的:(数学,线性代数)