Matrix Lesson: Introduction to Matrices
📌 What is a Matrix?
A matrix is a rectangular array of numbers arranged in rows and columns.
Example:
A=[1234]A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}A=[1324]
This is a 2×2 matrix (2 rows, 2 columns).
Each number in the matrix is called an element.
🧩 Matrix Notation
A matrix is often denoted as:
A=[aij]A = [a_{ij}]A=[aij]
Where:
AAA is the name of the matrix.
aija_{ij}aij is the element in the i-th row and j-th column.
Basic Operations
1. Matrix Addition
Only possible if matrices have the same dimensions.
[1234]+[5678]=[681012]\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} + \begin{bmatrix} 5 & 6 \\ 7 & 8 \
end{bmatrix} = \begin{bmatrix} 6 & 8 \\ 10 & 12 \end{bmatrix}[1324]+[5768]=[610812]
2. Scalar Multiplication
Multiply every element by a number (scalar).
3⋅[1−204]=[3−6012]3 \cdot \begin{bmatrix} 1 & -2 \\ 0 & 4 \end{bmatrix} = \begin{bmatrix} 3 & -6 \\ 0 &
12 \end{bmatrix}3⋅[10−24]=[30−612]
3. Matrix Multiplication
For matrices Am×nA_{m \times n}Am×n and Bn×pB_{n \times p}Bn×p, the result is Cm×pC_{m \times
p}Cm×p.
Example:
[12]⋅[34]=[11]\begin{bmatrix} 1 & 2 \end{bmatrix} \cdot \begin{bmatrix} 3 \\ 4 \end{bmatrix} = [11][12
]⋅[34]=[11]
(1×3 + 2×4 = 11)
🔄 Transpose of a Matrix
Switch rows and columns:
A=[1234],AT=[1324]A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}, \quad A^T = \begin{bmatrix} 1 &
3 \\ 2 & 4 \end{bmatrix}A=[1324],AT=[1234]
🧠 Determinant (for square matrices)
For 2×2:
det(A)=ad−bc,A=[abcd]\text{det}(A) = ad - bc, \quad A = \begin{bmatrix} a & b \\ c & d \
end{bmatrix}det(A)=ad−bc,A=[acbd]
Example:
[2314],det=2×4−3×1=5\begin{bmatrix} 2 & 3 \\ 1 & 4 \end{bmatrix}, \quad \text{det} = 2×4 - 3×1 = 5[21
34],det=2×4−3×1=5
🔁 Inverse of a Matrix (2×2)
Only if determinant ≠ 0:
A−1=1ad−bc[d−b−ca]A^{-1} = \frac{1}{ad - bc} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix}A−1=ad−bc1
[d−c−ba]
🧰 Applications of Matrices
Solving systems of linear equations
Computer graphics
Cryptography
Data science and machine learning