Mathematics · Structures and transformations

Linear algebra

Linear algebra studies objects that can be added and scaled, and transformations that preserve those operations. Matrices are their numerical representation: they describe data, equation systems and geometric motion in one language.

A language for combining directions

A vector is more than an arrow: it is an element of a space where addition and scalar multiplication make sense. A transformation is linear when it preserves both operations.

T(αu+βv)=αT(u)+βT(v)

Algebra

Sums, products, systems and relationships between coordinates.

Geometry

Directions, projections, rotations, areas and changes of basis.

Computation

Algorithms that turn matrices into useful information.

Linear combinations, span, independence and basis

A linear combination of vectors v₁,…,vₖ has the form

αv1++αvk

Span

The set of all linear combinations generated by the vectors.

Independence

No vector is a combination of the others; only all-zero coefficients produce zero.

Basis

An independent set spanning the whole space. Every vector has unique coordinates in that basis.

Dimension

The number of vectors in a basis; it measures the space’s independent directions.

Coordinates ≠ vector. The vector is the object; its column of numbers depends on the basis used to describe it.

A matrix represents a linear transformation

An m × n matrix A takes vectors with n coordinates and produces vectors with m coordinates. Column j of A is the image of the j-th standard basis vector.

Ax= [a1an] x1xn =x1a1++xnan

Addition and scalar multiplication act entry by entry. Matrix multiplication instead represents composition of transformations: in ABx = A(Bx), B acts first, then A.

Lab 1: build the row-by-column product

Edit values and dimensions, then step through: for every cell cᵢⱼ the lab highlights row i of A, column j of B and adds one product at a time.

A 2 × 3
B 3 × 2
C 2 × 2

Current dot product cᵢⱼ = riga i · colonna j
row of A column of B current factors cell of C
Compatibility condition. If A is m × n and B is n × p, then AB exists and is m × p. In general BA may not exist—or may exist but differ from AB.

Lab 2: watch a matrix transform the plane

The matrix columns show where basis vectors e₁ and e₂ land. Edit A or drag the blue point: grid, unit square, area and image vector update together.

Matrix A
Vector v
Transformations
det(A)
1
Area factor
1
Orientation
preserved
Av
(2; 1)

The blue point is draggable. The purple polygon is the image of the unit square.

Determinant, invertibility and rank

Determinant

Measures the oriented area or volume scale factor. Its sign tells whether orientation is reversed.

Invertibility

For a square matrix, det(A) ≠ 0 is equivalent to full rank, independent columns and a unique Ax = b solution for every b.

Rank

The number of independent directions preserved by the transformation: the dimension of its column space.

Null space

Contains vectors mapped to zero. The rank-nullity theorem says rank(A) + nullity(A) = n.

A=abcddet(A)=adbc

Lab 3: solve a system with Gauss-Jordan

The augmented matrix [A|b] contains every equation. Elementary row operations preserve the solution set; step through pivots, swaps, normalization and elimination.

Initial system [A|b]
Reduction state

rank(A)
rank([A|b])
Classification
Solution
Rouché–Capelli. A system is consistent when rank(A) = rank([A|b]); if this rank also equals the number of unknowns, the solution is unique, otherwise free parameters remain.

Computational cost of core operations

OperationDimensionsClassical timeResult space
Additionm × nΘ(mn)Θ(mn)
Matrix-vector(m × n)(n × 1)Θ(mn)Θ(m)
Matrix product(m × n)(n × p)Θ(mnp)Θ(mp)
Gaussian elimination, squaren × nΘ(n³)Θ(n²), or in place
Determinant by eliminationn × nΘ(n³)Θ(n²)

For large matrices there are asymptotically faster algorithms and implementations exploiting caches and parallelism; the classical triple-loop product remains the fundamental model to understand.

Common mistakes

  • Multiplying entry by entry when matrix multiplication is required.
  • Checking outer rather than inner dimensions: in AB, columns of A must match rows of B.
  • Reversing order: AB represents B first and then A, and almost never AB = BA.
  • Reading det(A) = 0 as “zero matrix”: it means at least one direction is collapsed.
  • During elimination, applying a row operation to coefficients but not to the right-hand side.

Exploration exercises

  1. Build two square matrices A and B with AB ≠ BA. Follow the first cell in both orders.
  2. On the plane, try matrices with determinant 2, −2 and 0. Compare area, orientation and geometric rank.
  3. Create a system where one row is twice another. Change only the right-hand side and watch infinite solutions become none.
  4. Explain why the columns of a 2 × 2 matrix with zero determinant cannot form a basis of the plane.