Skip to content

Notation and Symbols

Most of the difficulty in reading a mathematics textbook for the first time is not the mathematics. It is that the author fixed a notation in the front matter, assumed you memorised it, and then wrote four hundred pages in it. Miss one convention and a page that would have been easy becomes unreadable.

This page is that front matter, expanded. It mirrors the Table of Symbols in Mathematics for Machine Learning (pages 6 and 7), adds the chapter where each symbol first does real work, and flags the half-dozen places where the same mark means two different things.

Bookmark it. You will come back.

  • The typeface convention that tells you a scalar from a vector from a matrix, at a glance.
  • Why x⊤y\mathbf{x}^\top\mathbf{y} and ⟨x,y⟩\langle\mathbf{x},\mathbf{y}\rangle are written differently even when they are equal.
  • The difference between BB, B\boldsymbol{B} and B\mathcal{B}, which the book uses on the same page.
  • Which symbols are overloaded, and how to tell from context which meaning is in play.
  • Where each symbol first appears, so you can look up the derivation rather than the definition.

Everything else is lookup. This one is worth memorising:

you seeit is aexample
lowercase italicscalar — a single numberaa, bb, cc, α\alpha, β\beta, γ\gamma, λ\lambda
lowercase boldvector — a column of numbersx\mathbf{x}, y\mathbf{y}, z\mathbf{z}, b1\mathbf{b}_1
uppercase boldmatrix — a grid of numbersA\mathbf{A}, B\mathbf{B}, C\mathbf{C}
uppercase italica count, or a random variableDD, NN, XX, YY
calligraphica setA\mathcal{A}, B\mathcal{B}, C\mathcal{C}

So x⊤Ax\mathbf{x}^\top\mathbf{A}\mathbf{x} reads immediately as row-vector times matrix times column-vector, which must come out a scalar. Reading shapes off the typeface is how you catch an error in a derivation without doing any arithmetic, and it is the single most useful habit this page can give you.

symbolmeaningfirst used
x⊤\mathbf{x}^\top, A⊤\mathbf{A}^\toptranspose: rows become columns2.2 Matrices
A−1\mathbf{A}^{-1}inverse of a matrix2.2 Matrices
⟨x,y⟩\langle\mathbf{x},\mathbf{y}\rangleinner product of x\mathbf{x} and y\mathbf{y}3.2 Inner Products
x⊤y\mathbf{x}^\top\mathbf{y}dot product of x\mathbf{x} and y\mathbf{y}2.2 Matrices
Im\mathbf{I}_midentity matrix, size m×mm\times m2.2 Matrices
0m,n\mathbf{0}_{m,n}matrix of zeros, size m×nm\times n2.2 Matrices
1m,n\mathbf{1}_{m,n}matrix of ones, size m×nm\times n2.2 Matrices
ei\mathbf{e}_istandard basis vector: 11 in component ii, zero elsewhere2.6 Basis and Rank
dim⁡\dimdimension of a vector space2.6 Basis and Rank
rk⁡(A)\operatorname{rk}(\mathbf{A})rank of A\mathbf{A}2.6 Basis and Rank
Im⁡(Φ)\operatorname{Im}(\Phi)image of a linear mapping Φ\Phi2.7 Linear Mappings
ker⁡(Φ)\ker(\Phi)kernel, or null space, of Φ\Phi2.7 Linear Mappings
span⁡[b1]\operatorname{span}[\mathbf{b}_1]span, the set of all multiples and combinations2.4 Vector Spaces
tr⁡(A)\operatorname{tr}(\mathbf{A})trace: the sum of the diagonal4.1 Determinant and Trace
det⁡(A)\det(\mathbf{A})determinant4.1 Determinant and Trace
EλE_\lambdaeigenspace for eigenvalue λ\lambda4.2 Eigenvalues and Eigenvectors

Two notes worth having in advance.

Why both ⟨⋅,⋅⟩\langle\cdot,\cdot\rangle and x⊤y\mathbf{x}^\top\mathbf{y}? The dot product is one inner product — the standard one. ⟨⋅,⋅⟩\langle\cdot,\cdot\rangle is the general notion, and Chapter 3 builds real geometry from any of them, including inner products on spaces of functions where there are no components to multiply pairwise. When the book writes angle brackets it is telling you the argument does not depend on the standard choice.

Why ei\mathbf{e}_i deserves its own symbol. Once you have it, the columns of a matrix are just Aei\mathbf{A}\mathbf{e}_i, and half of Chapter 2 becomes one sentence: a matrix is where the basis vectors go.

symbolmeaning
N\mathbb{N}natural numbers
Z\mathbb{Z}integers
R\mathbb{R}real numbers
C\mathbb{C}complex numbers
Rn\mathbb{R}^nthe nn-dimensional vector space of real column vectors
Rm×n\mathbb{R}^{m\times n}all real matrices with mm rows and nn columns

Rn\mathbb{R}^n is the single most common symbol in the book. Read it as “a list of nn real numbers, which we are treating as a point and as an arrow at the same time”.

C\mathbb{C} appears rarely, and always for one reason: a real matrix can have complex eigenvalues. A rotation is the standard example, and Complex Numbers in One Page covers exactly as much as you need.

symbolmeaning
∀x\forall xfor all xx
∃x\exists xthere exists an xx
a:=ba := baa is defined to be bb
a=:ba =: bbb is defined to be aa
a∝ba \propto baa is proportional to bb: a=const⋅ba = \text{const}\cdot b
g∘fg \circ ffunction composition: ”gg after ff”
⟺\Longleftrightarrowif and only if
⟹\Longrightarrowimplies
A\mathcal{A}, C\mathcal{C}sets
a∈Aa \in \mathcal{A}aa is an element of A\mathcal{A}
∅\emptysetthe empty set
symbolmeaning
DDnumber of dimensions, indexed d=1,…,Dd = 1,\dots,D
NNnumber of data points, indexed n=1,…,Nn = 1,\dots,N

This pairing is fixed throughout the book, and it is worth internalising because it disambiguates almost every summation you will meet: ∑n=1N\sum_{n=1}^{N} runs over examples, and ∑d=1D\sum_{d=1}^{D} runs over features. When you see a double sum, the outer index tells you what the quantity is per.

symbolmeaningfirst used
∂f∂x\frac{\partial f}{\partial x}partial derivative of ff with respect to xx5.2 Partial Differentiation
dfdx\frac{\mathrm{d}f}{\mathrm{d}x}total derivative of ff with respect to xx5.1 Differentiation
∇\nablagradient5.2 Partial Differentiation
θ\boldsymbol{\theta}parameter vector — the thing being learned8.1 Data, Models, Learning
L\mathfrak{L}Lagrangian7.2 Lagrange Multipliers
L\mathcal{L}negative log-likelihood8.3 Parameter Estimation
symbolmeaningfirst used
X∼pX \sim pthe random variable XX is distributed according to pp6.2 Discrete and Continuous
EX[x]\mathbb{E}_X[\mathbf{x}]expectation of x\mathbf{x} with respect to XX6.4 Summary Statistics
VX[x]\mathbb{V}_X[\mathbf{x}]variance of x\mathbf{x} with respect to XX6.4 Summary Statistics
Cov⁡X,Y[x,y]\operatorname{Cov}_{X,Y}[\mathbf{x},\mathbf{y}]covariance between x\mathbf{x} and y\mathbf{y}6.4 Summary Statistics
X⊥ ⁣ ⁣ ⁣⊥Y∣ZX \perp\!\!\!\perp Y \mid ZXX is conditionally independent of YY given ZZ6.4, 8.5 Graphical Models
(nk)\binom{n}{k}binomial coefficient, ”nn choose kk”6.2 Discrete and Continuous
N(μ,Σ)\mathcal{N}(\boldsymbol{\mu},\boldsymbol{\Sigma})Gaussian with mean μ\boldsymbol{\mu}, covariance Σ\boldsymbol{\Sigma}6.5 Gaussian Distribution
Ber(μ)\mathrm{Ber}(\mu)Bernoulli distribution with parameter μ\mu6.2 Discrete and Continuous
Bin(N,μ)\mathrm{Bin}(N,\mu)Binomial with parameters NN and μ\mu6.2 Discrete and Continuous
Beta(α,β)\mathrm{Beta}(\alpha,\beta)Beta distribution with parameters α\alpha, β\beta6.6 Conjugacy

The subscript on EX\mathbb{E}_X is not decoration. When a quantity depends on two random variables, EX[f(X,Y)]\mathbb{E}_X[f(X, Y)] averages over XX and leaves a function of YY; dropping the subscript makes the expression ambiguous. Every derivation in Chapters 8 to 11 leans on this.

acronymmeaning
i.i.d.independent, identically distributed
MLEmaximum likelihood estimation, or estimator
MAPmaximum a posteriori
ONBorthonormal basis
REFrow-echelon form
SPDsymmetric, positive definite
PCAprincipal component analysis
PPCAprobabilistic principal component analysis
GMMGaussian mixture model
SVMsupport vector machine
e.g.exempli gratia — for example
i.e.id est — that is

SPD is worth flagging early. “Symmetric positive definite” is a mouthful that turns up on almost every page from Chapter 3 onward, because it is precisely the condition for a matrix to define an inner product (§3.2), to have a Cholesky factorisation (§4.3), to be a valid covariance matrix (§6.4), and for a quadratic objective to be convex (§7.3). One property, five uses.

you seeit means
Definition 2.4a definition, numbered within its chapter
Theorem 4.15a claim with a proof
Example 3.5a worked instance
(3.41)equation 41 of Chapter 3
Remarka side comment, often the most useful paragraph on the page

Every page in this module ends with a From the book box citing these numbers, so you can read the page and the PDF side by side without hunting.

The convention is only worth memorising if you can run it. Drag the knobs to build a product out of two operands, and read off whether the typefaces you chose can legally be multiplied at all — before any numbers exist.

sketch Read the shape off the typeface p5.js
Pick a typeface for each operand and whether it is transposed. The sketch works out the shape of each operand from its typeface alone, checks the inner dimensions, and tells you whether the product is legal and what it returns. No arithmetic is involved anywhere.
figure The typeface convention is a shape checker you run in your head matplotlib
Two panels. Left, the three factors of x-transpose A x drawn as boxes with their shapes 1 by D, D by D and D by 1, chaining to 1 by 1, followed by a red box showing A x-transpose failing because D and 1 disagree. Right, a sixteen-row table of NumPy shape pairings showing the result shape of elementwise star and matrix at for each, with a note that star raised an error on zero of sixteen and at raised on six. Two panels. Left, the three factors of x-transpose A x drawn as boxes with their shapes 1 by D, D by D and D by 1, chaining to 1 by 1, followed by a red box showing A x-transpose failing because D and 1 disagree. Right, a sixteen-row table of NumPy shape pairings showing the result shape of elementwise star and matrix at for each, with a note that star raised an error on zero of sixteen and at raised on six.
Every intermediate shape in the product is fixed by the typeface before any arithmetic happens, so a malformed expression is visible on sight. NumPy will not do this for you: elementwise multiplication accepted all sixteen pairings, including turning a (3,) and a (3,1) into a (3,3).
figure One basis, three objects matplotlib
Three panels built from the same three two-dimensional vectors. Left, an ordered tuple with numbered positions. Middle, a two-by-three matrix of their entries with rank 2. Right, the three vectors as unlabelled points inside an ellipse denoting a set. Three panels built from the same three two-dimensional vectors. Left, an ordered tuple with numbered positions. Middle, a two-by-three matrix of their entries with rank 2. Right, the three vectors as unlabelled points inside an ellipse denoting a set.
A basis is a tuple when coordinates need a fixed order, a matrix when you want to multiply by it, and a set when only membership matters. Asking for the second element of the set is not a typo, it is a question the object cannot answer.
figure Six marks that mean more than one thing matplotlib
A ten-row table of overloaded notation. Each row gives the mark, one of its meanings, the contextual cue that identifies that meaning, and a worked example: single bars for absolute value, determinant and cardinality, double bars for a norm, the centred dot as multiplication and as a placeholder, the transpose superscript, the three typefaces of B, and italic uppercase as both a random variable and a count. A ten-row table of overloaded notation. Each row gives the mark, one of its meanings, the contextual cue that identifies that meaning, and a worked example: single bars for absolute value, determinant and cardinality, double bars for a norm, the centred dot as multiplication and as a placeholder, the transpose superscript, the three typefaces of B, and italic uppercase as both a random variable and a count.
In every case it is the type of the argument that settles the meaning, never the mark itself. Single bars around a scalar are absolute value, around a square matrix a determinant, around a set a cardinality.

The first figure is the convention doing work. Read the left panel left to right and notice that no numbers appear anywhere. x⊤\mathbf{x}^\top is lowercase bold and transposed, so it is 1×D1 \times D; A\mathbf{A} is uppercase bold, so it is D×DD \times D; x\mathbf{x} is D×1D \times 1. Each join has matching inner dimensions, the outer dimensions are 11 and 11, and therefore x⊤Ax\mathbf{x}^\top\mathbf{A}\mathbf{x} is a scalar. The red box below shows the same reading applied to Ax⊤\mathbf{A}\mathbf{x}^\top: (D×D)(1×D)(D \times D)(1 \times D), inner dimensions DD and 11, malformed. You did not need to know a single entry of either object to say that.

The right panel is the reason this is a habit worth having rather than a nicety. It runs all sixteen pairings of the shapes (3,), (3,1), (1,3) and (3,3) through both operators. @ refuses six of them, which is helpful. * refuses none. All sixteen returned an array. Twelve of those sixteen were between shapes that are not equal, and the worst case is the pairing highlighted in the caption: a (3,) times a (3,1) returns a (3,3) — an outer product where almost anyone writing that line meant an elementwise one. There is no exception, no warning, and the downstream code will happily consume a matrix where a vector belonged. The typeface convention is the check that catches this, because it fixes the intended shape at the point where you write the mathematics.

The second figure is the BB / B\boldsymbol{B} / B\mathcal{B} distinction made concrete. The same three vectors appear in all three panels. As a tuple they have positions, which is what makes “the coordinates of v\mathbf{v} with respect to BB” a well-defined phrase — permute the tuple and every coordinate vector changes. As a matrix they have a shape, here 2×32 \times 3 and measured rank 22, and you can multiply by it. As a set they have only membership: three elements, no first element, no order. The reason the book keeps all three rather than picking one is that each throws away exactly what the other two need to keep, and each of §2.6, §2.6.1 and §2.7 needs a different one.

The third figure is the lookup table for ambiguity, and it has one structural lesson. Scan the third column. Every disambiguating cue is a fact about the argument, not about the mark: single bars mean absolute value around a scalar, a determinant around a square matrix, a cardinality around a set. The centred dot is multiplication between two things and a placeholder when it stands alone. Italic uppercase is a random variable in Chapter 6 and a count when it bounds a sum. So the marks are not really ambiguous once you have read the typefaces — which is the argument for doing that first, and the reason this page puts the typeface table above everything else.

pch.quizTag Can you read the notation?
  1. You read an expression and see a bold lowercase letter multiplied by a bold uppercase letter. What is the result?

    pch.quizShowAnswer

    B — It depends on the order and the shapes, but bold lowercase is a vector and bold uppercase is a matrix — Bold lowercase is a vector, bold uppercase is a matrix. Whether the product is a vector or a scalar depends on the shapes and on which side the vector sits, and reading that off the typeface is exactly the habit the convention exists to give you.

  2. In a derivation you see a line beginning with a colon-equals rather than a plain equals sign. What does that tell you?

    pch.quizShowAnswer

    B — The line introduces a definition, so there is nothing to prove there — Colon-equals introduces a name. Plain equals asserts a fact you may have to justify. Scanning a derivation for plain equals signs shows you where the actual argument lives.

  3. The symbol lambda appears in Chapter 4 and again in Chapter 7. What has changed?

    pch.quizShowAnswer

    B — It is an eigenvalue in Chapter 4 and a Lagrange multiplier in Chapter 7 — The book's own symbol table lists lambda as eigenvalue or Lagrange multiplier. Chapter 10 then uses both at once when it derives PCA by maximising variance under a constraint, so knowing the overload exists matters.

  4. What does the subscript in an expectation such as E-sub-X tell you?

    pch.quizShowAnswer

    A — Which variable is being averaged over, leaving the others as free variables — It names the variable being integrated out. With two random variables in play, the expectation over one leaves a function of the other, and without the subscript the expression is ambiguous.

Exercise 1 – Read the shape, then check it

Section titled “Exercise 1 – Read the shape, then check it”

Exercise 4 – The trap the typeface exists to prevent

Section titled “Exercise 4 – The trap the typeface exists to prevent”

Exercise 5 – The N-by-D convention, and why it is a convention

Section titled “Exercise 5 – The N-by-D convention, and why it is a convention”
  • Typeface rule — lowercase italic is a scalar, lowercase bold a vector, uppercase bold a matrix, calligraphic a set, uppercase italic a count or a random variable.
  • := introduces a definition, = asserts a fact you may have to prove — which is how you find where a derivation’s real argument lives.
  • The three B’s are three different objects: a tuple of vectors, the matrix with those columns, and the unordered set.
  • The absolute-value bars mean determinant when the argument is a matrix — the double bars are the norm, Euclidean unless subscripted.
  • Lambda is an eigenvalue in Chapter 4 and a Lagrange multiplier in Chapter 7 — and PCA uses both meanings on one page.
  • N indexes data points and D indexes dimensions — so the outer index of a double sum tells you what the quantity is measured per.
  • SPD means symmetric positive definite — the condition for an inner product, a Cholesky factorisation, a valid covariance and a convex quadratic.

Next: the notation you will use most often, and the manipulations that go with it — Sums, Products, and Set Notation.

pch.coffeeTagline

pch.coffeeCta

pch.feedbackHeading

pch.feedbackSubheading