Vector and Matrices
https://forms.gle/uLaMnx5amMzwCKav9
12.1 SCALARS
12.2 VECTORS
Example: \[(5,-3,-6)+(1,8,7)=(6,5,1)\]
\[ (5, 1, 4, 1) − (1, 2, 3, 4) = (4, −1, 1, −3) \]
Example: \[(3, 1) · (2, 3) = 6 + 3 = 9\]
\[(6, 5, 4) · (9, 8, 7) = 54 + 40 + 28 = 122\]
\[ A_{3 \times 3} = \begin{pmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{pmatrix}. \]
\[ L_{3 \times 3} = \begin{pmatrix} a_{11} & 0 & 0 \\ a_{21} & a_{22} & 0 \\ a_{31} & a_{32} & a_{33} \end{pmatrix}, \quad U_{3 \times 3} = \begin{pmatrix} a_{11} & a_{12} & a_{13} \\ 0 & a_{22} & a_{23} \\ 0 & 0 & a_{33} \end{pmatrix}. \]
\[ A_{3 \times 3} = \begin{pmatrix} a_{11} & a_{12} & a_{13} \\ a_{12} & a_{22} & a_{23} \\ a_{13} & a_{23} & a_{33} \end{pmatrix} \]
The transpose of a matrix is another matrix in which the rows and columns have been switched, i.e., the rows of the first matrix are written as columns in the second and the columns in the first matrix are written as rows in the second.
\[A = \begin{bmatrix} 1 & 3 & 0 \\ -1 & 6 & 2 \end{bmatrix}\]
\[A^T = \begin{bmatrix} 1 & -1 \\ 3 & 6 \\ 0 & 2 \end{bmatrix}\]
Matrix Addition and Subtraction - Given two matrices \(A\) and \(B\) of equal dimensions, the operation \(A + B\) will result in a matrix \(C\) with the same dimensions where each element \(c_{i,j} = a_{i,j} + b_{i,j}\).
\[\begin{bmatrix} 1 & -2 \\ 0 & 5 \\ 4 & 3 \end{bmatrix} + \begin{bmatrix} 3 & 9 \\ -1 & 1 \\ 0 & 2 \end{bmatrix} = \begin{bmatrix} 4 & 7 \\ -1 & 6 \\ 4 & 5 \end{bmatrix}\]
\[\begin{bmatrix} 1 & -2 \\ 0 & 5 \\ 4 & 3 \end{bmatrix} - \begin{bmatrix} 3 & 9 \\ -1 & 1 \\ 0 & 2 \end{bmatrix} = \begin{bmatrix} -2 & -11 \\ 1 & 4 \\ 4 & 1 \end{bmatrix}\]
\[5 \times \begin{bmatrix} 1 & -2 \\ 0 & 5 \\ 4 & 3 \end{bmatrix} = \begin{bmatrix} 5 & -10 \\ 0 & 25 \\ 20 & 15 \end{bmatrix}\]
Example:
\[AB = \begin{bmatrix} 1 & -2 \\ 0 & 5 \\ 4 & 3 \end{bmatrix} \times \begin{bmatrix} 3 & 1 & 4 \\ -1 & 2 & 5 \end{bmatrix}\]
\[= \begin{bmatrix} (1 \times 3) + (-2 \times -1) & (1 \times 1) + (-2 \times 2) & (1 \times 4) + (-2 \times 5) \\ (0 \times 3) + (5 \times -1) & (0 \times 1) + (5 \times 2) & (0 \times 4) + (5 \times 5) \\ (4 \times 3) + (3 \times -1) & (4 \times 1) + (3 \times 2) & (4 \times 4) + (3 \times 5) \end{bmatrix}\]
\[= \begin{bmatrix} 3 + 2 & 1 - 4 & 4 - 10 \\ 0 - 5 & 0 + 10 & 0 + 25 \\ 12 - 3 & 4 + 6 & 16 + 15 \end{bmatrix}\]
\[= \begin{bmatrix} 5 & -3 & -6 \\ -5 & 10 & 25 \\ 9 & 10 & 31 \end{bmatrix}\]
Example:
\[BA = \begin{bmatrix} 3 & 1 & 4 \\ -1 & 2 & 5 \end{bmatrix} \times \begin{bmatrix} 1 & -2 \\ 0 & 5 \\ 4 & 3 \end{bmatrix}\]
\[= \begin{bmatrix} (3 \times 1) + (1 \times 0) + (4 \times 4) & (3 \times -2) + (1 \times 5) + (4 \times 3) \\ (-1 \times 1) + (2 \times 0) + (5 \times 4) & (-1 \times -2) + (2 \times 5) + (5 \times 3) \end{bmatrix}\]
\[= \begin{bmatrix} 3 + 0 + 16 & -6 + 5 + 12 \\ -1 + 0 + 20 & 2 + 10 + 15 \end{bmatrix}\]
\[= \begin{bmatrix} 19 & 11 \\ 19 & 27 \end{bmatrix}\]
Consider the two-by-two matrix,
\[A = \begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix}\]
\[|A| = (a_{11} \cdot a_{22}) - (a_{12} \cdot a_{21})\]
Consider the following three-by-three matrix:
\[B = \begin{bmatrix} b_{11} & b_{12} & b_{13} \\ b_{21} & b_{22} & b_{23} \\ b_{31} & b_{32} & b_{33} \end{bmatrix}\]
\[M_{23} = \begin{vmatrix} b_{11} & b_{12} \\ b_{31} & b_{32} \end{vmatrix} = (b_{11} \cdot b_{32}) - (b_{31} \cdot b_{12})\]
\[A \cdot B = B \cdot A = I\]
\[A \cdot A^{-1} = A^{-1} \cdot A = I\]
\[A^{-1} = \frac{1}{|A|}C^T\]
Example:
Let’s try to find the inverse for the following matrix in this manner:
\[A = \begin{bmatrix} 1 & 2 & 1 \\ 0 & 4 & 3 \\ -6 & -2 & 2 \end{bmatrix}\]
The determinant equals
\[|A| = 1 \cdot M_{11} - 2 \cdot M_{12} + 1 \cdot M_{13} = 1(14) - 2(18) + 1(24) = 2\]
Now we need to construct the cofactor matrix. Thus we first have to find all the minors:
\[M_{11} = \begin{vmatrix} 4 & 3 \\ -2 & 2 \end{vmatrix} = (4 \cdot 2) - ((-2) \cdot 3) = 8 + 6 = 14\]
\[M_{12} = \begin{vmatrix} 0 & 3 \\ -6 & 2 \end{vmatrix} = (0 \cdot 2) - ((-6) \cdot 3) = 0 + 18 = 18\]
… and so forth, until we find that all the minors are
\[\begin{aligned} M_{11} &= 14, \\ M_{12} &= 18, \\ M_{13} &= 24, \\ M_{21} &= 6, \\ M_{22} &= 8, \\ M_{23} &= 10, \\ M_{31} &= 2, \\ M_{32} &= 3, \\ M_{33} &= 4. \end{aligned}\]
With this information we can now construct our cofactor matrix (remember to multiply each minor by \((-1)^{i+j}\)):
\[C = \begin{bmatrix} 14 & -18 & 24 \\ -6 & 8 & -10 \\ 2 & -3 & 4 \end{bmatrix}\]
Now we can transpose the cofactor matrix to find the adjoint matrix of \(A\):
\[\text{adj}(A) = \begin{bmatrix} 14 & -6 & 2 \\ -18 & 8 & -3 \\ 24 & -10 & 4 \end{bmatrix}\]
Finally, we multiply this matrix by \(\frac{1}{|A|}\) to find the inverse of \(A\):
\[A^{-1} = \frac{1}{|A|}\text{adj}(A) = \frac{1}{2}\begin{bmatrix} 14 & -6 & 2 \\ -18 & 8 & -3 \\ 24 & -10 & 4 \end{bmatrix} = \begin{bmatrix} 7 & -3 & 1 \\ -9 & 4 & -\frac{3}{2} \\ 12 & -5 & 2 \end{bmatrix}\]
Again, it’s good to check to see whether \(AA^{-1} = A^{-1}A = I\) (it does).
Matrix and Vector Properties:
Associative property | \((AB)C = A(BC)\) |
Additive distributive property | \((A + B)C = AC + BC\) |
Scalar commutative property | \(xAB = (xA)B = A(xB) = ABx\) |
Matrix and Vector Transpose Properties
Inverse | \((A^T)^T = A\) |
Additive property | \((A + B)^T = A^T + B^T\) |
Multiplicative property | \((AB)^T = B^T A^T\) |
Scalar multiplication | \((cA)^T = cA^T\) |
Inverse transpose | \((A^{-1})^T = (A^T)^{-1}\) |
If A is symmetric | \(A^T = A\) |
Matrix Determinant Properties
Transpose property | \(\det(A) = \det(A^T)\) |
Identity matrix | \(\det(I) = 1\) |
Multiplicative property | \(\det(AB) = \det(A) \det(B)\) |
Inverse property | \(\det(A^{-1}) = \frac{1}{\det(A)}\) |
Matrix Inverse Properties
Inverse | \((A^{-1})^{-1} = A\) |
Multiplicative property | \((AB)^{-1} = B^{-1}A^{-1}\) |
Scalar multiplication (n x n) | \((cA)^{-1} = c^{-1}A^{-1}\) if \(c \neq 0\) |
\[\hat{\beta} = (X^TX)^{-1}X^T \mathbf{y}\]
Example:
State | Per Capita Income | % Gov’t Employees |
---|---|---|
Alabama | $24,028 | 19.2 |
Florida | $30,446 | 14.5 |
Georgia | $29,442 | 16.4 |
Mississippi | $23,448 | 21.8 |
North Carolina | $28,235 | 17.3 |
South Carolina | $26,132 | 18.2 |
Tennessee | $28,455 | 15.5 |
\[ X = \begin{bmatrix} 1 & 24,028 \\ 1 & 30,446 \\ 1 & 29,442 \\ 1 & 23,448 \\ 1 & 28,235 \\ 1 & 26,132 \\ 1 & 28,445 \end{bmatrix} \]
\[ X^TX = \begin{bmatrix} 7 & 190,356 \\ 190,356 & 5,218,840,922 \end{bmatrix} \]
\[ (X^TX)^{-1} = \begin{bmatrix} 17.603 & -0.001 \\ -0.001 & 0.000 \end{bmatrix} \]
\[ X^T \mathbf{y} = \begin{bmatrix} 1 & 24,028 \\ 1 & 30,446 \\ 1 & 29,442 \\ 1 & 23,448 \\ 1 & 28,235 \\ 1 & 26,132 \\ 1 & 28,445 \end{bmatrix} \begin{bmatrix} 19.2 \\ 14.5 \\ 16.4 \\ 21.8 \\ 17.3 \\ 18.2 \\ 15.5 \end{bmatrix} = \begin{bmatrix} 122.9 \\ 3,301,785.2 \end{bmatrix} \]
\[ \begin{bmatrix} \beta \\ \alpha \end{bmatrix} = \begin{bmatrix} 17.603 & -0.001 \\ -0.001 & 0.000 \end{bmatrix} \begin{bmatrix} 122.9 \\ 3,301,785.2 \end{bmatrix} = \begin{bmatrix} 50.228 \\ -0.079 \end{bmatrix} \]
Given the matrices:
\[ A = \begin{bmatrix} 2 & 8 \\ 3 & 0 \\ 5 & 1 \end{bmatrix}, \quad B = \begin{bmatrix} 2 & 0 \\ 3 & 8 \end{bmatrix} \]
Find the inverse of the matrix \(B = \begin{bmatrix} 4 & 1 & -1 \\ 0 & 3 & 2 \\ 3 & 0 & 7 \end{bmatrix}\).
https://forms.gle/Uf3aQsEQPCiNX1EDA
Any Questions?