Master matrix algebra and operations
A matrix is a rectangular array of numbers arranged in rows and columns, enclosed in brackets.
Dimensions: 2 rows ร 3 columns
Notation: A is a 2ร3 matrix
Matrices of the same dimensions can be added or subtracted by adding/subtracting corresponding elements.
Matrix multiplication is more complex than element-wise operations. The number of columns in the first matrix must equal the number of rows in the second matrix.
If A is mรn and B is nรp, then AรB is mรp
= \begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix}
The determinant is a scalar value that can be computed from a square matrix.
\det\begin{pmatrix} a & b \\ c & d \end{pmatrix} = ad - bc
\det\begin{pmatrix} 3 & 8 \\ 4 & 10 \end{pmatrix} = (3ร10) - (8ร4) = 30 - 32 = -2
The inverse of a matrix A is denoted Aโปยน and satisfies A ร Aโปยน = I (identity matrix).
A^{-1} = \frac{1}{\det A} \begin{pmatrix} d & -b \\ -c & a \end{pmatrix}
(where A = \begin{pmatrix} a & b \\ c & d \end{pmatrix})
Systems of linear equations can be solved using matrices: AX = B, where X is the solution matrix.
2x + 3y = 7
4x - 2y = 2
\begin{pmatrix} 2 & 3 \\ 4 & -2 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 7 \\ 2 \end{pmatrix}
Solution: x = 1, y = 1.67
Transformations (rotation, scaling, translation) use matrices
Input-output models and economic analysis
Momentum conservation and quantum mechanics
A weather model: If sunny today, 80% chance sunny tomorrow, 20% rainy. If rainy today, 40% sunny, 60% rainy tomorrow.
If today is sunny (state vector \begin{pmatrix} 1 \\ 0 \end{pmatrix}), what's the probability distribution tomorrow?