AGEC516 - L9-10 - Matrix Algebra I
AGEC516 - L9-10 - Matrix Algebra I
AGEC516 - L9-10 - Matrix Algebra I
Meilin Ma
Fall 2021
1
Outline
2. Type of Operations
• Vector operations
• Matrix operations
• Transpose
4. Important Matrices
2
Matrices
3
Matrices
4
Matrices
5
Matrix Equality
Two matrices are equal if they have the same dimension and the
corresponding elements are equal
Example:
3 2 3 𝑦
= , Solve for 𝑥 and 𝑦
𝑥+𝑦 1 2 1
6
Vectors
Example:
7
• 𝐵= 4
5 3×1
• 𝐶= 3 0 0 1×3
7
Vector Operations
𝑐𝑣1
𝑐𝑣2
𝑐𝑣 =
⋮
𝑐𝑣𝑛
8
Vector Operations
3 1
Example: with two vectors, 𝑣 = 2
and 𝑢 = 4
• 2𝑣
• –𝑣
• 𝑣+𝑢
• 𝑣−𝑢
9
Vector Operations
3. Vector Multiplication:
Note: the number of rows for vector 𝐴 need to be equal to the
number of columns for vector 𝐵.
Example:
𝑏1
𝐴 = 𝑎1 𝑎2 𝑎3 1×3 𝐵 = 𝑏2
𝑏3
3×1
• 𝐴𝐵 = 𝑎1 𝑏1 + 𝑎2 𝑏2 + 𝑎3 𝑏3
𝑏1 𝑎1 𝑏1 𝑎2 𝑏1 𝑎3
• 𝐵𝐴 = 𝑏2 𝑎1 𝑏2 𝑎2 𝑏2 𝑎3
𝑏3 𝑎1 𝑏3 𝑎2 𝑏3 𝑎3
10
Vector Operations
Example:
2
𝐴= 1 2 3 1×3 𝐵= 0
1 3×1
• 𝐴𝐵 =
• 𝐵𝐴 =
11
Matrix Operations
𝐴 ± 𝐵 = [𝑎𝑖𝑗 ] ± [𝑏𝑖𝑗 ]
Example:
𝑎11 𝑎12 𝑏11 𝑏12 𝑎11 + 𝑏11 𝑎12 + 𝑏12
𝑎21 𝑎22 + 𝑏21 𝑏22
=
𝑎21 + 𝑏21 𝑎22 + 𝑏22
12
Matrix Operations
Examples:
4 9 2 0 1
𝐴= 𝐵= 𝐶= 1
2 1 0 7
• 𝐴+𝐵 =
• 𝐴−𝐵 =
• 𝐴−𝐶
• 𝐵−𝐶
13
Matrix Operations
Example:
4 9
𝐴= 3𝐴 =
2 1
14
Matrix Operations
15
Matrix Operations
𝑎11 ⋯ 𝑎1𝑛
⋮ ⋮ 𝑏11 ⋯ 𝑏1𝑗 ⋯ 𝑏1𝑝 𝑐11 ⋯ 𝑐1𝑝
𝑎𝑖1 ⋯ 𝑎𝑖𝑛 ⋮ ⋮ ⋮ = ⋮ 𝑐𝑖𝑗 ⋮
⋮ ⋮ 𝑏𝑛1 ⋯ 𝑏𝑛𝑗 ⋯ 𝑏𝑛𝑝 𝑐𝑚1 ⋯ 𝑐𝑚𝑝
𝑎𝑚1 ⋯ 𝑎𝑚𝑛
16
Matrix Operations
Examples:
1 3
5
• 2 8 =
9
4 0
2 1 1 2 3
• =
3 0 2 0 1
2 1 𝑥1
• =
3 0 𝑥2
17
Transpose
7
Example: 𝐵= 7 4 5 𝐵′ = 4
5
Properties of Transposes
• (𝐴’)’ = 𝐴
• (𝐴 + 𝐵)’ = 𝐴’ + 𝐵’
• (𝐴𝐵)’ = 𝐵’𝐴’ and (𝐴𝐵𝐶)’ = 𝐶’𝐵’𝐴’
18
Transpose
Examples:
1 2 3 2 1 0 1 0 0
𝐴= 4 5 5 𝐵= 0 1 1 𝐶= 0 1 0
0 1 0 1 2 1 0 0 1
1 4 0
𝐴′ = 2 5 1
3 5 0
𝐴′ ′ =
𝐴+𝐵 ′ =
𝐴′ + 𝐵′ =
𝐴𝐵𝐶 ’ =
19
Laws of Matrix Algebra
1. Commutative
𝐴 ± 𝐵 = ±𝐵 + 𝐴
𝐴𝐵 ≠ 𝐵𝐴
2. Associative
𝐴 + 𝐵 + 𝐶 = 𝐴 + (𝐵 + 𝐶)
𝐴𝐵 𝐶 = 𝐴(𝐵𝐶)
3. Distributive
𝐴 𝐵 + 𝐶 = 𝐴𝐵 + 𝐴𝐶
4. With a scalar 𝑐,
𝑐 𝐴𝐵 = 𝑐𝐴 𝐵 = 𝐴(𝑐𝐵)
20
Laws of Matrix Algebra
3 1 6 2 1 0
𝐴= 𝐵= 𝐶=
0 2 3 4 0 1
𝐴+𝐵 = 𝐵+𝐴=
𝐴𝐵 = 𝐵𝐴 =
(𝐴 + 𝐵) + 𝐶 =
𝐴+ 𝐵+𝐶 =
21
Laws of Matrix Algebra
Examples (associative):
1 0
5 0 0 0 1
𝐴= 𝐵= 𝐶= 0 0
0 5 1 0 0
1 1
𝐴𝐵 𝐶 =
𝐴 𝐵𝐶 =
22
Laws of Matrix Algebra
Examples (distributive):
3 1 6 2 1 0
𝐴= 𝐵= 𝐶=
0 2 3 4 0 1
𝐴(𝐵 + 𝐶) =
𝐴𝐵 + 𝐴𝐶 =
23
Important Matrices
24
Important Matrices
1 2 3
5 2
Example: 2 2 2 6
2 1
3 6 4
1 0 0
1 1
Example: 0 1 0
0 0
0 0 1
25
Important Matrices
1 0 0
1 0
Example: 0 1 0
0 1
0 0 1
Properties:
• 𝐴𝐼 = 𝐴 and 𝐼𝐴 = 𝐴
• 𝐼 2 = 𝐼 · 𝐼 = 𝐼: Idempotent Matrix
• 𝐼𝑘 = 𝐼
26
Important Matrices
1 2 3
Example: 𝐴 =
2 0 3
• 𝐼2 𝐴 =
• 𝐴𝐼3 =
• 𝐼2 𝐼2 =
27
Important Matrices
Example:
0 0 0 0 0
0 0 0 0 0
Properties:
• 𝐴 + 0 = 0 + 𝐴 = 𝐴
• 𝐴0 = 0 and 0𝐴 = 0
28