Try   HackMD

李宏毅_Linear Algebra Lecture 5: Matrix-vector Product

tags: Hung-yi Lee NTU Linear Algebra Lecture

課程撥放清單

Linear Algebra Lecture 5: Matrix-vector Product

課程連結

Matrix-Vector Product

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

假設Matrix的維度為mxn,那Vector的維度必需為nx1,否則無法計算。

計算的過程也非常簡單,將Vector的第1個元素乘上Matrix的Column 1元素,第2個元素乘上Matrix的Column 2的元素,依此類推,每個Row最後元素加總起來就是結果。

Matrix-Vector Product

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

整個式子就跟解多元一次聯立方程式一樣,左邊部份就是Matrix-

A與Vector-
x
相乘,而得到的結果就是Vector-
b
,因此
Ax=b

以線性系統來看的話,描述線性系統的參數就是Matrix-

A(mxn),輸入的部份則為
x
(nx1),輸出即為
Ax

Row Aspect

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

以Row的角度來看,就是

A的每一個row都跟vector-
x
做一次inner product,然後得到一個scalar

Column Aspect

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

從Column的角度來看,將

A的每一個column都看成一個vector,然後乘上相對應索引的vector-
x
的元素,再將這些vector加總,就是Matrix與Vector的product。

Example

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

上面範例說明兩個不同觀點的計算過程。

Matrix-Vector Product

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Matrix跟Vector要做Product的時候,其維度一定要相同,Matrix(mxn),Vector(nx1),因Matrix-

A是無法做Product,但Matrix-
A
、Matrix-
A
是可以的。

Properties of Matrix-Vector Product

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

假設

A
B
是Matrix,維度皆為(mxn),
u,v
是vector,
Rn
c
是scalar:

  • A(u+v)=Au+Av
  • A(cu)=c(Au)=(cA)u
  • (A+B)u=Au+Bu
  • A0
    得到一個mx1的0向量
  • 0v
    得到一個mx1的0向量
  • lnv=v
    ,identity matrix乘上vector會得到本身vector

Properties of Matrix-Vector Product

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

假設A、B都是Matrix,維度為mxn,任意Vector-w與它們相乘都會相等,即

Aw=Bw,則
A=B

證明如下:

  • 假設
    A
    乘上standard vector-
    ejRn
    ,以Column的角度來看,很明顯的,
    Ae1
    的結果是只在第1個元素位置上有值,其餘皆為0,加總就是
    a1
  • 假設
    Ae1=Be1
    即代表
    a1=b1
  • 以此類推可得
    an=bn
  • 以此可證,
    A=B

要證明兩個Matrix是否相同,只要利用standard vector驗證輸出是否相同就可以。

註:standard vector

ej代表只在j的地方為1,其餘為0。