1 / 16

Independent

Independent. 舒宇宸. 上次的複習. Ax=b  x = Ab; AB=C  B=AC, A=C/B; For loop for i=1:5 a(i) = 2+3*(i-1); end If structure if a(i) < 3 disp(‘Hello world’); end. Octave function. randn(m,n): 提供一個 normal distribution N(0,1) 的 m x n 矩陣 讓使用者輸入一個變數 : N = input(‘ 提示文字’ ) 畫函數圖形 : plot(x,y).

hisano
Télécharger la présentation

Independent

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Independent 舒宇宸

  2. 上次的複習 • Ax=b  x = A\b; • AB=C  B=A\C, A=C/B; • For loop • for i=1:5 a(i) = 2+3*(i-1); end • If structure • if a(i) < 3 disp(‘Hello world’); end

  3. Octave function • randn(m,n): 提供一個normal distribution N(0,1) 的m x n矩陣 • 讓使用者輸入一個變數: N = input(‘提示文字’) • 畫函數圖形: plot(x,y)

  4. 比較算子 • > <: 大魚, 小魚 • >= <=: 大於或等於, 小於或等於 • ==: 等於 • ~=: 不等於

  5. 把你想在octave中下的指令整個寫在一個文字檔中就可以把你想在octave中下的指令整個寫在一個文字檔中就可以 如:右方的文字檔, test1.m % 這是註解 % help的時候會出現 A = rand(3); [L U P] = lu(A); if L(3,3) ~= 0 disp(‘A has inverse’); U\(L\P) end Simple m-file

  6. 應用例子 • 常態分佈的隨機抽樣 • 假設班上同學的成績平均是65分, 標準差是20分 • 而且班上同學有很多很多人(不考慮有限母體修正) • 這時候如果我們從班上抽取16人, 並且取平均的話, 這個隨機變數X=(x1+x2+…+x16)/16應該是怎麼樣的一個分配呢? • 用Octave做給大家看, 在理論之外的一個實證

  7. 上次沒講完的 • Ax = b: 做高斯消去法有可能有右邊幾種情況: • 平常的LU分解(m=n才會發生)唯一解 • 除了一個上三角矩陣外, 還剩下右方的一個矩陣(m <= n才會發生)無限多解 • 出現一排全為0的列向量如果b2=0有解, b2不為0時無解.(隨時都可以發生)

  8. 如果是第三種情況, 怎麼判斷有解 • Ax=b, A: m x n Matrix • 那就是做LU分解啦 • 在U全為0如果L-1Pb也等於0那這時候x就可以有解. • 其他情況呢? • 解很多的時候在第四章的時候再說

  9. Linear Independent • 一堆向量可以形成一個向量空間, 如果我們把這些向量放在一個矩陣的行向量上, 那麼所有長得像Ax的向量就形成這個向量空間. • 如果Null space of A(也就是N(A))只有0向量, 那麼我們就說這堆向量線性獨立 • 也就是說, 這些向量中, 沒有一個向量可以是其他向量的線性組合. • Why?

  10. Vector span subspace • 其實就是由一堆向量線性組合所生成的Vector space • 為什麼老師在上一堂課要把Vector space 定義成 由向量線性組合出來的空間呢? • 因為一個向量空間可以用一堆向量來生成也就是基底的概念

  11. Basis of a vector space • 一定要線性獨立 • 可以線性組合出Vector space中的任何一個向量 • R2的基底 • (1,0),(0,1) • (1,2),(2,3) • R3的基底 • (1,0,0),(0,1,0),(0,0,1) • (1,0,1),(0,1,1),(1,1,0)

  12. 怎麼找row space的基底 • 就是做高斯消去法得到LU分解啦, 在每個pivot的row就是這個row space的基底 • 之前好像沒有提到… • rank(A)=pivot個數 • pivot=做高斯消去法時每列第一個不是0的元素

  13. 維度 • 一個Vector space裡基底的個數. • Rn的維度是n

  14. 課本後面的圖 • A: m x n Matrix, x in Rn, y in Rm • ATyC(AT) Row space of A in Rn.  dimension: r • Ax = 0  Null space of A in Rn.  dimension: n-r • Ax  C(A) Column space of A in Rm.  dimension: r • ATy = 0  left null space of A in Rm.  dimension: m-r • 為什麼會這個樣子呢?老師說…

  15. 結論 • Fundamental Theorem of Linear Algrbra, Part I: • The column space and row space both have dimension r. The nullspace have dimension n-r and m-r

  16. 電腦實做 • A的null space: null(A) • 就只有這個可以教啦

More Related