Udacity Data Scientist Nanodegree : Prerequisite — Linear Algebra
Lesson 1: Introduction / Lesson 2: Vectors / Lesson 3: Linear Combination / Lesson 4: Linear Transformation and Matrices
Essence of Linear Algebra
- Geometric intuition is helpful for what tools to use in this problem.
- Numerical understanding can make you actually compute those computations.
Vectors, what even are they? Part 1
- Physic perspective: Vectors are arrow pointing in space. What defines a given vector, is its length and the direction it’s pointing. With the same factors(length and direction), you can move it all around and it‘s the same vector.
- CS perspective: Vectors are ordered list of numbers.
- Mathematic perspective: Vector can be anything where there’s sensible notion of adding two vectors and multiplying a vector by a number.
- Vector definition in this video: An arrow in a coordinate system with its tail sitting at the origin.
Vectors, what even are they? Part 2
- Each element in the vector, also called component or coordinate.
- 向量的座標說明了向量如何從位於原點的尾部出發,到達終點所在的頭部。
- 為了跟點做區分,通常我們會用矩陣形式去寫他的座標位置。
- 三維空間:[x, y, z]^T
Vectors, what even are they? Part 3
- 向量加法:移動第二個向量使其尾部落在第一個向量的頭部上。從第一個向量的尾部畫到第二個向量的頭部,畫一個新向量,就是他們相加的結果。
- 向量乘法:向量的係數(Scalars)是把它拉長/縮短幾倍。負數係數則是會先翻轉這個向量,然後變成原本的係數倍(這個行為 — Scaling)
Vectors- Mathematical Definition
What is a Vector? The plain explanation would be that a vector is an ordered list of numbers.
As in the video let’s put this into a more visual context and focus on a 2D vector of the field of real numbers. In other words, we will focus on a vector in R^2, which defines all points on the plane.
Vector Transpose
Magnitude and Direction
- Each vector holds the magnitude as well as the direction of the movement.
- The symbol we use for the magnitude(向量的大小) is || ||.
- Direction: Radian or degree.
Linear Combinations, Span and Basis Vectors. Part 1
- 如果你有一對數字可以表示一個向量,可以把各座標分別想成一個純量。
- 有幾個比較特殊的向量(i-hat = unit vector,x軸的單位向量)跟 j-hat,y軸的單位向量。可以把一般的向量想成是 i-hat 跟 j-hat 的幾倍 — 線性組合。i-hat and j-hat are the “basis vectors”. 透過這些 basic vector 的轉換,可以得到所有二維平面上的座標點。
- 但如果兩向量共線了,就無法得到全部的座標。
Linear Combinations, Span and Basis Vectors. Part 2
- 如果要研究一個向量,通常會畫箭頭,如果要研究向量集合,通常會把向量簡化成一個點,頭部是點,而尾部依舊是原點。
- The Span of those vectors (sometimes also referred to as the Linear Span) is the set of all possible linear combinations of those vectors.
- 二維:多數向量組合的 span 是二維空間,但若向量共線,則為一條直線。
- 三維:兩個向量的Span — 一個平面。三個向量的 Span — 三維空間、一個平面(若第三個向量落在前兩個向量的平面上)。
- 線性相關:只要你有多個向量,且可以在不減少 Span 的情況下刪除其中一個向量,就可以說這些向量是線性相關的。反之則稱為 Linear Indepedent。
- When one vector can be defined as a linear combination of the other vectors, they are a set of linearly dependent vectors. — 線性相關的方程式有無限多組解。
Linear Transformation and Matrices . Part 1
- 投入 input 然後輸出 output。為什麼我們要說變換而不是函數呢?因為變換更貼切。
- 有兩個特點:所有線都必須是直線、原點必須固定不動。網格線必須平行且等距分佈。比如說旋轉。
Linear Transformation and Matrices. Part 2
- 只要紀錄 i-hat 跟 j-hat 的移動方向,就可以知道整個空間的變動。
Linear Transformation and Matrices. Part 3
- Shear: i-hat 不變 j-hat 到了(1, 1)
- sum up: 可以把矩陣看成空間向量的組合。