MIT18_065S18P-lecture one notes

Lecture One Notes



student name: ZhouZhuoFei

more information can see, if you want to interactive with figure

we take a matrix A here:

A = [ 2 1 3 3 1 4 5 7 12 ] A = \begin{bmatrix} 2 & 1 & 3 \\ 3 & 1 & 4 \\ 5 & 7 & 12 \end{bmatrix} A=2351173412

Calculate A x Ax Ax, there are two ways to do:

  1. dot products of r o w s ⋅ x rows \cdot x rowsx(low levels)
  2. use columns to times x

for example:

use dot products:

A x = [ 2 x 1 + x 2 + 3 x 3 3 x 1 + x 2 + 4 x 3 5 x 1 + 7 x 2 + 12 x 3 ] Ax = \begin{bmatrix} 2x_1+x_2+3x_3 \\ 3x_1+x_2+4_x3 \\ 5x_1+7x_2+12x_3 \end{bmatrix} Ax=2x1+x2+3x33x1+x2+4x35x1+7x2+12x3

use cols:

A x = x 1 [ 2 3 5 ] + x 2 [ 1 1 7 ] + x 3 [ 3 4 12 ] Ax = x_1 \begin{bmatrix} 2 \\ 3 \\ 5 \end{bmatrix} +x_2\begin{bmatrix} 1 \\ 1 \\ 7 \end{bmatrix} + x_3\begin{bmatrix} 3 \\ 4 \\ 12 \end{bmatrix} Ax=x1235+x2117+x33412

All Ax gives us cloumn space = C(A).

we find the column one add column two equal to column three. Rank(A) = 2, so C(A) = plane.

using PlotlyJS, DataFrames, RDatasets, Colors, Distributions, LinearAlgebra
function rand_point_3d(rw)
    trace = scatter3d(;x=rw[1,:],y=rw[2,:], z=rw[3,:], mode="markers",
                        marker=attr(color="#1f77b4", size=1, symbol="circle",
                                    line=attr(color="rgb(0,0,0)", width=0)),
                        line=attr(color="#1f77b4", width=1))
    cluster = mesh3d(;opacity=0.3, x=rw[1,:], y=rw[2,:], z=rw[3,:])
    layout = Layout(autosize=false, width=950, height=600,
                    margin=attr(l=0, r=0, b=0, t=65))
    plot([trace, cluster], layout)
end;
    
rand_point_3d(randn(3,10000))

if you open in notebook.ipynb, it can interactive

if we define x is ( x 1 , x 2 , x 3 ) (x_1, x_2, x_3) (x1,x2,x3) where x is a random number. then we plot the 3D scatter like that.

So after we do a calculate A x Ax Ax, the figure will like that:

x = randn(3, 10000)
A = [[2, 3, 5] [1, 1, 7] [3, 4, 12]]
B = [[1,1,1] [3,3,3] [8,8,8]]
res = A*x
rand_point_3d(res)

在这里插入图片描述
As you see, A x Ax Ax make the points to form a plane.

so let’s choose other matrix to show the plane.

B = [ 1 3 8 1 3 8 1 3 8 ] B = \begin{bmatrix} 1 & 3 & 8 \\ 1 & 3 & 8 \\ 1 & 3 & 8 \end{bmatrix} B=111333888

if we do B x Bx Bx.

res1 = B*x
rand_point_3d(res1)

在这里插入图片描述
we find the B can be write:

B = [ 1 3 8 1 3 8 1 3 8 ] = [ 1 1 1 ] [ 1 3 8 ] = u v T B = \begin{bmatrix} 1 & 3 & 8 \\ 1 & 3 & 8 \\ 1 & 3 & 8 \end{bmatrix} = \begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix}\begin{bmatrix} 1 & 3 & 8 \\ \end{bmatrix} = uv^T B=111333888=111[138]=uvT

R a n k ( B ) = 1 Rank(B) = 1 Rank(B)=1

the Column space of B is a line. any x to do B x Bx Bx will get a point in a line, like above.

back to look a A A A:

A = [ 2 1 3 3 1 4 5 7 12 ] = [ 2 1 3 1 5 7 ] [ 1 0 1 0 1 1 ] = u v T A = \begin{bmatrix} 2 & 1 & 3 \\ 3 & 1 & 4 \\ 5 & 7 & 12 \end{bmatrix} = \begin{bmatrix} 2 &1 \\ 3 &1 \\ 5 &7 \end{bmatrix}\begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \end{bmatrix} = uv^T A=2351173412=235117[100111]=uvT

Column space of A A A = C ( A ) C(A) C(A)

The basic of C ( A ) C(A) C(A) is :

u = [ 2 1 3 1 5 7 ] u= \begin{bmatrix} 2 &1 \\ 3 &1 \\ 5 &7 \end{bmatrix} u=235117

row space of A = C ( A T ) C(A^T) C(AT), the basic is:
v = [ 1 0 1 0 1 1 ] v= \begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \end{bmatrix} v=[100111]

A matrix A A A can be write as A = C R A=CR A=CR

A x Ax Ax in column spcae, where x x x in r a n d ( m , 1 ) rand(m,1) rand(m,1), also A B C x ABCx ABCx in column spcae.( A B C x = A ( B C x ) ABCx=A(BCx) ABCx=A(BCx))

If A , B A,B A,B are matrixs. calculate A ⋅ B A \cdot B AB :

  1. dot product
  2. c o l ⋅ r o w col \cdot row colrow

For 2: A B = ∑ c o l k r o w k AB = \sum col_k row_k AB=colkrowk, for c o l k col_k colk in A A A, r o w k row_k rowk in B B B

Problems for Lecture 1 (from textbook Section I.1)

  1. Give an example where a combination of three nonzero vectors in R 4 R^4 R4 is the zero vector. Then write your example in the form A x = 0 Ax=0 Ax=0, what are the shapes of A A A and x x x and 0 0 0
A1 = [[-1, -1, 2, -2] [-1, 2, 1, 1] [2, -1, -3, 1] [0, 0, 0, 0]]
A1*[1,1,1,0]
  1. Suppose A A A is the 3 by 3 matrix ones(3, 3) of all ones. Find two independent vectors x x x and y y y that solve A x = 0 Ax=0 Ax=0 and A y = 0 Ay=0 Ay=0. Write that first equation A x = 0 Ax=0 Ax=0 (with numbers) as a combination of the columns of A A A. Why don’t I ask for a third independent vector with A z = 0 Az = 0 Az=0
A4 = ones(3,3)
x = [0,1,-1]
y = [0,-1,1]
rank(A4)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值