mk

Mathematics → Linear Algebra

Linear Algebra

Linear algebra is the study of vectors, matrices, and linear transformations. It is the language of machine learning, computer graphics, physics, and data science — arguably the most practically important branch of mathematics.


Vectors

A vector in Rn\mathbb{R}^n is an ordered list of nn real numbers, written as a column:

v=(v1v2vn)\mathbf{v} = \begin{pmatrix} v_1 \\ v_2 \\ \vdots \\ v_n \end{pmatrix}

Operations

Addition
u+v=(u1+v1, u2+v2, )\mathbf{u} + \mathbf{v} = (u_1+v_1,\ u_2+v_2,\ \ldots)
Scalar multiplication
cv=(cv1, cv2, )c\mathbf{v} = (cv_1,\ cv_2,\ \ldots)
Dot product
uv=i=1nuivi=uvcosθ\mathbf{u} \cdot \mathbf{v} = \sum_{i=1}^n u_i v_i = |\mathbf{u}||\mathbf{v}|\cos\theta
Magnitude
v=v12+v22++vn2|\mathbf{v}| = \sqrt{v_1^2 + v_2^2 + \cdots + v_n^2}

Two vectors are orthogonal (perpendicular) if and only if their dot product is zero: uv=0\mathbf{u} \cdot \mathbf{v} = 0.

Matrices

Definition — Matrix

An m×nm \times n matrix is a rectangular array of numbers with mm rows and nn columns. The entry in row ii, column jj is denoted AijA_{ij}.
A=(123456)(2\times3 matrix)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix} \quad \text{(2\times 3 matrix)}

A matrix represents a linear transformation: multiplying by AA maps vectors from Rn\mathbb{R}^n to Rm\mathbb{R}^m. Every linear transformation between finite-dimensional spaces can be represented as a matrix.

Matrix Operations

Multiplication

The product ABAB of an m×nm\times n matrix AA and an n×pn\times p matrix BB is the m×pm\times p matrix with entries:

(AB)ij=k=1nAikBkj(AB)_{ij} = \sum_{k=1}^n A_{ik} B_{kj}

Matrix multiplication is not commutative: ABBAAB \neq BA in general. It is associative: (AB)C=A(BC)(AB)C = A(BC).

Transpose

The transpose ATA^T is obtained by reflecting over the diagonal — rows become columns:

(AT)ij=Aji(A^T)_{ij} = A_{ji}

Inverse

A square matrix AA is invertible if there exists A1A^{-1} such that AA1=A1A=IA A^{-1} = A^{-1} A = I, where II is the identity matrix. AA is invertible if and only if det(A)0\det(A) \neq 0.

Determinants

The determinant is a scalar associated with every square matrix, measuring how much the matrix scales area (or volume in higher dimensions).

det(abcd)=adbc\det\begin{pmatrix}a & b \\ c & d\end{pmatrix} = ad - bc
det(abcdefghi)=a(eifh)b(difg)+c(dheg)\det\begin{pmatrix}a&b&c\\d&e&f\\g&h&i\end{pmatrix} = a(ei-fh) - b(di-fg) + c(dh-eg)
det(AB) = det(A)·det(B)
det(Aᵀ) = det(A)
det(A⁻¹) = 1/det(A)
A is invertible ⟺ det(A) ≠ 0

Linear Systems

A system of linear equations can be written compactly as Ax=bA\mathbf{x} = \mathbf{b}:

(2153)(xy)=(47)\begin{pmatrix}2 & 1\\5 & 3\end{pmatrix}\begin{pmatrix}x\\y\end{pmatrix} = \begin{pmatrix}4\\7\end{pmatrix}

If AA is invertible, the unique solution is x=A1b\mathbf{x} = A^{-1}\mathbf{b}. In practice, Gaussian elimination — row-reducing the augmented matrix [Ab][A \mid \mathbf{b}] — is more efficient. A system has either zero, one, or infinitely many solutions.

Eigenvalues and Eigenvectors

Definition — Eigenvalue / Eigenvector

A nonzero vector v\mathbf{v} is an eigenvector of matrix AA with eigenvalue λ\lambda if:
Av=λvA\mathbf{v} = \lambda\mathbf{v}
Geometrically: AA stretches (or reflects) v\mathbf{v} by the scalar factor λ\lambda, leaving its direction unchanged.

Eigenvalues are found by solving the characteristic equation:

det(AλI)=0\det(A - \lambda I) = 0

For each eigenvalue λ\lambda, the corresponding eigenvectors are the nonzero solutions to (AλI)v=0(A - \lambda I)\mathbf{v} = \mathbf{0}.

Example: For A=(3102)A = \begin{pmatrix}3&1\\0&2\end{pmatrix}, the characteristic equation is (3λ)(2λ)=0(3-\lambda)(2-\lambda)=0, giving eigenvalues λ1=3\lambda_1 = 3, λ2=2\lambda_2 = 2.

Eigenvalues and eigenvectors are fundamental to principal component analysis (PCA), Google's PageRank algorithm, quantum mechanics, and the analysis of differential equations.


Next: Probability →