AGEC516 - L9-10 - Matrix Algebra I

Download as pdf or txt
Download as pdf or txt
You are on page 1of 28

AGEC 516

Mathematical Tools for


Agricultural and Applied Economics
Matrix Algebra 1

Meilin Ma

Fall 2021

Department of Agricultural Economics


Purdue University

1
Outline

1. Vectors and Matrices

2. Type of Operations
• Vector operations
• Matrix operations
• Transpose

3. Laws of Matrix Algebra

4. Important Matrices

2
Matrices

In Economics, we often work with multiple variables and


multiple functions of these variables

Matrix algebra gives us a compact way of writing an


equation system

Matrix algebra enables us to test the existence of a


solution for the equation system

Matrix algebra enables us to solve the equation system

3
Matrices

Definition: A Matrix is a rectangular array of numbers enclosed


in parentheses.

It is conventionally denoted by a capital letter, e.g., A

4
Matrices

The numbers in the matrix are referred to as elements of the matrix

The numbers in a horizontal line are called rows

The numbers in a vertical line are called columns

The number of rows 𝑚 and columns 𝑛 defines the dimension of the


matrix (𝑚 × 𝑛), which is read m by n

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

Definition: If the matrix is composed of a single column, it is a


column vector; if the matrix is composed of a single row, it is a
row vector.

Example:
7
• 𝐵= 4
5 3×1

• 𝐶= 3 0 0 1×3

7
Vector Operations

With a vector 𝑣 and a scalar 𝑐,


1. Scalar Multiplication

𝑐𝑣1
𝑐𝑣2
𝑐𝑣 =

𝑐𝑣𝑛

2. Vector Addition/Subtraction: Require the vector have equal


dimensions.
𝑣1 𝑢1 𝑣1 ± 𝑢1
𝑣 𝑢 𝑣 ± 𝑢2
𝑣±𝑢 = 2 ± 2 = 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

1. Addition and Subtraction: Two matrices can be


added/subtracted IFF they have the same dimension.
(conformable for addition/subtraction)

𝐴 ± 𝐵 = [𝑎𝑖𝑗 ] ± [𝑏𝑖𝑗 ]

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

2. Scalar Multiplication is carried out by multiplying


each element of the matrix by the scalar.

Example:

𝑎11 𝑎12 𝑘𝑎11 𝑘𝑎12


𝐴= 𝑎 𝑎22 𝑘𝐴 =
21 𝑘𝑎21 𝑘𝑎22

4 9
𝐴= 3𝐴 =
2 1

14
Matrix Operations

3. Matrix Multiplication: The two matrices A and B


can be multiplied (AB) if and only if the column
dimension of A is equal to the row dimension of B
(conformable for multiplication).

𝐴𝑚×𝑛 × 𝐵𝑛×𝑝 = 𝐶𝑚×𝑝

where 𝑖 = 1,· · · 𝑚 and 𝑗 = 1,· · · , 𝑝.


𝑛

𝑐𝑖𝑗 = ෍ 𝑎𝑖𝑘 𝑏𝑘𝑗 = 𝑎𝑖1 𝑏1𝑗 + 𝑎𝑖2 𝑏2𝑗 … + 𝑎𝑖𝑛 𝑏𝑛𝑗


𝑘=1

15
Matrix Operations

3. Matrix Multiplication: 𝐴𝑚×𝑛 × 𝐵𝑛×𝑝 = 𝐶𝑚×𝑝


𝑛

𝑐𝑖𝑗 = ෍ 𝑎𝑖𝑘 𝑏𝑘𝑗 = 𝑎𝑖1 𝑏1𝑗 + 𝑎𝑖2 𝑏2𝑗 … + 𝑎𝑖𝑛 𝑏𝑛𝑗


𝑘=1

𝑎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

Transpose of Matrix: A matrix which converts the rows of


𝑨 to columns and the columns of 𝑨 to rows is called the
transpose of 𝑨 and is designated by 𝑨’ or 𝑨𝑻 .

If A’s dimension is 𝑚 × 𝑛, then 𝑨𝑻 ’s dimension is 𝑛 × 𝑚

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

Examples (communicative and associative):

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

1. In a square matrix, the number of rows equals the


number of columns, i.e., 𝑛 × 𝑛 matrix.

𝑎11 𝑎12 𝑎13


1 2 𝑎21 𝑎22 𝑎23
Example: 2
3 4 𝑎31 𝑎32 𝑎33

2. Diagonal Matrix: a matrix (usually a square matrix)


in which the entries outside the main diagonal are all
zero.
1 0 0
5 0
Example: 0 2 0
0 1
0 0 4

24
Important Matrices

3. Symmetric Matrix: a square matrix with [𝑎𝑖𝑗 ] =


[𝑎𝑗𝑖 ] if 𝑖 ≠ 𝑗, i.e.,𝐴 = 𝐴’

1 2 3
5 2
Example: 2 2 2 6
2 1
3 6 4

4. Idempotent Matrix: a matrix with 𝑨𝑨 = 𝑨.

1 0 0
1 1
Example: 0 1 0
0 0
0 0 1

25
Important Matrices

5. Identity Matrix: a square matrix with 1s in its


diagonal and 0s everywhere else, usually represented
by the letter 𝐼𝑛 , where the subscript 𝑛 denotes the
order of the matrix.

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

6. Null Matrix (or Zero Matrix): a matrix whose elements are


all zeros.

Example:
0 0 0 0 0
0 0 0 0 0

Properties:
• 𝐴 + 0 = 0 + 𝐴 = 𝐴
• 𝐴0 = 0 and 0𝐴 = 0

28

You might also like