向量和线性方程
假设有线性方程组(方程中的未知数前都是乘以的数字,称为线性方程):
x−2y=1 x − 2 y = 1
3x+2y=11 3 x + 2 y = 11
row picture
线的交点即为方程组的解
column picture
将线性方程组转化为向量方程(vector equation):
x[13]+y[−22]=[111]=b x [ 1 3 ] + y [ − 2 2 ] = [ 1 11 ] = b
问题就转化为了找到左侧两个向量(coloumn vector)的组合(linear combination),来得到右侧向量
scalar multiplication
纯量乘法指的是标量乘以向量
3[13]=[39] 3 [ 1 3 ] = [ 3 9 ]
vector addition
[39]+[−22]=[111] [ 3 9 ] + [ − 2 2 ] = [ 1 11 ]
linear combination
向量方程的左侧称为linear combination
3[13]+[−22]=[111] 3 [ 1 3 ] + [ − 2 2 ] = [ 1 11 ]
coefficient matrix
系数矩阵
A=[13−22] A = [ 1 − 2 3 2 ]
maxtrix equation
矩阵方程Ax=b A x = b
[13−22][xy]=[111] [ 1 − 2 3 2 ] [ x y ] = [ 1 11 ]
maxtrix-vector multiplication:
[13−22][31]=[111] [ 1 − 2 3 2 ] [ 3 1 ] = [ 1 11 ]
矩阵方程形式
row picture
假设有如下三元方程组:
x+2y+3z=6 x + 2 y + 3 z = 6
2x+5y+2z=4 2 x + 5 y + 2 z = 4
6x−3y+z=2 6 x − 3 y + z = 2
row picture表示三个面交于一点
column picture
表示表示组合三个列向量得到向量(6,4,2)
x⎡⎣⎢⎢126⎤⎦⎥⎥+y⎡⎣⎢⎢25−3⎤⎦⎥⎥+z⎡⎣⎢⎢321⎤⎦⎥⎥=⎡⎣⎢⎢642⎤⎦⎥⎥ x [ 1 2 6 ] + y [ 2 5 − 3 ] + z [ 3 2 1 ] = [ 6 4 2 ]
矩阵方程形式Ax=b A x = b
⎡⎣⎢⎢12625−3321⎤⎦⎥⎥⎡⎣⎢⎢xyz⎤⎦⎥⎥=⎡⎣⎢⎢642⎤⎦⎥⎥ [ 1 2 3 2 5 2 6 − 3 1 ] [ x y z ] = [ 6 4 2 ]
A:系数矩阵
b:列向量,分量为1,11
x:列向量,分量为x,y
Ax A x的计算两种方式:
1.行乘法:Ax=⎡⎣⎢⎢(row1)(row2)(row3)...xxx⎤⎦⎥⎥ A x = [ ( r o w 1 ) . x ( r o w 2 ) . x ( r o w 3 ) . x ]
比如第一行的dot products结果:(1,2,3).(0,0,2)=6 ( 1 , 2 , 3 ) . ( 0 , 0 , 2 ) = 6
如果有:
aij a i j表示矩阵第i行第j列的”component”,也记做 A(i,j) A ( i , j )
则第i行的dot products结果: ai1x1+ai2x2+...+ainxn a i 1 x 1 + a i 2 x 2 + . . . + a i n x n
也就是: ∑nj=1aijxj ∑ j = 1 n a i j x j
2.列乘法:Ax=x(column1)+y(column2)+z(column3) A x = x ( c o l u m n 1 ) + y ( c o l u m n 2 ) + z ( c o l u m n 3 )
x⎡⎣⎢⎢126⎤⎦⎥⎥+y⎡⎣⎢⎢25−3⎤⎦⎥⎥+z⎡⎣⎢⎢321⎤⎦⎥⎥=⎡⎣⎢⎢642⎤⎦⎥⎥ x [ 1 2 6 ] + y [ 2 5 − 3 ] + z [ 3 2 1 ] = [ 6 4 2 ]
单位矩阵(identity matrix)
I⎡⎣⎢⎢100010001⎤⎦⎥⎥ I [ 1 0 0 0 1 0 0 0 1 ]
Ix=x I x = x