ECON 441: Introduction to Mathematical Economics
Lecture 3
\(q\): quantity of hats, \(p\): price of a single hat
Demand for hats: \(q = 100-2p\)
\(q\): quantity of hats, \(p\): price of a single hat
Supply for hats: \(q = 20+3p\)
\(q\): quantity of hats, \(p\): price of a single hat
Demand for hats: \[q = 100-2p\] Supply for hats: \[q = 20+3p\]
Equilibrium: At what price will both demand and supply be equal?
Equilibrium: At what price will both demand and supply be equal? \[100-2p = 20+3p \rightarrow p^* = \$16\]
What is the quantity traded at this price? \[q ^* = 100-2 \times 16 = 20+3 \times 16 = 68\]
\(q ^*\) and \(p^*\) are determined simultaneously.
We solved a system of two (linear) equations in two variables.
Complex economic models: multiple equations with multiple variables
Hard to just wing it... Enter, Matrix Algebra!
Matrix Algebra can help us write complex system of equations compactly and solve them
\(q\): quantity of hats, \(p\): price of a single hat
Demand for hats: \(q = 100-2p\)
Supply for hats: \(q = 20+3p\)
Rewrite the two equations: \[\begin{aligned}
q + 2p &= 100 \\ q-3p &= 20
\end{aligned}\]
Two equations in two unknowns: \[\begin{aligned} q + 2p &= 100 \\ q-3p &= 20 \end{aligned}\]
Can write this as \(Ax = b\), where \[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}\]
These arrays are called matrices.
A matrix is a rectangular array of numbers, parameters, or vectors.
Example. \(A = \begin{bmatrix} 2 & 3 & 1 \\ -1 &4 & 6 \end{bmatrix}\)
Dimensions of matrix:
Number of rows (\(m\))
Number of columns (\(n\))
A matrix with \(m\) rows and \(n\) columns is referred to as an \(m \times n\) matrix
What’s the dimension of \(A\)?
\[A = \begin{bmatrix}
2 & 3 & 1 \\
-1 &4 & 6
\end{bmatrix}_{\_\_ \times \_\_}\]
\[A = \begin{bmatrix} a_{11} & a_{12} & a_{13} & \cdots & a_{1n} \\ a_{21} & a_{22} & a_{23} & \cdots & a_{2n} \\ \vdots & \vdots & \vdots & \vdots & \vdots \\ a_{m1} & a_{m2} & a_{m3} & \cdots & a_{mn} \\ \end{bmatrix}\]
Can write it more compactly \[A = [ a_{ij} ] \quad i=1,2,...,m; j=1,2,...,n\]
Square matrix: equal number of rows and columns
Example. \[A = \begin{bmatrix}
a_{11} & a_{12} & a_{13} \\
a_{21} & a_{22} & a_{23} \\
a_{31} & a_{32} & a_{33} \\
\end{bmatrix}_{3\times 3}\]
Two matrices are equal if all their elements are identical.
Example. \[A = \begin{bmatrix}
1 & 8 \\
4 &-1 \\
\end{bmatrix} \neq
\begin{bmatrix}
1 & 8 \\
4 & 2 \\
\end{bmatrix}\]
So \(A=B\) if and only if \(a_{ij} = b_{ij}\) for all \(i, j\)
How to add or take the difference between two matrices?
\(\rightarrow\) Element-by-element
\(\rightarrow\) Matrices have to have same dimension
Example. \[A = \begin{bmatrix} 2 & 3 \\ 4 & -6 \end{bmatrix} \quad \quad B = \begin{bmatrix} 1 & 8 \\ -2 & 3 \end{bmatrix}\]
What is \(A+B\) and \(A-B\)?
How to multiply a scalar to a matrix? \[\lambda \begin{bmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ \end{bmatrix} = \begin{bmatrix} \lambda a_{11} & \lambda a_{12} & \lambda a_{13} \\ \lambda a_{21} & \lambda a_{22} & \lambda a_{23} \\ \end{bmatrix}\] Example. \[A = \begin{bmatrix} 2 & 3 \\ 4 & -6 \end{bmatrix} \quad \quad B = \begin{bmatrix} 1 & 8 \\ -2 & 3 \end{bmatrix}\] What is \(2B\) and \(A-2B\)?
A whole new animal...
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\]
Example. \(A = \begin{bmatrix} 2 & 3 & 1 \\ 4 & -6 & -2 \end{bmatrix}_{2 \times 3}\) \(B = \begin{bmatrix} 1 & 8 \\ -2 & 3 \end{bmatrix}_{2 \times 2}\)
Cannot do \(AB\), but can do \(BA\)
Another example. \[A = \begin{bmatrix} 2 & 3 & 1 \\ 4 & -6 & -2 \end{bmatrix}_{2 \times 3} B = \begin{bmatrix} 1 \\ -2 \\ 4 \end{bmatrix}_{3 \times 1}\]
Can we multiply \(A\) and \(B\) to find \(C=AB\)?
Yes, since \(A\) has 3 columns, which is equal to the number of rows in \(B\).
Also, the dimension of \(C\) will be \(2 \times 1\).
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\).
\[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}\]
Textbook reference: 4.1, 4.2
ECON 441 · Introduction to Mathematical Economics