Teacher:Gilbert Strang
The text of the course: Introduction to Linear Algebra
Website:web.mit.edu/18.06,which got a lot of exercise from the past MATLAB codes, the syllabus for the course
class1 and class2
方程组的几何解释
画了两个图,分别表示col和row形式。row就是用正常的方程组写,然后解代表直线(二维)的交点。而col是vector相加的形式,即linear combination(这表明矩阵的col代表vector)。
elimination消元法
Can I solve Ax=b for every b?如果有解的话,就可以用消元法解出来。同样的问法 Do the linear combination of the columns fill three dimensional space?这意味着方程组的解b代表着线性空间的点。
matrix multiply 方法1、[2 5;1 3]【1 2】=1【1 2】+2【1 3】。
Ax is comb of columns of A数据量大的时候这么理解更方便。
Determinants行列式
step1:subtract 3 row1 from row2、step2:subtract 2 row2 from row3 **
[1 0 0 [1 0 0 [1 2 1
-3 1 0 * 3 8 2 = 0 2 -2
0 0 1] 0 4 1] 0 4 1]
E21(E为Elementary Matrics)
a important fact move the parentheses arbitrary 任意交换括号
Problem1:image Permutation Matrics想象[a b;c d]的置换矩阵(行置换)
Problem2:image Matrix’s [1 0 0;-3 1 0;0 0 1] Inverses
Lecture 3 and Lecture 4
four way of matrix multiplication 1st:normal way, row*col
2ed: cols way; 3st: rows way; 4th:col * row(m by 1 times 1 by p equals m by p); 5th:Block way.
Inverses
A-1(if this is exist) * A = I = A * A-1 左逆与右逆没有区别
Gauss-Jordan:[A I]->[I A-1]将【A I】同乘A-1即可理解
A=LU(L、U represent lower matrix and upper matrix)
与EA=U相比,更简洁.例:E=【1 0 0;-2 1 0;10 -5 1】则L=【1 0 0;2 1 0;0 5 1】
If no row exchanges the multipliers go directly into L(应该有负号?)
**How many operations on n*n matrix A?**应以Matlab算法复杂度的角度思考。count 1/3n3 on A,count n2 on b(back substitution)。
Permutation:identity matrix with reordered rows
(A-1)T=(AT)-1
number of permutation 3 by 3 matrix have 6P(Pemutation matrices)'s;n by n matrix have n! P’s
P-1=PT;PPT=I
R * RT is always symmetric
Lecture 5
Vectors spaces and subspaces
must satisfied multiply and addition
R2 = all 2-dim real vectors
R3 = all columns with 3 real components
subspaces of R2
1、all of R2
2、any line through [0 0]
3、zero vector only
A = [1 3;2 3;4 1]; for columns of A, in R3 , all their combinations from subspace called column space, C(A).
Lecture 6
two ways to get the subspaces Ax=0. A=[1 2 3 4;1 1 1 1;2 3 4 5]T
1: Columnspace: Does Ax=b have a solution for evering b? no. Which b’s allow this system to be solved? Can solve Ax=b exactly when b is in C(A)
2:Nullspace; Ax=0; N(A)=[c c -c]; check that solutions to Ax=0give a subspace always, If Av=0 and Aw=0 then A(v+w)=0 ,then A(2v)=0.
Ax=[1234],the solutions isn’t a subspace(substitution the [000] to x.).
Lecture 7
A=
1 2 2 2
2 4 6 8
3 6 8 10
echelon U=
1 2 2 2
0 0 2 4
0 0 0 0
the zero representes the second column is dependent on the eariler columns
there are two pivot columns, one free column
rank of A= # of pivots =2
# of free variables=n-r=4-2=2
special solution: two ways
1: back substitution
x1+2x2+2x3+2x4=0
2x3+4x4=0
X=c[-2;1;0;0]+d[2;0;-2;1]
2:R=(in MATLAB, use rref(A) to get R)
rref为reduced row echelon form
[1 2 2 2
0 0 1 2
0 0 0 0]
write:X=a*[unknow1 1 unknow2 0]T+b*[unknow3 0 unknow4 1]
[I F
0 0] form:
[1 0 2 -2
0 1 0 2
0 0 0 0]
X=a*[-2 1 0 0]+c*[2 0 -2 1]T
proof:
[I F] [xpoint;xfree]=0
xpoint=-F*xfree
Lecture 8
Complete solution of Ax=b
A=
1 2 2 2 b1
2 4 6 8 b2
3 6 8 10 b3
echelon U=
1 2 2 2 b1
0 0 2 4 b2-2*b1
0 0 0 0 b3-b2-b1
Solivability condition on b: Ax=b solvable when b in C(A).
b3-b2-b1=0 If a comb of rows of A gives zero row, then same comb. of entries of b must give 0.
To find complete sol’s to Ax=b,x=xparticular+xnullspace
you can set all free variables to zero to get xparticular.
m by n matrix A of rank r(know r<=m, r<=n)
4 situations:
1:r=m=n
A=
1 2
2 4 ;
R=I;
1 solution
2:r=n<m
A=
1 2
2 4
3 6;
R=[I; 0];
0 or 1 solution
3:r=m<n
R=[I F];
infinite solution
4:r<m, r<n
R=
[I F
0 0 ]
0 or infinite solutions
Lecture 9
Suppose A is m by n. with m<n. Then there are nonzero solutions to Ax=0.(more unknow than equations)
Reason: There will be free variables!!!
Independence: vectorsX1,X2,…,Xn are independent if no combination gives zero vector (except the zero comb,all cj=0)
c1x1+c2x2+…+cnxn=0
rank=n; N(A)={0};no free variables;
rank<n; yes free variables
span: Vectors V1,…Vl span a space means: The space consists of all combs of those vectors
Basis: Basis for a space is a sequence of vectors V1,V2,…,Vd with 2 propertities
1、They are independent
2: They span the space
Dimension: Every basis for the space has the same number of vectorrs, the number is DEFINITION OF DIMENSION
rank= # of pivot columns=dimension of C(A)
dim N(A)= # of free variables= n-r
Lecture 10
4 subspaces
1、columnspace C(A) in Rm
dim(C(A))=r;
2、nullspace N(A) in Rn
dim(N(A))=n-r=free variables=# of special solutions
3、row space = all combs. of rows = all combs of columns of C(AT)=C(AT)
dim(C(AT))=r
4、null space of AT = N(AT)=left nullspace of A
dim(N(AT))=m-r
A=
1 2 3 1
1 1 2 1
1 2 3 1
R=
1 0 1 1
0 1 1 0
0 0 0 0
C( R)!=C(A): different col space || same row space
N(AT) ATy=0 yTA=0
how to solve N(AT): E[Am*n Im*m]–>[Rm*n Em*n]
EA=R
E=
-1 2 0
-1 1 0
-1 0 0 0
the yellow part is yT. In chap 2, R was I, The E was A-1
new vector space
All 3+3 matrices
subspaces of M || upper triangulars || symmetric matrices || diagonal matrices ( dim of this subspace is 3.)
Lecture 11
In R4, v=[v1;v2;v3;v4],
S= all v in R4 with v1+v2+v3+v4=0
=nullspace of A =[1 1 1 1]
rank=1; dim(N)=n-r=3
small world graph
Graph={nodes, edges}
(这节存的稿子没保存,淦)
Lecture 12
Incidence matrics
node1 2 3 4
A = [-1 1 0 0 edge
0 -1 1 0
-1 0 1 0
-1 0 0 1
0 0 -1 1]
row1、2、3 consist a loop
Ax=0(x=x1,x2,x3,x4) --e=Ax–>x2-x1,etc,…Potential
differences --y=Ce–>current y1,y2,y3,y4,y5 --ATy=f–> Kirchoff’s CL
ATCAx=f
Tree=no loops
ATy=0 dimN(AT)=2=m-r=2
Lecture 13
review
N(CD)=N(D); if C is invertible