Matrices and Operations
Disclaimer: These are my personal notes compiled for my own reference and learning. They may contain errors, incomplete information, or personal interpretations. While I strive for accuracy, these notes are not peer-reviewed and should not be considered authoritative sources. Please consult official textbooks, research papers, or other reliable sources for academic or professional purposes.
1. Matrix Definition
A matrix $A$ of size $m \times n$ is an array of numbers:
2. Basic Operations
2.1 Matrix Addition
For matrices $A$ and $B$ of the same size:
2.2 Scalar Multiplication
For scalar $c$ and matrix $A$:
2.3 Matrix Multiplication
For $A$ of size $m \times n$ and $B$ of size $n \times p$:
Note: Matrix multiplication is not commutative: $AB \neq BA$ in general.
3. Special Matrices
- Identity Matrix: $I_n = \text{diag}(1, 1, \ldots, 1)$
- Zero Matrix: $0_{m \times n}$ with all entries zero
- Diagonal Matrix: $D = \text{diag}(d_1, d_2, \ldots, d_n)$
- Symmetric Matrix: $A^T = A$
- Skew-Symmetric: $A^T = -A$
4. Transpose
The transpose of matrix $A$ is:
Properties:
- $(A^T)^T = A$
- $(A + B)^T = A^T + B^T$
- $(AB)^T = B^T A^T$
- $(cA)^T = cA^T$
5. Determinant
For a $2 \times 2$ matrix:
For larger matrices, use cofactor expansion or row operations.
6. Inverse
A matrix $A$ is invertible if $\det(A) \neq 0$. The inverse satisfies:
For $2 \times 2$ matrix:
7. Rank
The rank of a matrix is the maximum number of linearly independent rows (or columns).
- $\text{rank}(A) \leq \min(m, n)$
- $\text{rank}(A) = \text{rank}(A^T)$
- $\text{rank}(AB) \leq \min(\text{rank}(A), \text{rank}(B))$
8. Row Operations
Elementary row operations:
- Row Swap: Exchange two rows
- Row Scaling: Multiply a row by a non-zero scalar
- Row Addition: Add a multiple of one row to another
9. Row Echelon Form (REF)
A matrix is in REF if:
- All zero rows are at the bottom
- Leading coefficient (pivot) is 1
- Pivots are to the right of pivots in rows above
10. Reduced Row Echelon Form (RREF)
In addition to REF properties:
- All entries above and below pivots are zero
11. Systems of Linear Equations
A system $Ax = b$ can be solved using:
- Gaussian Elimination: Convert to REF
- Gauss-Jordan: Convert to RREF
- Matrix Inversion: $x = A^{-1}b$ (if $A$ is invertible)
12. Code Example
# Python code for matrix operations
import numpy as np
# Create matrices
A = np.array([[1, 2], [3, 4]])
B = np.array([[5, 6], [7, 8]])
# Basic operations
C = A + B # Addition
D = A @ B # Matrix multiplication
E = A.T # Transpose
# Determinant and inverse
det_A = np.linalg.det(A)
inv_A = np.linalg.inv(A)
# Solve system Ax = b
b = np.array([1, 2])
x = np.linalg.solve(A, b)
print(f"Determinant: {det_A}")
print(f"Inverse:\n{inv_A}")
print(f"Solution: {x}")
13. References
- Strang, G. (2016). Introduction to Linear Algebra.
- Lay, D. C. (2015). Linear Algebra and Its Applications.
- Hoffman, K., & Kunze, R. (1971). Linear Algebra.