Vector and Matrix (v5)
Vector and Matrix (v5)
1
v= 2 v= 1 2 3
3 Row vector
Column vector
v3 v
v2
v
v2
v1
v1
http://mathinsight.org/vectors_carte
sian_coordinates_2d_3d#vector3D
Scalar Multiplication
𝑣1 2𝑣2
𝑣= 𝑣 2𝑣
2
𝑣2 𝑣
𝑐𝑣1
𝑐𝑣 = 𝑐𝑣
2
𝑣1 2𝑣1
Vector Addition http://mathinsight.org/vectors_carte
sian_coordinates_2d_3d#vector3D
Special Vectors
• zero vector 𝟎
0 𝟎+𝑣 =𝑣
𝟎= ⋮ 0𝑣 = 𝟎
0 Can be any size
• Standard vectors
1 4 6 9
A vector set with
Vector Set 2 , 5 , 8 , 0
4 elements
3 6 9 2
• A vector set can contain infinite elements
𝑥1
L= 𝑥2 : 𝑥1 + 𝑥2 = 1
Vector Set
• Rn :We denote the set of all vectors with n entries
by Rn .
Vectors, Matrices
and their Products
Matrix
Matrix
• A matrix is a set of vectors
2 3 5
𝑎1 = 3 𝑎2 = 1 𝑎3 = −1
−2 1 1
2 3 5
𝐴 = 𝑎1 𝑎2 𝑎3 = 3 1 −1
−2 1 1
Matrix
• If the matrix has m rows and n columns, we say the size of
the matrix is m by n, written m x n
• The matrix is called square if m=n
• We use Mmxn to denote the set that contains all matrices
whose size is m x n
2 columns
3 columns
1 4
1 2 3 3 rows 2 5 ∈M3x2
4 5 6 ∈M2x3
2 rows
3 6
2X3 3X2
先 Row 再 Column
Matrix
• Index of component: the scalar in the i-th row and
j-th column is called (i,j)-entry of the matrix
(1,2)-entry
2 3 5
𝐴= 3 1 −1
−2 1 1
(3,1)-entry
先 Row 再 Column (3,3)-entry
Matrix
• Two matrices with the same size can add or
subtract.
• Matrix can multiply by a scalar
1 4 6 9 54 81
𝐴= 2 5 𝐵= 8 0 9𝐵 = 72 0
3 6 9 2 81 18
7 13 −5 −5
𝐴 + 𝐵 = 10 5 𝐴 − 𝐵 = −6 −5
12 8 −6 4
Zero Matrix
• zero matrix: matrix with all zero entries, denoted by O (any
size) or Om×n.
• For example, a 2-by-3 zero matrix can be denoted
𝐴+𝑂 =𝐴
0𝐴 = 𝑂
𝐴−𝐴=𝑂
• Identity matrix: must be square
• 對角線是 1, 其它都是 0
以左上到右下的對角線為軸
進行翻轉
5 5 7 7
Transpose 𝐴=
6 6
𝐵=
8 8
12 12 12 14
𝐴+𝐵 = 𝐴+𝐵 𝑇 =
14 14 12 14
5 6 7 8 12 14
𝐴𝑇 = 𝐵𝑇 = 𝐴𝑇 + 𝐵𝑇 =
5 6 7 8 12 14
Vectors, Matrices
and their Products
Matrix-Vector Products
Matrix-Vector Product
𝑎11 𝑎12 ⋯ 𝑎1𝑛 𝑥1
𝑎21 𝑎22 ⋯ 𝑎2𝑛 𝑥2
𝐴= ⋮ ⋮ ⋱ ⋮ 𝑥= ⋮
mxn
𝑎𝑚1 𝑎𝑚2 ⋯ 𝑎𝑚𝑛 𝑥𝑛
𝐴𝑥 =
Matrix-Vector Product
𝐴𝑥 = 𝑏
Linear
𝑥 𝐴𝑥
System
Coefficients are 𝐴
Row Aspect
𝐴𝑥 =
Column Aspect
𝑎11 𝑎12 ⋯ 𝑎1𝑛 𝑥1
𝑎21 𝑎22 ⋯ 𝑎2𝑛 𝑥2
𝐴= ⋮ ⋮ ⋱ ⋮ 𝑥= ⋮
𝑎𝑚1 𝑎𝑚2 ⋯ 𝑎𝑚𝑛 𝑥𝑛
=
Example 𝐴=
1 4
−3 2
𝑥1 + 4𝑥2 = 𝑏1 -2 𝑥1 𝑏1
𝑏2 = 𝐴𝑥
A
−3𝑥1 + 2𝑥2 = 𝑏2 0.5 𝑥2
−2
Row 1
6 Row 2 1
column 2 4
−3
4 2
2
2
1
−2
0.5
Column 1 Row
column 1
Aspect −3 Aspect
Matrix-vector Product
• The size of matrix and vector should be matched.
2 3 5 1
𝑥=
𝐴= 3 1 −1 −1
−2 1 1
2 1
1 −1
𝐴′ = 2 3 A'' = 3 2
0 −1
1 4 1 −3
Properties of
Matrix-vector Product
• A and B are mxn matrices, u and v are vectors in Rn,
and c is a scalar.
• 𝐴 𝑢 + 𝑣 = 𝐴𝑢 + 𝐴𝑣
• 𝐴 𝑐𝑢 = 𝑐 𝐴𝑢 = 𝑐𝐴 𝑢
• 𝐴 + 𝐵 𝑢 = 𝐴𝑢 + 𝐵𝑢
• 𝐴𝟎 is the mx1 zero vector
• 𝑶𝑣 is also the mx1 zero vector
• 𝐼𝑛 𝑣 = 𝑣
Properties of
Matrix-vector Product
• A and B are mxn matrices. If 𝐴𝑤 = 𝐵𝑤 for all 𝑤 in
Rn. Is it true that 𝐴 = 𝐵?
𝐴𝑒𝑗 = 𝑎𝑗 for 𝑗 = 1,2, ⋯ , 𝑛, where 𝑒𝑗 is the j-th standard vector in Rn
1 1
𝑒1 = ⋮ 𝐴𝑒1 = 𝑎1 ⋯ 𝑎𝑛 ⋮ = 1 ∙ 𝑎1 + 0 ∙ 𝑎2 + ⋯ + 0 ∙ 𝑎𝑛
0 0 = 𝑎1
𝐴𝑒1 = 𝐵𝑒1 𝐴𝑒2 = 𝐵𝑒2 𝐴𝑒𝑛 = 𝐵𝑒𝑛
…… 𝐴=𝐵
𝑎1 = 𝑏1 𝑎2 = 𝑏2 𝑎𝑛 = 𝑏𝑛
Concluding Remarks
𝑎11 𝑎12 ⋯ 𝑎1𝑛 𝑥1
𝑎21 𝑎22 ⋯ 𝑎2𝑛 𝑥2
𝐴= ⋮ ⋮ ⋱ ⋮ 𝑥= ⋮
𝑎𝑚1 𝑎𝑚2 ⋯ 𝑎𝑚𝑛 𝑥𝑛
Row
𝐴𝑥 = Aspect