Vector and Matrix (v5)
Vector and Matrix (v5)
Vector and Matrix (v5)
[]
1
v= 2 v= [ 1 2 3]
3
Row vector
Column vector
𝑣=
𝑣1
𝑣2 [ ] 2 𝑣2
2𝑣
𝑣2
𝑣
𝑐𝑣 =
[ 𝑐 𝑣1
𝑐 𝑣2 ]
𝑣1 2 𝑣1
Vector Addition http://mathinsight.org/
vectors_cartesian_coordinates_2d_3
d#vector3D
Special Vectors
• zero vector
[]
0 𝟎+ 𝑣=𝑣
𝟎= ⋮
0 Can be any size
0 𝑣=𝟎
• Standard vectors
{[ ] [ ] [ ] [ ]}
1 4 6 9
A vector set with
Vector Set 2 , 5 , 8 , 0
3 6 9 2 4 elements
L=
{[ ]
𝑥1
𝑥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
2 rows 4 5 6 ] M2x3 3 rows 2 5
3 6
M3x2
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 再 (3,3)-entry
Column
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
[ ]
Transpose
[ ]
6 9 𝑇 6 8 9
𝐴= 8 0 𝐴 =
9 0 2
9 2
(2,1) (2,3)
(3,2)
以左上到右下的對角線為
軸進行翻轉
Transpose 𝐴=
[ 5
6
5
6 ] 𝐵=
[ 7
8
7
8 ]
• A and B are mxn matrices, and s is a scalar
2 ( 2 𝐴 )𝑇 = 1 0
10 [ 12
12 ]
𝐴 =
𝑇
[ 5
5
6
6 ] 2𝐴 =
𝑇
[ 10
10
12
12 ]
𝐴 + 𝐵=
[ 12
14
12
14 ] ( 𝐴 + 𝐵 )𝑇 = 12
12 [ 14
14 ]
𝐴 =
𝑇
[ 5
5
6
6 ] 𝐵 =
𝑇
[ 7
7
8
8 ] 𝑇
𝐴 +𝐵 =
𝑇
[ 12
12
14
14 ]
Vectors, Matrices
and their Products
Matrix-Vector Products
Matrix-Vector Product
[ ] []
𝑎 11 𝑎1 2 ⋯ 𝑎1 𝑛 𝑥1
𝐴=
𝑎2 1 𝑎 22 ⋯ 𝑎2 𝑛
𝑥=
𝑥2
mxn
⋮ ⋮ ⋱ ⋮ ⋮
𝑎𝑚 1 𝑎𝑚 2 ⋯ 𝑎 𝑚𝑛 𝑥𝑛
𝐴𝑥=¿
Matrix-Vector Product
𝐴𝑥 ¿ 𝑏
𝑥 Linear 𝐴𝑥
System
Coefficients are
Row Aspect
[ ] []
𝑎 11 𝑎1 2 ⋯ 𝑎1 𝑛 𝑥1
𝐴=
𝑎2 1 𝑎 22 ⋯ 𝑎2 𝑛
𝑥=
𝑥2
⋮ ⋮ ⋱ ⋮ ⋮
𝑎𝑚 1 𝑎𝑚 2 ⋯ 𝑎 𝑚𝑛 𝑥𝑛
𝐴𝑥=¿
Column Aspect
[ ] []
𝑎 11 𝑎1 2 ⋯ 𝑎1 𝑛 𝑥1
𝐴=
𝑎2 1 𝑎 22 ⋯ 𝑎2 𝑛
𝑥=
𝑥2
⋮ ⋮ ⋱ ⋮ ⋮
𝑎𝑚 1 𝑎𝑚 2 ⋯ 𝑎 𝑚𝑛 𝑥𝑛
[ ] [ ] [ ]
𝑎11 𝑎1 2 𝑎1 𝑛
𝐴𝑥 ¿ 𝑥 1 ⋮ + 𝑥2 ⋮ + …+ 𝑥 𝑛 ⋮
𝑎𝑚 1 𝑎𝑚 2 𝑎𝑚 𝑛
¿
Example 𝐴=
[ 1
−3
4
2 ]
𝑥1 + 4 𝑥 2=𝑏 1 -2 𝑥1 𝑏1
−3 𝑥 1 +2 𝑥 2= 𝑏2
A 𝑏 2¿ 𝐴𝑥
0.5 𝑥 2
Row 1
[ ]
−2
6
column 2 Row 2 [ ]
1
4
[ ]
4 [ ]
−3
2
2
[ ] 2
1
[ ]
−2
0.5
Column Row
Aspect [ 1
−3 ] column 1 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
'' 3 2
𝐴′ = 2 3 A =
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.
[] []
1 1
𝑒 1= ⋮ 𝐴 𝑒1= [ 𝑎1 ⋯ 𝑎 𝑛 ] ⋮ ¿ 1 ∙ 𝑎1 +0 ∙ 𝑎 2 + ⋯ +0 ∙ 𝑎 𝑛
0 0 ¿𝑎 1
𝐴 𝑒1= 𝐵𝑒 1 𝐴 𝑒2 =𝐵 𝑒2 𝐴 𝑒𝑛 =𝐵 𝑒𝑛
…… 𝐴=𝐵
𝑎 1=𝑏 1 𝑎 2= 𝑏2 𝑎 𝑛 =𝑏𝑛
Concluding Remarks
[ ] []
𝑎 11 𝑎1 2 ⋯ 𝑎1 𝑛 𝑥1
𝐴=
𝑎2 1 𝑎 22 ⋯ 𝑎2 𝑛
𝑥=
𝑥2
⋮ ⋮ ⋱ ⋮ ⋮
𝑎𝑚 1 𝑎𝑚 2 ⋯ 𝑎 𝑚𝑛 𝑥𝑛
Row
𝐴𝑥 ¿ Aspect
[ ] [ ] [ ]
𝑎11 𝑎1 2 𝑎1 𝑛
¿ 𝑥1 ⋮ + 𝑥2 ⋮ + …+ 𝑥 𝑛 ⋮
Column
𝑎𝑚 1 𝑎𝑚 2 𝑎𝑚 𝑛 Aspect