Matrix Multiplication, Vectors, and Special Matrices

ECON 441: Introduction to Mathematical Economics
Lecture 4

Div Bhagia

By the way

Four-panel comic: a person asks A.I. why it always wears a mask; the mask is lifted to reveal a matrix of entries a-one-one through a-m-n underneath, and the person says “let’s keep this on” - a joke that machine learning is linear algebra underneath

Matrix Multiplication

Only possible to multiply two matrices, \(A_{m \times n}\) and \(B_{p \times q}\) to get \(AB\) if \(n = p\) i.e. \[\text{number of columns in } A = \text{ number of rows in } B\]

So how to actually multiply these matrices? \[C = AB\] \[c_{ij} = a_{i1} b_{1j} + a_{i2} b_{2j} + ... + a_{in} b_{nj} = \sum_{k=1}^n a_{ik} b_{kj}\]

The element \(c_{ij}\) is obtained by multiplying term-by-term the entries of the \(i\)th row of \(A\) and \(j\)th column of \(B\).

Matrix Multiplication: Examples

\[A = \begin{bmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ \end{bmatrix}_{2 \times 3} B = \begin{bmatrix} b_{11} & b_{12} \\ b_{21} & b_{22} \\ b_{31} & b_{32} \\ \end{bmatrix}_{3 \times 2}\]
Here, \[C = AB = \begin{bmatrix} a_{11}b_{11} + a_{12}b_{21} + a_{13}b_{31} & a_{11}b_{12} + a_{12}b_{22} + a_{13}b_{32} \\ a_{21}b_{11} + a_{22}b_{21} + a_{23}b_{31} & a_{21}b_{12} + a_{22}b_{22} + a_{23}b_{32} \\ \end{bmatrix}_{2 \times 2}\]

Matrix Multiplication: Examples

\[A = \begin{bmatrix} 2 & 3 & 1 \\ 4 & -6 & -2 \end{bmatrix}_{2 \times 3} \quad B = \begin{bmatrix} 1 & 8 \\ -2 & 3 \end{bmatrix}_{2 \times 2}\]

\(AB\) is not defined here (why?), but \(BA\) is. Find \(BA\).

Matrix Multiplication: Examples

One more. \[A = \begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix}_{3 \times 1} \quad B = \begin{bmatrix} 2 & 0 & 1 \end{bmatrix}_{1 \times 3}\]

Both \(AB\) and \(BA\) are defined. Find both. What are their dimensions?

A Simple Economic Model

\[A = \begin{bmatrix} 1 & 2 \\ 1 & -3 \end{bmatrix} \quad x = \begin{bmatrix} q \\ p \end{bmatrix} \quad b = \begin{bmatrix} 100 \\ 20 \end{bmatrix}\]
 
What is \(Ax\)? \[Ax = \begin{bmatrix} q + 2p\\ q-3p \end{bmatrix}\]

Setting \(Ax=b\) gives us back our demand and supply equations.

Vectors

Matrices with only one column: column vectors \[x = \begin{bmatrix} x_1\\ x_2 \\ \vdots \\ x_n \end{bmatrix}\]

Matrices with only one row: row vectors \[x^T = \begin{bmatrix} x_1 & x_2 & \cdots & x_n \end{bmatrix}\]

Linear Dependence

A set of vectors is said to be linearly dependent if and only if any one of them can be expressed as a linear combination of the remaining vectors.
 
Example.\[v_1 = \begin{bmatrix} 1\\ 2 \\ \end{bmatrix} \quad \quad v_2 = \begin{bmatrix} 2\\ 4 \\ \end{bmatrix}\]

Linear Dependence

A set of vectors is said to be linearly dependent if and only if any one of them can be expressed as a linear combination of the remaining vectors.
 
Example.\[v_1 = \begin{bmatrix} 3\\ 2 \\ \end{bmatrix} \quad \quad v_2 = \begin{bmatrix} 1\\ 3 \\ \end{bmatrix} \quad \quad v_3 = \begin{bmatrix} 1\\ -4 \\ \end{bmatrix}\]

Linear Dependence

A set of \(m\)-vectors \(v_1, v_2, ...,v_n\) is linearly dependent if and only if there exists a set of scaler \(k_1, k_2, ..., k_n\) (not all zero) such that: \[\sum_{i=1}^n k_i v_i = 0 \quad (m \times 1)\]

Identity Matrices

Square matrix with \(1\)s in its principal diagonal and \(0\)s elsewhere
 
A \(2 \times 2\) identity matrix: \[I_2 = \begin{bmatrix} 1 & 0\\ 0 & 1 \\ \end{bmatrix}\] A \(3 \times 3\) identity matrix: \[I_3 = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0\\ 0 & 0 & 1 \end{bmatrix}\]

Identity Matrices

Acts like 1, \[AI = IA = A\]

Example. \[A = \begin{bmatrix} 2 & 3 & 1 \\ 4 & -6 & 2 \end{bmatrix}\]

Idempotent Matrices

A matrix is an idempotent matrix if it remains unchanged when multiplied by itself any number of times.
 
\(A\) is idempotent if and only if \(A = A^k\).
 
Is an identity matrix idempotent?

Null Matrix

A null matrix is a matrix with all elements \(0\).
 
\[\begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix}\]

\(A + 0 = A\)

\(A 0 = 0\)

Transpose of a Matrix

Transpose of A (\(A^T\), also written \(A'\)): interchange rows and columns
 
\[A = \begin{bmatrix} 2 & 3 & 1 \\ 4 & -6 & 2 \end{bmatrix}\]

Transpose of a Matrix

A matrix \(A\) is said to be symmetric if \[A^T=A\]

A matrix \(A\) is said to be skew-symmetric if \[A^T=-A\]

A matrix \(A\) is said to be orthogonal if \[A^T A=I\]

Example: Symmetric Matrix

\[A=\left[\begin{array}{rrr} 1 & 2 & 0 \\ 2 & 3 & -5 \\ 0 & -5 & 4 \end{array}\right]\]

Example: Skew-symmetric Matrix

\[A=\left[\begin{array}{ccc}0 & -1 & 3 \\ 1 & 0 & -4 \\ -3 & 4 & 0\end{array}\right]\]

Example: Orthogonal Matrix

\[A=\left[\begin{array}{cc} \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \end{array}\right]\]

Properties of Transposes

\[\begin{array}{l} \left(A^T\right)^T=A \\~\\ (A+B)^T=A^T+B^T \\~\\ (A B)^T=B^T A^T \\~\\ \end{array}\] Example: \(A=\left[\begin{array}{ll}4 & 1 \\ 9 & 0\end{array}\right] \quad B=\left[\begin{array}{ll}2 & 0 \\ 7 & 1\end{array}\right]\)

Homework Questions

  • Exercise 4.4: 5, 7

  • Exercise 4.5: 1, 4

  • Exercise 4.6: 2, 6

  • Exercise 5.1: 3, 4

Textbook reference: 4.2-4.6