Your technical library
Mathematics
21 modules · 129 topics
About this book
Mathematics
This course teaches, from the ground up, the mathematics a working programmer needs for the library's mathematical courses: proof, functions and series, counting, calculus, linear algebra, probability, statistics, optimisation, sampling, information theory and the number theory behind cryptography. Nothing is assumed beyond school arithmetic and the ability to read code. It is the single home for general mathematics here: Machine Learning, Deep Learning and Reinforcement Learning teach none of their own, and link each tool they use to the topic that builds it. Each topic starts from a problem earlier topics could not solve, derives the idea step by step and works a numerical example.
Language and proof gives the vocabulary of sets, logic and proof. Functions, sequences and series and counting follow, then calculus — limits and derivatives and integrals and Taylor series — with numbers on a computer showing what floating point does to all of it. Linear algebra runs from vectors and matrices through linear systems and vector spaces, orthogonality and eigenvalues and matrix factorisations, and multivariable calculus joins calculus and linear algebra.
Probability, several random variables, limit theorems and concentration and Markov chains build up randomness. Optimality and convexity and optimisation algorithms find the best of many choices; statistical inference and sampling and Monte Carlo draw conclusions from data and from simulation; information theory measures information and surprise; and number theory and finite fields supplies the arithmetic behind cryptography and error-correcting codes. Where a full proof needs machinery beyond the course, the lesson gives the proof idea, the exact result and its assumptions.
129 topics across 21 modules, in dependency order.
Read the argument in each derivation card, work through the numerical examples, and answer the self-checks before revealing their solutions. Where a lesson gives an algorithm, it is in pseudocode or short Python you could implement from; a computation checks the instance it runs, never the general claim.
129 of 129 topics are authored. Unwritten lessons are labelled and excluded from progress. Glossary and decision-guide entries cover the authored material and grow with the course.
Read at your own pace. Each topic is one continuous page; mark it done as you finish.
Start with 01.1 · Sets and notation: naming collections preciselyReview what you have finished↷ 0 skipped topics- 01.1Sets and notation: naming collections precisely
- 01.2Statements and quantifiers: saying exactly what is claimed
- 01.3Proof: why a statement is true for every case
- 01.4Induction: proving infinitely many cases with two steps
- 01.5Sums and products: compact notation for indexed arithmetic
- 01.6Inequalities: reasoning about "at most"
- 02.1Functions: one output for each input
- 02.2Polynomials: the functions built from sums of powers
- 02.3Sine and cosine: coordinates of a point turning on a circle
- 02.4Complex numbers: extending the reals so every polynomial has roots
- 02.5Exponentials and logarithms: growth by factors and its inverse
- 02.6Sequences and their limits: what "eventually close" means
- 02.7Infinite series: when adding forever gives a number
- 04.1Limits of functions and continuity: approaching a point
- 04.2The derivative: the slope a curve has at a point
- 04.3Differentiation rules: sums, products, quotients, powers, exponentials
- 04.4The chain rule: differentiating a function of a function
- 04.5The mean value theorem: from local slopes to global behaviour
- 04.6L'Hôpital's rule: limits of 0/0 and ∞/∞, and growth rates
- 05.1The definite integral: accumulating a quantity from its rate
- 05.2The fundamental theorem: integration undoes differentiation
- 05.3Substitution: the chain rule run backwards
- 05.4Integration by parts: the product rule run backwards
- 05.5Improper integrals: integrating over infinite ranges
- 05.6Taylor series: a function as a polynomial around a point
- 05.7Euler's formula: rotation as an exponential
- 08.1Solving Ax = b: elimination and what it reveals
- 08.2Span: every output a set of vectors can reach
- 08.3Linear independence: no redundant directions
- 08.4Basis and dimension: coordinates for a space
- 08.5Rank and null space: what a matrix keeps and what it destroys
- 08.6The inverse: undoing a transformation
- 08.7Determinants: signed volume scaling
- 08.8Change of basis: the same map in different coordinates
- 10.1Eigenvectors and eigenvalues: the directions a matrix only stretches
- 10.2The spectral theorem: symmetric matrices have orthonormal eigenbases
- 10.3The trace: the sum of the diagonal and of the eigenvalues
- 10.4Quadratic forms: the geometry of xᵀAx
- 10.5Positive (semi-)definite matrices: forms that never go negative
- 10.6The SVD: every matrix is rotate, stretch, rotate
- 10.7Matrix norms and the condition number: how errors are amplified
- 10.8Low-rank approximation: keeping the largest singular values
- 11.1Functions of several variables: surfaces, level sets and limits
- 11.2Partial derivatives and the gradient: the direction of steepest ascent
- 11.3The Jacobian: the derivative of a vector function is a matrix
- 11.4The multivariable chain rule: Jacobians multiply
- 11.5The Hessian: second derivatives as a symmetric matrix
- 11.6Multivariable Taylor expansion: a local quadratic model
- 11.7Matrix calculus: gradients of vector and matrix expressions
- 11.8Multiple integrals: accumulating over regions
- 11.9Change of variables: the Jacobian determinant rescales volume
- 11.10Ordinary differential equations: evolving a state by its rate of change
- 12.1Events and probability: the axioms and their consequences
- 12.2Conditional probability and Bayes' rule: updating on evidence
- 12.3Independence: when one event carries no information about another
- 12.4Random variables: turning outcomes into numbers
- 12.5Expectation and variance: centre and spread
- 12.6Discrete distributions: Bernoulli, binomial, geometric, Poisson, categorical
- 12.7Sampling without replacement: the hypergeometric distribution
- 12.8Continuous distributions: uniform, exponential, gamma, beta, Laplace
- 12.9The Gaussian distribution: the bell curve and standardisation
- 13.1Joint, marginal and conditional distributions
- 13.2Covariance and correlation: how two variables move together
- 13.3Conditional expectation: the best prediction given information
- 13.4Transforming random variables: how densities change
- 13.5The multivariate Gaussian: a bell in many dimensions
- 13.6Gaussian conditioning and marginals: the Schur complement
- 14.1Markov's and Chebyshev's inequalities: tail bounds from moments
- 14.2The law of large numbers: why averages settle down
- 14.3Moment generating functions: a distribution packed into one function
- 14.4The central limit theorem: why sums look Gaussian
- 14.5Concentration inequalities: exponential tails for averages
- 14.6How many samples? Chebyshev, CLT and Hoeffding compared
- 16.1Critical points: necessary and sufficient conditions for a minimum
- 16.2Convex sets: regions containing every segment between their points
- 16.3Convex functions: why local minima are global
- 16.4Subgradients: optimality where a convex function has a corner
- 16.5Jensen's inequality: convex functions of averages
- 16.6Lagrange multipliers: optimising on a constraint surface
- 16.7The KKT conditions: inequality constraints
- 16.8Lagrangian duality: bounding a minimum from below
- 17.1Gradient descent: stepping downhill on a local model
- 17.2Conditioning: why gradient descent zigzags
- 17.3Newton's method: minimising the local quadratic model
- 17.4Stochastic gradient descent: descending on noisy gradients
- 17.5Coordinate and block descent: minimising one group of variables at a time
- 17.6Stochastic approximation: solving an equation from noisy evaluations
- 17.7Choosing an optimisation method: cost per step against steps needed
- 18.1Estimators: judging a recipe by its errors
- 18.2Maximum likelihood: parameters that make the data least surprising
- 18.3Exponential families: one form for Bernoulli, Gaussian, Poisson and more
- 18.4Fisher information: how sharply the data pin down a parameter
- 18.5Bayesian inference: parameters as random variables
- 18.6MAP estimation: the posterior's peak as a penalised likelihood
- 18.7Confidence intervals: an error bar with a coverage guarantee
- 18.8Hypothesis tests: how surprising is the data under no effect
- 18.9Multiple comparisons: why testing many things finds false effects
- 19.1Generating samples: from uniform bits to any distribution
- 19.2Monte Carlo estimation: integrals as sample averages
- 19.3Importance sampling: averaging under a different distribution
- 19.4Gradients of expectations: score-function and reparameterisation estimators
- 19.5The bootstrap: sampling distributions by resampling the data
- 19.6Markov chain Monte Carlo: sampling a target known only up to a constant
- 19.7Langevin sampling: gradient steps plus noise that sample a distribution
- 21.1Divisibility and primes: the multiplicative atoms of the integers
- 21.2Greatest common divisors and Bézout's identity
- 21.3Modular arithmetic: computing with remainders
- 21.4Groups: the algebra of one invertible operation
- 21.5Fermat's and Euler's theorems: exponents modulo n
- 21.6Finite fields: arithmetic with pⁿ elements
01.2Statements and quantifiers: saying exactly what is claimed
01.3Proof: why a statement is true for every case
01.4Induction: proving infinitely many cases with two steps
01.5Sums and products: compact notation for indexed arithmetic
01.6Inequalities: reasoning about "at most"
02.1Functions: one output for each input
02.2Polynomials: the functions built from sums of powers
02.3Sine and cosine: coordinates of a point turning on a circle
02.4Complex numbers: extending the reals so every polynomial has roots
02.5Exponentials and logarithms: growth by factors and its inverse
02.6Sequences and their limits: what "eventually close" means
02.7Infinite series: when adding forever gives a number
03.1Counting: how many arrangements without listing them
03.2The binomial theorem: coefficients of a repeated product
03.3Inclusion–exclusion: counting overlapping sets
04.1Limits of functions and continuity: approaching a point
04.2The derivative: the slope a curve has at a point
04.3Differentiation rules: sums, products, quotients, powers, exponentials
04.4The chain rule: differentiating a function of a function
04.5The mean value theorem: from local slopes to global behaviour
04.6L'Hôpital's rule: limits of 0/0 and ∞/∞, and growth rates
05.1The definite integral: accumulating a quantity from its rate
05.2The fundamental theorem: integration undoes differentiation
05.3Substitution: the chain rule run backwards
05.4Integration by parts: the product rule run backwards
05.5Improper integrals: integrating over infinite ranges
05.6Taylor series: a function as a polynomial around a point
05.7Euler's formula: rotation as an exponential
06.1Floating point: which real numbers a computer can hold
06.2Numerical stability: log-sum-exp, cancellation and underflow
07.1Vectors and the dot product: lists of numbers with geometry
07.2Norms: measuring the size of a vector
07.3Matrices as linear maps: transformations, not tables
07.4Matrix multiplication: composing transformations
07.5The transpose: moving a matrix across a dot product
08.1Solving Ax = b: elimination and what it reveals
08.2Span: every output a set of vectors can reach
08.3Linear independence: no redundant directions
08.4Basis and dimension: coordinates for a space
08.5Rank and null space: what a matrix keeps and what it destroys
08.6The inverse: undoing a transformation
08.7Determinants: signed volume scaling
08.8Change of basis: the same map in different coordinates
09.1Orthogonal projection: the closest point in a subspace
09.2Orthonormal bases: coordinates by dot products alone
09.3Least squares: the best solution to an unsolvable system
10.1Eigenvectors and eigenvalues: the directions a matrix only stretches
10.2The spectral theorem: symmetric matrices have orthonormal eigenbases
10.3The trace: the sum of the diagonal and of the eigenvalues
10.4Quadratic forms: the geometry of xᵀAx
10.5Positive (semi-)definite matrices: forms that never go negative
10.6The SVD: every matrix is rotate, stretch, rotate
10.7Matrix norms and the condition number: how errors are amplified
10.8Low-rank approximation: keeping the largest singular values
11.1Functions of several variables: surfaces, level sets and limits
11.2Partial derivatives and the gradient: the direction of steepest ascent
11.3The Jacobian: the derivative of a vector function is a matrix
11.4The multivariable chain rule: Jacobians multiply
11.5The Hessian: second derivatives as a symmetric matrix
11.6Multivariable Taylor expansion: a local quadratic model
11.7Matrix calculus: gradients of vector and matrix expressions
11.8Multiple integrals: accumulating over regions
11.9Change of variables: the Jacobian determinant rescales volume
11.10Ordinary differential equations: evolving a state by its rate of change
12.1Events and probability: the axioms and their consequences
12.2Conditional probability and Bayes' rule: updating on evidence
12.3Independence: when one event carries no information about another
12.4Random variables: turning outcomes into numbers
12.5Expectation and variance: centre and spread
12.6Discrete distributions: Bernoulli, binomial, geometric, Poisson, categorical
12.7Sampling without replacement: the hypergeometric distribution
12.8Continuous distributions: uniform, exponential, gamma, beta, Laplace
12.9The Gaussian distribution: the bell curve and standardisation
13.1Joint, marginal and conditional distributions
13.2Covariance and correlation: how two variables move together
13.3Conditional expectation: the best prediction given information
13.4Transforming random variables: how densities change
13.5The multivariate Gaussian: a bell in many dimensions
13.6Gaussian conditioning and marginals: the Schur complement
14.1Markov's and Chebyshev's inequalities: tail bounds from moments
14.2The law of large numbers: why averages settle down
14.3Moment generating functions: a distribution packed into one function
14.4The central limit theorem: why sums look Gaussian
14.5Concentration inequalities: exponential tails for averages
14.6How many samples? Chebyshev, CLT and Hoeffding compared
15.1Markov chains: when the present state is all that matters
15.2Stationary distributions: where a Markov chain settles
16.1Critical points: necessary and sufficient conditions for a minimum
16.2Convex sets: regions containing every segment between their points
16.3Convex functions: why local minima are global
16.4Subgradients: optimality where a convex function has a corner
16.5Jensen's inequality: convex functions of averages
16.6Lagrange multipliers: optimising on a constraint surface
16.7The KKT conditions: inequality constraints
16.8Lagrangian duality: bounding a minimum from below
17.1Gradient descent: stepping downhill on a local model
17.2Conditioning: why gradient descent zigzags
17.3Newton's method: minimising the local quadratic model
17.4Stochastic gradient descent: descending on noisy gradients
17.5Coordinate and block descent: minimising one group of variables at a time
17.6Stochastic approximation: solving an equation from noisy evaluations
17.7Choosing an optimisation method: cost per step against steps needed
18.1Estimators: judging a recipe by its errors
18.2Maximum likelihood: parameters that make the data least surprising
18.3Exponential families: one form for Bernoulli, Gaussian, Poisson and more
18.4Fisher information: how sharply the data pin down a parameter
18.5Bayesian inference: parameters as random variables
18.6MAP estimation: the posterior's peak as a penalised likelihood
18.7Confidence intervals: an error bar with a coverage guarantee
18.8Hypothesis tests: how surprising is the data under no effect
18.9Multiple comparisons: why testing many things finds false effects
19.1Generating samples: from uniform bits to any distribution
19.2Monte Carlo estimation: integrals as sample averages
19.3Importance sampling: averaging under a different distribution
19.4Gradients of expectations: score-function and reparameterisation estimators
19.5The bootstrap: sampling distributions by resampling the data
19.6Markov chain Monte Carlo: sampling a target known only up to a constant
19.7Langevin sampling: gradient steps plus noise that sample a distribution
20.1Entropy: the expected surprise of a distribution
20.2Joint and conditional entropy: uncertainty that remains
20.3KL divergence and cross-entropy: the cost of using the wrong distribution
20.4Mutual information: how much one variable tells about another
21.1Divisibility and primes: the multiplicative atoms of the integers
21.2Greatest common divisors and Bézout's identity
21.3Modular arithmetic: computing with remainders
21.4Groups: the algebra of one invertible operation
21.5Fermat's and Euler's theorems: exponents modulo n
21.6Finite fields: arithmetic with pⁿ elements
Skipped topics
Moved past without finishing. A skipped topic still closes its module, and Continue goes on without it — open one to read it or mark it understood.
Glossary
Definitions from the authored lessons, grouped by subject and linked to their explanations.
Set
A collection determined by distinct membership.
More detail
Ordering and repetition do not change a set. Use a tuple when positions matter, or a list when repetition and sequence matter.
Membership
Whether an object belongs to a set.
More detail
An element and a singleton containing it are different objects. Membership is not the same relation as being a subset.
Subset
A set whose every element belongs to another set.
More detail
The subset relation permits equality; a proper subset excludes equality. The empty set is a subset of every set.
Universe and complement
A complement contains the objects outside a set within a stated universe.
More detail
Changing the universe can change the complement even when the original set stays fixed. Negated selection rules must identify their population.
Union and intersection
Union selects either membership; intersection requires both.
More detail
Mathematical either includes both. De Morgan’s laws exchange the two operations when taking complements.
Set difference
Elements of the first set that are absent from the second.
More detail
Difference is directional. A minus B and B minus A generally select different elements.
Cardinality
The number of distinct elements in a finite set.
More detail
The bars around a set count elements, not the size of the values inside it. The empty set has cardinality zero; a set containing the empty set has cardinality one.
Interval
A consecutive region of the real number line.
More detail
Square brackets include endpoints; parentheses exclude them. Intersect with the integers when only whole-number values are allowed.
Cartesian product
All ordered pairs with one coordinate from each of two sets.
More detail
For finite sets the cardinalities multiply. Restrictions coupling the choices define a subset of the product and can reduce the count.
Tuple
A fixed-length ordered collection of coordinates.
More detail
Corresponding coordinates must agree for two tuples to be equal. A pair (1,2) differs from (2,1), unlike sets containing those numbers.
Proposition and predicate
A proposition has a truth value; a predicate needs its free inputs bound.
More detail
Specify the domain of a predicate. Quantifying its inputs turns a statement template into a claim about a population.
Implication
A conditional that excludes a true premise with a false conclusion.
More detail
It is true when its premise is false. This is a statement about permitted truth assignments, not a claim of causation.
Converse and contrapositive
Two ways of reversing a conditional, only one automatically equivalent.
More detail
The converse reverses premise and conclusion. The contrapositive also negates both. Proving the converse does not establish the original implication.
Logical equivalence
Agreement of truth values under every assignment.
More detail
Coincidental truth of two claims is insufficient. A truth table exhausts a finite Boolean domain and can establish an equivalence.
Quantifier
A declaration of whether a claim covers every element or at least one.
More detail
The domain and nesting order are part of the claim. A later existential witness may depend on earlier universal choices.
Witness
An in-domain object establishing an existential claim.
More detail
Existence does not imply uniqueness. Verify both domain membership and the claimed property.
Vacuous truth
Truth of a conditional with a false premise, or a universal over an empty domain.
More detail
There is no premise-satisfying violation. An existential over the empty domain is false because it has no witness.
Proof
A finite argument deriving a conclusion from explicit assumptions and established facts.
More detail
Match the obligation to the claim’s logical form. Arithmetic transformations need their conditions, such as nonzero divisors.
Direct proof
Derive the conclusion from the premise and definitions.
More detail
Represent arbitrary objects using their defining properties, then identify why the derived form establishes the conclusion.
Proof by contradiction
Rule out the negation of the desired claim by deriving an impossibility.
More detail
For a conditional, assume both its premise and the negation of its conclusion. A surprising result is not necessarily a contradiction.
Proof by cases
Establish the result on alternatives that cover the whole domain.
More detail
Cases may overlap, but no permitted input may be omitted. Positive and negative cases alone omit zero.
Counterexample
One permitted input that makes a universal claim fail.
More detail
A conditional counterexample must satisfy the premise and fail the conclusion. Finite successful tests cannot replace an all-input argument.
Prime and composite
A prime integer exceeds one and has only one and itself as positive divisors.
More detail
A composite integer exceeds one and has a factorisation into two smaller factors greater than one. One is neither prime nor composite.
Well-ordering
Every nonempty subset of the natural numbers has a least element.
More detail
The least-failure argument derives induction from this foundational property. Positive reals do not have this property.
Mathematical induction
A base and a universally valid successor step prove all eligible finite indices.
More detail
The induction hypothesis is temporary while proving an implication. Check the smallest index for which the successor step is claimed.
Strong induction
An induction step that may use every earlier case.
More detail
Equivalent to ordinary induction applied to the proposition that an entire prefix holds. Especially useful when an object splits into smaller pieces.
Recursive definition
Values specified by base values and dependencies on earlier values.
More detail
Supply enough base values to determine every later case. A recursive definition supplies objects; induction proves properties of them.
Loop invariant
A property preserved at a specified point of each iteration.
More detail
Initialisation and preservation correspond to induction. Termination needs a separate argument that the loop reaches its stopping condition.
Dummy index
A locally bound name selecting terms of a sum or product.
More detail
Rename every bound occurrence together. Reindexing that changes values also changes endpoints and the summand.
Empty sum and empty product
Zero for addition over no terms; one for multiplication over no factors.
More detail
These identity values make splitting and appending rules continue to work at length zero.
Linearity of sums
Finite addition allows fixed coefficients to be factored out.
More detail
Coefficients must not depend on the summation index. A constant added inside the sum appears once per term.
Reindexing
Changing index descriptions while visiting exactly the same terms.
More detail
Use a one-to-one correspondence, translate bounds, and substitute in each summand. For nested sums, reconstruct dependent bounds from the index region.
Telescoping sum
Cancellation of interior terms leaves boundary terms.
More detail
Consecutive differences sum to final value minus initial value. Establish the exact algebraic cancellation before applying it to rounded computations.
Arithmetic progression
Terms separated by a fixed additive increment.
More detail
Pairing a finite progression with its reverse derives its total. The formula requires a constant increment and a specified term count.
Geometric progression
Terms related by a fixed multiplicative ratio.
More detail
A finite total follows by multiplying and subtracting shifted terms. Ratio one has its own branch; infinite totals require convergence theory.
Absolute value
The nonnegative magnitude of a real number.
More detail
Absolute difference measures distance with the same physical unit as the original quantities. A signed bound alone is not a two-sided tolerance.
Triangle inequality
The magnitude of a sum is no greater than the sum of magnitudes.
More detail
Opposite signs can cancel; equal signs can attain the bound. Repeated application controls finite sums without probability assumptions.
Error budget
A bound on total error assembled from per-term guarantees.
More detail
Adding absolute-error bounds protects against every permitted sign combination. Observing cancellation in one run does not tighten that guarantee.
Function
A set of pairs giving each domain element exactly one codomain output.
More detail
Domain and codomain are part of the function, not just the rule. The image may sit strictly inside the declared codomain.
Composition
The map g∘f applying f first and g to its outputs.
More detail
Defined only when f’s codomain is g’s domain. Associative always, commutative almost never.
Injective and surjective
No two inputs share an output; every codomain element is attained.
More detail
Both properties depend on the declared sets, not only the rule. On finite same-size sets they stand or fall together; on infinite sets they need not.
Inverse function
A map composing back to the identity in both directions.
More detail
An inverse exists exactly for bijections, and composites invert in reverse order. The superscript is not a reciprocal.
Monotone function
A function that preserves — or throughout reverses — the order of its inputs.
More detail
Strict monotonicity implies injectivity, a sufficient but not necessary test. A strictly monotone map inverts onto its image.
Polynomial and degree
A sum of powers of the input with fixed coefficients; the highest power present.
More detail
Degrees add under multiplication and stay under the maximum under addition. The zero polynomial has no degree.
Root of a polynomial
An input where the polynomial evaluates to zero.
More detail
By the factor theorem a root a is exactly a factor x−a, so a nonzero degree-n polynomial has at most n roots.
Polynomial division with remainder
Writing p = qd + r with deg r smaller than deg d, uniquely.
More detail
Long division terminates because the degree strictly decreases. The remainder at x−a is the value p(a).
Radian
The angle whose arc on a circle has length equal to the radius.
More detail
Angle is arc divided by radius, so it is a ratio of lengths. Calculus formulas assume radians, not degrees.
Sinusoid
A shifted, scaled sine A sin(2πft + φ) with amplitude, frequency and phase.
More detail
The period is 1/f. Phase shifts the waveform in time; amplitude scales the peaks.
Complex number
A pair a + bi of reals multiplied by the rule that forces i² = −1.
More detail
Multiplication rotates and scales in the complex plane. Every polynomial over the reals splits over the complex numbers.
Conjugate and modulus
z̄ reflects across the real axis; |z| is the distance from the origin.
More detail
The product z·z̄ = |z|² is real, which is what makes division by a complex number possible.
Fundamental theorem of algebra
Every nonconstant polynomial has a complex root.
More detail
Stated, not proved, at this level; repeated factoring then gives exactly n roots counted with multiplicity.
Exponential function
The map x ↦ bˣ for a positive base, extended from integers through rationals to reals.
More detail
Real exponents are filled in by continuity, not defined by a new counting rule. The laws bˣ⁺ʸ = bˣbʸ and (bˣ)ʸ = bˣʸ survive the extension.
Logarithm
The inverse of bˣ: log_b y is the exponent that produces y.
More detail
Needs b > 0 and b ≠ 1. Change of base makes every logarithm proportional to every other; base 2 counts bits and doublings.
Order of magnitude
One factor of ten on a logarithmic scale.
More detail
On a log axis equal ratios are equal distances, so a doubling anywhere is the same step. Check the axis before comparing bar lengths.
Power law
A relationship y = cxᵏ, a straight line on log–log axes.
More detail
The slope reads the exponent and the intercept reads log c. Curvature on a log–log plot is itself evidence of another mechanism.
Sequence
A function on the natural numbers: an ordered, indexed list of values.
More detail
Positions and repetition matter, unlike a set. Convergence is a property of the tail, so finitely many edits change nothing.
Limit of a sequence
The value every tail stays arbitrarily close to.
More detail
The ε–N contract: for every positive tolerance, some index threshold leaves all later terms within it. Checking a finite window is evidence, not proof.
Monotone convergence
A monotone bounded sequence converges, by completeness of the reals.
More detail
The limit is the supremum of the terms. This proves convergence before the limit is identified — the route taken by Heron's iteration.
The number e
The limit of (1 + 1/n)ⁿ, the continuous-compounding factor.
More detail
Approximately 2.718281828, irrational. It is the base whose exponential and logarithm have the simplest slopes in calculus.
Series and partial sums
An infinite sum defined as the limit of its finite running totals.
More detail
A series converges or diverges exactly as its sequence of partial sums does. Terms tending to zero is necessary but not sufficient.
Geometric series
The infinite sum of a fixed-ratio progression, convergent exactly when |r| < 1.
More detail
The value is 1/(1−r) for a start of 1. Discounted rewards and retry backoffs are geometric series in disguise.
Harmonic series
The divergent sum of reciprocals 1 + 1/2 + 1/3 + …
More detail
Grouping into blocks each contributing at least a half proves divergence. It grows without bound, but only logarithmically fast.
Convergence tests
Comparison, ratio and related tests that decide convergence without the limit.
More detail
Comparison bounds against a known series; the ratio test inspects successive-term ratios. Each test has cases where it is silent.
Absolute convergence
Convergence of the series of absolute values, which implies ordinary convergence.
More detail
Absolutely convergent series may be rearranged safely; conditionally convergent ones can be reordered to reach any limit.
Sum and product rules
Disjoint cases add; independent stages multiply.
More detail
The product rule needs each stage's options not to depend on earlier choices; the sum rule needs disjointness. Most counting errors are one of these assumed without checking.
Permutation
An ordering of distinct objects: n! of them.
More detail
Choosing k of n in order gives n!/(n−k)! arrangements. Order matters means positions are distinct.
Combination
An unordered k-subset of n objects: n choose k.
More detail
Derived by dividing ordered arrangements by the k! orderings of each subset — the division rule removes systematic overcounting.
Bijective counting
Count a hard set by matching it one-to-one with an easy set.
More detail
Stars and bars counts multisets by matching selections with binary strings. The bijection must be total in both directions.
Multiset and stars and bars
Selecting with repetition: choose k of n kinds with repeats allowed.
More detail
The count is the number of binary strings with k stars and n−1 bars. Identical items with distinct boxes is the dual picture.
Stirling's approximation
n! ≈ √(2πn)(n/e)ⁿ, accurate within a per cent by n ≈ 10.
More detail
Stated and checked numerically, not derived, at this level. It is how astronomically large counts are estimated and compared.
Pascal's rule
Each binomial coefficient is the sum of the two above it.
More detail
The distinguished-element split makes it a theorem, not a pattern. It builds a whole row by addition alone — no factorials needed.
Binomial theorem
(x+y)ⁿ expands with the position-choosing counts as coefficients.
More detail
Specialising the identity produces counting facts: all-ones gives 2ⁿ, a minus gives the equal even/odd split. The theorem also feeds the binomial distribution later.
Inclusion–exclusion
The size of a union is the alternating sum of intersection sizes.
More detail
Each element is counted exactly once because the alternating sum of subsets containing it telescopes to one. Truncating the sum alternates over- and under-estimates.
Union bound
The size of a union never exceeds the sum of the sizes.
More detail
The first truncation of inclusion–exclusion. Crude but always true, which is why it bounds failure chances under arbitrary overlap.
Derangement
A permutation in which no element keeps its place.
More detail
The count follows from inclusion–exclusion and approaches n!/e. It is the canonical case of the alternating sum doing real work.
ε–δ limit
f(x) → L as x → a: every tolerance on the output is met by a punctured tolerance on the input.
More detail
The quantifier order is the contract: ε is challenged first, δ is the response. Equivalent to convergence along every sequence approaching a.
Continuity
The function's value at a point equals its limit there — no jump, no hole.
More detail
Compositions and arithmetic combinations of continuous functions stay continuous. Continuity is what makes bisection and limit interchange legal.
Intermediate and extreme value theorems
On a closed interval a continuous function takes every intermediate value and attains its bounds.
More detail
IVT brackets roots (a sign change forces a crossing); EVT guarantees a maximiser exists — both stated with proof ideas at this level.
Derivative
The limit of difference quotients: the slope the curve has at one point.
More detail
Equivalently the coefficient of the best linear approximation f(x+h) = f(x) + f′(x)h + o(h). Differentiability implies continuity, not conversely.
Tangent line
The unique linear approximation whose error vanishes faster than h.
More detail
Predicting a function near a point by its tangent is the workhorse behind linearisation, Newton steps and gradient descent.
Product, quotient and inverse rules
Derivatives of combined functions from the definition, once each.
More detail
(fg)′ = f′g + fg′; the quotient rule follows from product + reciprocal. The inverse rule (f⁻¹)′ = 1/f′ yields (ln x)′ = 1/x.
Chain rule
A composite's derivative is the product of the stages' derivatives.
More detail
Composing the linear approximations proves it — the proof must handle inner increments of zero. Values flow forwards; correction factors flow backwards.
Mean value theorem
Some interior point has slope equal to the interval's average slope.
More detail
Fermat → Rolle → MVT is the proof chain. Its corollaries — positive slope means increasing, |f′| ≤ L bounds change — convert local derivatives into global facts.
Lipschitz bound
|f(x) − f(y)| ≤ L|x − y| when |f′| ≤ L.
More detail
The MVT turns a derivative bound into a bound on how far outputs can separate — the seed of every smoothness and stability claim later.
Indeterminate form and L'Hôpital's rule
For 0/0 or ∞/∞, the limit of f/g equals the limit of f′/g′ when the latter exists.
More detail
Derived from Cauchy's mean value theorem. It orders growth rates — logarithmic < polynomial < exponential — and evaluates expressions like x ln x that drive entropy formulas.
Definite integral
The limit of Riemann sums: total quantity accumulated from a rate over an interval.
More detail
A continuum has no index set — the sum exists only after a partition supplies one. Linear, additive over intervals, monotone in the integrand.
Average value
∫f over [a,b] divided by b−a: the constant delivering the same total.
More detail
For continuous f it is attained somewhere inside — the mean value theorem for integrals, which is the bridge in the FTC proof.
Fundamental theorem of calculus
Accumulation and rate are inverse operations: the area function differentiates back to f, and ∫f = F(b)−F(a).
More detail
Part 1 makes every continuous f the derivative of its own integral; part 2 turns most evaluation into finding one antiderivative.
Antiderivative
A function whose derivative is the integrand, determined up to a constant.
More detail
The '+C' family is exactly what 'two antiderivatives differ by a constant' buys — an MVT corollary. Indefinite integrals name the whole family.
Substitution rule
The chain rule run backwards: rename the inner variable and stretch by its derivative.
More detail
Limits transform too: ∫f(g(t))g′dt over [a,b] equals ∫f over [g(a),g(b)]. The |g′| factor is the local axis stretch — the 1-D seed of change of variables.
Integration by parts
∫u dv = uv − ∫v du: the product rule run backwards.
More detail
Choose u by what simplifies on differentiating. Repeated application gives the reduction Iₙ = nIₙ₋₁ behind ∫xⁿe⁻ˣ = n!.
Improper integral
An integral over an unbounded range or past a blow-up, defined as a limit of proper integrals.
More detail
∫₁^∞ x⁻ᵖ converges iff p > 1; comparison and the integral test tie it to series. One-sided limits — symmetric pairing is a separate, stronger claim.
Taylor polynomial and remainder
The degree-n polynomial matching n+1 derivatives, plus one unknown evaluation pricing the gap.
More detail
Matching forces coefficients f⁽ᵏ⁾(x)/k!; the Lagrange remainder f⁽ⁿ⁺¹⁾(ξ)hⁿ⁺¹/(n+1)! is proved by a telescoping auxiliary function through Cauchy's MVT.
Radius of convergence
The |h| threshold inside which a power series converges absolutely — a property of the coefficients.
More detail
R = 1/lim|cₖ₊₁/cₖ| by the ratio test. Convergence of the series and equality to f are separate facts; smooth but non-analytic functions exist.
Euler's formula
e^{iθ} = cos θ + i sin θ: the exponential of an imaginary angle is a unit-circle point.
More detail
Series substitution motivates it as the unique extension consistent with exp law; then e^{i(α+β)} = e^{iα}e^{iβ} recovers the angle-sum identities.
Floating-point number
A representable real (−1)^s·m·2^e stored as a sign, a mantissa and an exponent.
More detail
Representable numbers are finite and unevenly spaced — the gap doubles at each power of two — so most reals are rounded to a neighbour rather than stored.
IEEE 754 binary64
The double format: one sign bit, 52 mantissa bits, 11 exponent bits.
More detail
binary32 halves the storage at a range and precision cost; bfloat16 keeps the exponent width and cuts the mantissa, trading precision for range.
Machine epsilon
The gap from 1 to the next representable number, 2⁻⁵² in binary64.
More detail
It bounds the relative error of one rounded operation, not of a whole computation; accumulated error and conditioning are separate questions.
Round to nearest
Store the closest representable value: fl(x∘y) = (x∘y)(1+δ) with |δ| ≤ ε.
More detail
The standard model is relative and per-operation, with ties breaking to even; it justifies first-order error analysis but says nothing about error compounding.
Subnormal number
A number below the smallest normal exponent, encoded with a leading zero.
More detail
Subnormals make underflow gradual — precision drains as the exponent bottoms out — instead of flushing abruptly to zero.
Infinity and NaN
Overflow produces ±∞; undefined operations produce NaN.
More detail
NaN propagates through arithmetic and compares unequal to everything, including itself, so x ≠ x is the portable test for it.
Relative condition number
κ_f(x) = |xf′(x)/f(x)|: output sensitivity per unit of input change.
More detail
A property of the problem, not the algorithm; a stable formula inherits it but cannot beat it.
Catastrophic cancellation
Subtracting nearly equal numbers erases their accurate leading digits.
More detail
Small relative errors in the operands become a large relative error in the difference; rearranging the formula, not extra precision, is the fix.
Log-space computation
Carrying log probabilities so that products become sums.
More detail
A thousand factors of 0.01 underflow to zero while their log sum stays finite; likelihoods are handled in log space for this reason.
Log-sum-exp trick
log Σe^{aᵢ} = m + log Σe^{aᵢ−m} with m = max aᵢ.
More detail
Shifting by the largest term caps the biggest exponential at one, removing overflow; softmax and normalising constants are computed this way.
log1p and expm1
Accurate evaluations of log(1+x) and eˣ−1 near x = 0.
More detail
The naive forms cancel catastrophically for tiny x; these library functions evaluate the Taylor series directly instead.
Vector
An element of ℝⁿ: an ordered list of coordinates added and scaled componentwise.
More detail
A data row and a geometric displacement are the same object; positions matter, unlike in a set.
Dot product
x·y = Σxᵢyᵢ algebraically; ‖x‖‖y‖cos θ geometrically.
More detail
The two readings agree via the law of cosines; the scalar projection of x on a unit u is x·u, so the dot product measures alignment rather than magnitude.
Cauchy–Schwarz inequality
|x·y| ≤ ‖x‖‖y‖ for all vectors.
More detail
Proved from the nonnegative quadratic ‖x−ty‖² ≥ 0 in t; equality holds exactly for parallel vectors, which licenses cosine as a similarity.
Orthogonal vectors
Vectors with zero dot product — perpendicularity defined algebraically.
More detail
Works in any dimension where no picture exists; nonzero orthogonal vectors are automatically linearly independent.
Cosine similarity
x·y/(‖x‖‖y‖): the cosine of the angle, lying in [−1,1] by Cauchy–Schwarz.
More detail
Magnitude-free, so proportional vectors of different lengths score one; it is the default similarity for feature vectors.
Norm
A length function: nonnegative, definite, homogeneous, and satisfying the triangle inequality.
More detail
The axioms capture what every notion of vector size shares; norms on ℝⁿ differ by at most dimension factors, ‖x‖∞ ≤ ‖x‖₂ ≤ ‖x‖₁ ≤ √n‖x‖₂.
L₁, L₂ and L∞ norms
Sum of |xᵢ|, Euclidean length, and largest |xᵢ|.
More detail
L₂ is smooth and rotation-invariant; L₁ weighs small entries relatively more and promotes sparsity; L∞ sees only the worst coordinate.
Linear map
A function satisfying T(ax+by) = aT(x) + bT(y).
More detail
Determined entirely by the images of the basis vectors, which is why a finite grid of numbers can store it.
Matrix of a linear map
The grid whose columns are where the basis vectors land.
More detail
Ax reads two ways: a combination of the columns with weights x, or dot products of x with the rows; both pictures are used constantly.
Matrix multiplication
(AB)_{ij} = ΣₖA_{ik}B_{kj}, forced by the requirement (AB)x = A(Bx).
More detail
The rule is derived from composing maps, not chosen; column by column, AB applies A to each column of B.
Non-commutativity
AB ≠ BA in general: applying B then A differs from A then B.
More detail
Associativity A(BC) = (AB)C always holds — bracketing is free, ordering is not, as a rotation–shear pair shows.
Outer product
xyᵀ: an m×n matrix of rank one built from two vectors.
More detail
As a map it sends v to x(y·v); rank-one pieces of this shape are the terms the SVD decomposes a matrix into.
Transpose
Aᵀ swaps indices: (Aᵀ)_{ij} = A_{ji}.
More detail
Its defining identity is (Ax)·y = x·(Aᵀy) — the transpose moves a matrix across the dot product; it reverses products, (AB)ᵀ = BᵀAᵀ.
Symmetric matrix
A matrix with Aᵀ = A.
More detail
Covariance matrices, Hessians and AᵀA all qualify; the spectral theorem later converts the property into real eigenvalues and an orthonormal eigenbasis.
Gram matrix
AᵀA: the matrix of pairwise dot products of the columns of A.
More detail
Symmetric and positive semidefinite since xᵀAᵀAx = ‖Ax‖² ≥ 0; it is the matrix the normal equations solve.
Augmented matrix
[A | b]: the coefficients with the right-hand side appended as a column.
More detail
Row operations act on whole equations; the appended column carries b through the same transformations without writing the variables.
Elementary row operations
Swap two rows, scale a row, or add a multiple of one row to another.
More detail
Each preserves the solution set and equals left multiplication by an elementary matrix, so elimination is secretly a factorisation.
Row echelon form
Staircase form: each row's first nonzero entry lands right of the one above.
More detail
Pivot columns hold the determined variables while free columns parameterise the rest; a row reading 0 = c signals inconsistency.
Linear combination
Σcᵢvᵢ: a weighted sum of vectors.
More detail
Ax = b asks whether b is a combination of the columns of A; the unknowns are the coefficients.
Span
span{v₁,…,v_k}: every vector reachable as a combination.
More detail
Always a subspace, and the smallest one containing the set; membership tests reduce to solving a system.
Subspace
A subset closed under addition and scaling.
More detail
It must contain the origin; the column space and null space are the working examples behind every existence and uniqueness statement.
Column space
C(A): the span of the columns — the outputs A can reach.
More detail
Ax = b is solvable exactly when b ∈ C(A); its dimension is the rank.
Linear independence
Σcᵢvᵢ = 0 forces every cᵢ = 0: no redundant directions.
More detail
Equivalently Ax = 0 has only the zero solution, so representations are unique; more than n vectors in ℝⁿ are always dependent.
Basis
An independent spanning set: minimal to span, maximal to be independent.
More detail
Gives every vector of the space unique coordinates; the exchange lemma proves all bases of a space share one size.
Dimension
The common size of every basis of a space.
More detail
dim ℝⁿ = n; a plane through the origin is two-dimensional wherever it sits inside a larger space.
Coordinates relative to a basis
[v]_B: the unique coefficients writing v as a combination of B.
More detail
The same vector has different coordinate lists in different bases; converting between them is change of basis.
Rank
rank A = dim C(A): the number of independent columns, equal to the pivot count.
More detail
Row rank equals column rank — a theorem, not a definition; rank(AB) ≤ min(rank A, rank B) since composing can only destroy directions.
Null space
N(A) = {x : Ax = 0}: the inputs the map sends to zero.
More detail
The general solution of Ax = b is one particular solution plus all of the null space; a trivial null space means uniqueness.
Rank–nullity theorem
rank A + dim N(A) = n.
More detail
Every input direction is either kept or destroyed and the count balances exactly; it is why a wide matrix cannot have a trivial null space.
Matrix inverse
A⁻¹ with AA⁻¹ = A⁻¹A = I: the transformation run backwards.
More detail
Exists exactly when the rank is full, the null space trivial and the determinant nonzero; Gauss–Jordan on [A | I] computes it, but solving Ax = b directly is cheaper and stabler than forming it.
Invertible matrix theorem
The equivalence of full rank, trivial null space, nonzero determinant and unique solvability.
More detail
One property among many equivalent tests — a matrix failing one fails them all; inverses of products reverse order, (AB)⁻¹ = B⁻¹A⁻¹.
Determinant
det A: the signed volume the map gives the unit cube.
More detail
Fixed uniquely by multilinearity, alternation and det I = 1; cofactor expansion and the product of pivots are consequences, not definitions.
Product rule for determinants
det(AB) = det A · det B.
More detail
Composing maps multiplies volume scaling; it yields det A⁻¹ = 1/det A and det(P⁻¹AP) = det A — the determinant belongs to the map, not the coordinates.
Change-of-coordinates matrix
P with the new basis as columns, so v = P[v]_B.
More detail
Coordinates are basis-dependent while the vector is not; P translates the description, it does not move the object.
Similar matrices
B = P⁻¹AP: one linear map written in two bases.
More detail
Similar matrices share rank, determinant, trace and eigenvalues — the quantities belonging to the map itself rather than to a coordinate choice.
Orthogonal complement
S⊥: every vector orthogonal to all of S.
More detail
Always a subspace; the pairings N(A) = C(Aᵀ)⊥ and C(A)⊥ = N(Aᵀ) organise the four fundamental subspaces into two orthogonal decompositions.
Projection onto a line
p = (aᵀb/aᵀa)a: the nearest multiple of a to b.
More detail
Minimising distance and enforcing b−p ⊥ a are the same computation; every later projection is this argument done on a subspace.
Projection matrix
P = A(AᵀA)⁻¹Aᵀ sends b to its closest point in C(A).
More detail
Idempotent (P² = P) and symmetric; the residual b − Pb is orthogonal to the space by construction, giving the Pythagorean split ‖b‖² = ‖p‖² + ‖b−p‖².
Orthonormal basis
A basis of mutually orthogonal unit vectors.
More detail
Coordinates come free as cᵢ = qᵢᵀv — no system to solve, because each basis vector already accounts for one direction.
Orthogonal matrix
A square matrix with orthonormal columns: QᵀQ = I.
More detail
So Q⁻¹ = Qᵀ and ‖Qx‖ = ‖x‖ — it preserves lengths and angles; rotations and reflections are the examples, with determinant ±1.
Gram–Schmidt
Build an orthonormal basis by subtracting each vector's projections onto the earlier ones.
More detail
v − Σ(qᵢᵀv)qᵢ removes the accounted components before normalising; numerically the modified ordering is the stable variant.
QR factorisation
A = QR: orthonormal Q times upper-triangular R.
More detail
Gram–Schmidt repackaged; R's triangularity records that each column was projected onto the span of its predecessors, and it replaces the normal equations in stable least squares.
Least squares problem
minₓ‖Ax−b‖²: the closest reachable output when the system has no solution.
More detail
The minimiser's residual is orthogonal to the column space — geometry supplies the equation before calculus does; the fitted values Ax̂ are the projection of b.
Normal equations
AᵀAx̂ = Aᵀb: the orthogonality condition as a square system.
More detail
Unique when the columns are independent; analytically tidy but numerically it squares the condition number, which is why QR is the practical route.
Eigenvector and eigenvalue
Ax = λx: a direction the map only scales.
More detail
Repeated application is trivial in the eigenbasis — that is the entire point; eigenspaces, the null spaces of A−λI, group an eigenvalue's directions.
Characteristic polynomial
det(A−λI): the degree-n polynomial whose roots are the eigenvalues.
More detail
Roots may be complex or repeated; a shear has a repeated eigenvalue with too few eigenvectors — the non-diagonalisable case.
Diagonalisation
A = VΛV⁻¹ when n independent eigenvectors exist.
More detail
Powers collapse to Aᵏ = VΛᵏV⁻¹ and det A = Πλᵢ; distinct eigenvalues give independent eigenvectors, which is the typical case.
Spectral theorem
Every symmetric matrix has an orthonormal eigenbasis: A = QΛQᵀ = Σλᵢqᵢqᵢᵀ.
More detail
Real eigenvalues and orthogonal eigenvectors remove both failure modes of general matrices; the rank-one sum reading is the seed of low-rank approximation.
Rayleigh quotient
xᵀAx/xᵀx: the scaling a direction receives.
More detail
Maximised over unit vectors by the top eigenvector at λ_max; it is how eigenvalues get re-read as the answer to an optimisation.
Trace
tr A: the diagonal sum, equal to the sum of the eigenvalues.
More detail
Cyclic — tr(AB) = tr(BA) — hence similarity-invariant; xᵀAx = tr(Axxᵀ) turns quadratic forms into traces, the move matrix calculus repeats.
Quadratic form
xᵀAx: a homogeneous degree-two function of the coordinates.
More detail
Only the symmetric part (A+Aᵀ)/2 matters; in the eigenbasis it reads Σλᵢyᵢ², so the eigenvalue signs classify its level sets as ellipses, hyperbolas or saddles.
Positive definite
xᵀAx > 0 for all x ≠ 0, equivalently all λᵢ > 0.
More detail
Equivalent tests include positive pivots and positive leading minors; it guarantees a strict minimum of the quadratic form and the existence of a Cholesky factorisation.
Positive semidefinite
xᵀAx ≥ 0: the boundary case allowing flat directions.
More detail
Covariance and kernel matrices must be PSD; Gram matrices BᵀB qualify automatically, and congruences CᵀAC preserve the property.
Cholesky factorisation
A = LLᵀ for positive definite A: a triangular square root.
More detail
Turns a symmetric solve into two triangular solves at half the cost, and generates correlated Gaussians as μ + Lz from independent noise.
Loewner order
A ⪰ B means A−B is positive semidefinite.
More detail
A partial order — two symmetric matrices can be incomparable; curvature bounds like ∇²f ⪰ mI are written in it.
Singular value decomposition
A = UΣVᵀ: every matrix is rotate, stretch, rotate.
More detail
Derived from the spectral theorem on AᵀA; σᵢ = √λᵢ(AᵀA) with Avᵢ = σᵢuᵢ, and U and V supply orthonormal bases for all four fundamental subspaces.
Singular values
σ₁ ≥ σ₂ ≥ … ≥ 0: the stretches along the singular directions.
More detail
The expansion A = Σσᵢuᵢvᵢᵀ orders the matrix's content by importance and the count of nonzero σᵢ is the rank; decay of the σᵢ is what makes low-rank summaries possible.
Pseudoinverse
A⁺ = VΣ⁺Uᵀ: invert the nonzero σᵢ and zero the rest.
More detail
Returns the minimum-norm least-squares solution even for rank-deficient systems — what a numerical solve quietly computes when no unique answer exists.
Induced matrix norm
‖A‖ = max_{x≠0} ‖Ax‖/‖x‖: the largest stretch the map applies.
More detail
Equals σ_max in the 2-norm and is submultiplicative, ‖AB‖ ≤ ‖A‖‖B‖; the Frobenius norm √(Σaᵢⱼ²) instead measures total energy.
Condition number
κ(A) = ‖A‖‖A⁻¹‖ = σ_max/σ_min: the worst error amplification of Ax = b.
More detail
‖δx‖/‖x‖ ≤ κ(A)·‖δb‖/‖b‖ — roughly log₁₀κ digits are lost; since κ(AᵀA) = κ(A)² the normal equations are twice as ill-conditioned as the problem.
Best rank-k approximation
A_k = Σ_{i≤k}σᵢuᵢvᵢᵀ: the SVD truncated after k terms.
More detail
Eckart–Young proves it optimal with error ‖A−A_k‖₂ = σ_{k+1}; the kept share Σ_{i≤k}σᵢ²/Σσᵢ² is the energy fraction that picks k.
Scalar and vector fields
f:ℝⁿ→ℝ returns a number; F:ℝⁿ→ℝᵐ returns a vector.
More detail
A loss is the first, a layer map the second; the graph of a scalar field is a surface one dimension above its domain.
Level set
{x : f(x) = c}: the contour where f takes one value.
More detail
Contours of a quadratic form are ellipses or hyperbolas; gradients turn out perpendicular to them.
Limits along paths
lim_{x→a} f(x) exists only when every approach path agrees.
More detail
xy/(x²+y²) takes different limits along different lines, so checking the axes proves nothing; norms replace absolute value in the definition.
Partial derivative
∂f/∂xᵢ: differentiate with every other variable frozen.
More detail
A coordinatewise rate only; having every partial is weaker than differentiability, which demands the whole linear approximation.
Differentiability in ℝⁿ
f(x+h) = f(x) + ∇fᵀh + o(‖h‖): a linear model with error vanishing faster than the step.
More detail
This, not the existence of partials, is the property later rules are proved from; a function can have all partials and still fail it.
Gradient
∇f: the vector of partials, pointing along the steepest ascent.
More detail
Cauchy–Schwarz makes u = ∇f/‖∇f‖ the maximiser of the directional derivative; ∇f is orthogonal to the level set through the point.
Directional derivative
D_u f = ∇f·u: the rate of change along a unit direction.
More detail
One dot product answers every direction question; the partials are the special cases along the axes.
Jacobian
J_{ij} = ∂Fᵢ/∂xⱼ: the matrix that is a vector function's derivative.
More detail
F(x+h) ≈ F(x) + J(x)h; rows are gradients of outputs, columns sensitivities to inputs — a linear map's Jacobian is the matrix itself.
Multivariable chain rule
J_{f∘g} = J_f·J_g: Jacobians multiply.
More detail
Composing the linear approximations proves it; for scalar output ∇ₓ(f∘g) = J_gᵀ∇_y f, and the order the product is evaluated in is the cost question of automatic differentiation.
Hessian
H_{ij} = ∂²f/∂xᵢ∂xⱼ: second derivatives as a matrix.
More detail
Symmetric by Clairaut's theorem for smooth f, and equal to the Jacobian of the gradient; uᵀHu is the curvature along u and its eigenvalues are the principal curvatures.
Multivariable Taylor expansion
f(x+h) ≈ f(x) + ∇fᵀh + ½hᵀHh: a local quadratic model.
More detail
Derived by restricting to the line through h and applying the one-variable theorem; the bound f ≤ f(x) + ∇fᵀh + (L/2)‖h‖² when ‖∇²f‖ ≤ L is what a gradient step minimises.
Layout convention
Numerator versus denominator layout: whether ∂(vector)/∂(vector) lists partials by rows or by columns.
More detail
The two conventions transpose every answer; the course fixes denominator layout, under which ∇ₓaᵀx = a and ∇ₓxᵀAx = (A+Aᵀ)x.
Differential method
Write df = tr(A·dX) to read off ∇_X f = Aᵀ.
More detail
Differentials track the first-order perturbation directly and survive where componentwise bookkeeping collapses; ∇_A log det A = A⁻ᵀ falls out of eigenvalue perturbation.
Double integral
∬_R f dA: the limit of Riemann sums over a partition of a region.
More detail
Accumulates a density over area rather than length; a joint probability mass is exactly this object.
Fubini's theorem
∬f dA = ∫(∫f dy)dx = ∫(∫f dx)dy for integrable f.
More detail
Iterated integration is the computable form; on non-rectangular regions the order fixes the bounds, and swapping can turn an impossible integral into an easy one.
Change of variables
∫_{T(D)} f(y)dy = ∫_D f(T(x))|det J_T|dx.
More detail
The Jacobian determinant is the local volume scale, generalising the one-variable |g′| factor; polar coordinates contribute the extra r, and squaring the Gaussian integral into a polar one evaluates ∫e^{−x²/2}dx = √2π.
Matrix exponential
e^{At} = Ve^{Λt}V⁻¹ for diagonalisable A: the solution operator of ḣ = Ah.
More detail
The scalar ẏ = ay gives y = e^{at}y₀; eigenvalues with negative real part decay, positive diverge, imaginary oscillate — the spectrum is the stability certificate of the flow.
Forward Euler
h_{k+1} = h_k + Δf(h_k): follow the tangent line for one step.
More detail
Stable only while |1+λΔ| < 1, so a stiff eigenvalue caps the step; global error is O(Δ) versus O(Δ⁴) for classical Runge–Kutta.
Zero-order hold
The exact discrete step of a linear system with the input held between samples.
More detail
Ā = e^{AΔ} and B̄ = A⁻¹(e^{AΔ}−I)B discretise ḣ = Ah + Bx exactly — the form controllers and samplers actually implement.
Sample space and event
Ω is every outcome; an event is a subset of it.
More detail
Set algebra — unions, intersections, complements — becomes event algebra; continuous outcome sets need measure-theoretic care, named but not taught.
Kolmogorov axioms
P ≥ 0, P(Ω) = 1, and countable additivity over disjoint events.
More detail
Complements, monotonicity, inclusion–exclusion and the union bound are theorems from these; the axioms deliberately assume nothing about equally likely outcomes.
Conditional probability
P(A|B) = P(A∩B)/P(B): renormalising to the observed event.
More detail
B becomes the new sample space; conditioning is a different probability measure, not a filtered count of the old one.
Law of total probability
P(A) = ΣᵢP(A|Bᵢ)P(Bᵢ) over a partition.
More detail
Splits a hard probability into cases; the Bᵢ must partition — overlapping or incomplete cases silently corrupt the total.
Bayes' rule
P(H|D) = P(D|H)P(H)/P(D): inverting the conditioning.
More detail
Prior, likelihood and posterior are the named parts; a 95%-sensitive test on a 1%-prevalence condition still yields a posterior near 16% — the base rate is part of the answer.
Independence of events
P(A∩B) = P(A)P(B): one event's occurrence changes nothing.
More detail
Pairwise independence is weaker than mutual — three events can satisfy every pair and fail the triple; the product form, not intuition, is the checkable definition.
Conditional independence
P(A∩B|C) = P(A|C)P(B|C): independence given information.
More detail
Can hold conditionally but not marginally, or the reverse; it is the assumption behind factorised feature models.
Random variable
A function X : Ω → ℝ attaching numbers to outcomes.
More detail
The distribution is the induced law on values, not the map itself; different mechanisms can induce the same distribution.
Cumulative distribution function
F_X(x) = P(X ≤ x): accumulated probability.
More detail
Always defined, nondecreasing and right-continuous; discrete jumps and continuous slopes both live inside this one object.
PMF and density
p_X(x) = P(X = x) for discrete X; f_X = F_X′ for continuous.
More detail
A density is not a probability and may exceed 1 — probabilities are its integrals, and P(X = x) = 0 at every point.
Expectation
E[X] = Σxp(x) or ∫xf(x)dx: the probability-weighted centre.
More detail
Defined only when the weighting converges absolutely — the Cauchy distribution has no mean at all.
Law of the unconscious statistician
E[g(X)] = Σg(x)p(x): average g without finding its distribution.
More detail
The distribution of g(X) is never needed; every variance, moment and Monte Carlo estimate uses this form.
Linearity of expectation
E[aX + bY] = aE[X] + bE[Y], no independence required.
More detail
Holds through arbitrary dependence — the strongest of the easy rules, and the reason indicator decompositions count complicated events without untangling them.
Variance
Var(X) = E[(X−E[X])²] = E[X²] − E[X]²: expected squared deviation.
More detail
Scales quadratically, Var(aX+b) = a²Var(X); the standard deviation √Var returns to the original units.
Indicator variable
A 0/1 variable recording whether an event occurs.
More detail
P(A) = E[1_A] converts probabilities to expectations; expected counts become sums of easy indicators, as in counting a permutation's fixed points.
Bernoulli distribution
One trial: P(X=1) = p, mean p, variance p(1−p).
More detail
The atom of discrete probability; indicators, coin flips and single classification outcomes are all Bernoulli.
Binomial distribution
Bin(n,p): successes in n independent trials, P(X=k) = C(n,k)pᵏ(1−p)^{n−k}.
More detail
Mean np by linearity of expectation; the PMF sums to one by the binomial theorem — where counting meets probability.
Geometric distribution
Trials until the first success: P(X=k) = (1−p)^{k−1}p.
More detail
Mean 1/p from a series computation; it is the discrete waiting-time law.
Poisson distribution
P(X=k) = e^{−λ}λᵏ/k!: the limit of Bin(n, λ/n) as n grows.
More detail
The model for rare events in a large population; mean and variance both equal λ.
Categorical distribution
One draw from K outcomes with probabilities π₁,…,π_K.
More detail
The many-label generalisation of Bernoulli; its one-hot encoding is the vector form classifiers emit.
Memoryless property
P(X > s+t | X > s) = P(X > t): elapsed waiting buys nothing.
More detail
Characterises the geometric among discrete distributions and the exponential among continuous ones; it is what makes Markov models tractable.
Uniform distribution
Constant density 1/(b−a) on [a,b].
More detail
Probability is proportional to interval length; pseudo-random generators emit it and every other distribution is built from it.
Exponential distribution
Exp(λ): density λe^{−λx}, the continuous memoryless waiting time.
More detail
Mean 1/λ by integration by parts; the continuous counterpart of the geometric and the summand of the gamma family.
Gamma distribution
The sum of k independent Exp(λ) waits; Γ(k) = (k−1)! normalises it.
More detail
A flexible family on the positive reals; the gamma function's defining integral is integration by parts applied repeatedly.
Beta distribution
A density on [0,1] with shape parameters α and β.
More detail
Mean α/(α+β); the natural prior for an unknown probability because Bernoulli data just increments the parameters.
Laplace distribution
A two-sided exponential centred at μ.
More detail
Heavier tails than the Gaussian at equal variance; as a prior its log-density contributes an L1 penalty.
Gaussian distribution
𝒩(μ,σ²): density proportional to e^{−(x−μ)²/2σ²}, normalised by √(2π).
More detail
Closed under affine maps — aX+b stays Gaussian; the tails decay like e^{−t²/2}, faster than any exponential.
Standardisation
Z = (X−μ)/σ: converting any Gaussian to 𝒩(0,1).
More detail
Tables and software give probabilities only for the standard normal Φ; the 68–95–99.7 rule reads mass off it.
Joint distribution
p(x,y) or f(x,y): the probability law of several variables at once.
More detail
The whole story of how the variables relate; marginals, conditionals and independence are all derived from it.
Marginal distribution
p_X(x) = Σ_y p(x,y): one variable's law extracted from the joint.
More detail
Sum or integrate the other variables out; the name survives from the margin of a printed joint table.
Conditional distribution
f_{Y|X}(y|x) = f(x,y)/f_X(x): the law of Y given X = x.
More detail
A renormalised slice of the joint; Bayes' rule for densities, f(θ|x) ∝ f(x|θ)f(θ), is the same move with a parameter.
Independence of random variables
f(x,y) = f_X(x)f_Y(y): the joint factorises.
More detail
Implies zero covariance but not conversely; the factorisation is the checkable definition, not the intuition.
Covariance
Cov(X,Y) = E[XY] − E[X]E[Y]: expected product of centred deviations.
More detail
Bilinear and symmetric; positive when the variables tend to sit on the same side of their means, and zero under independence.
Correlation
ρ = Cov(X,Y)/(σ_Xσ_Y): covariance standardised to [−1,1].
More detail
Cauchy–Schwarz gives the bound, attained exactly when one variable is affine in the other; zero correlation does not imply independence — X and X² are uncorrelated for symmetric X.
Variance of a sum
Var(ΣXᵢ) = ΣVar(Xᵢ) + 2Σ_{i<j}Cov(Xᵢ,Xⱼ).
More detail
Independence kills the cross terms, giving Var(X̄ₙ) = σ²/n — the identity the law of large numbers spends.
Covariance matrix
Σ = E[(X−μ)(X−μ)ᵀ]: all pairwise covariances at once.
More detail
Always PSD, since aᵀΣa = Var(aᵀX) ≥ 0; transforms as Cov(AX) = AΣAᵀ, the rule behind Gaussian affine closure.
Conditional expectation
E[Y|X]: the random variable giving the best guess of Y from X.
More detail
A function of X rather than a number, minimising mean squared error among all predictors of that form; functions of X pull out, E[g(X)Y|X] = g(X)E[Y|X].
Law of total expectation
E[E[Y|X]] = E[Y]: averaging the conditional guesses returns the mean.
More detail
The tower property; it turns an average into a case analysis and runs through every variance argument.
Law of total variance
Var(Y) = E[Var(Y|X)] + Var(E[Y|X]).
More detail
Splits spread into unexplained and explained parts — the decomposition behind variance-attribution arguments.
CDF method
Compute F_Y(y) = P(g(X) ≤ y), then differentiate.
More detail
The reliable route when g is not monotone; inverting the event into a statement about X is where the work sits.
Change-of-density formula
f_Y(y) = f_X(g⁻¹(y))·|(g⁻¹)′(y)|.
More detail
The derivative factor is the local stretch — a density is probability per unit length and g rescales length; in ℝⁿ the Jacobian determinant takes over.
Multivariate Gaussian
𝒩(μ,Σ): built as X = μ + AZ with Σ = AAᵀ.
More detail
Contours are ellipsoids along Σ's eigenvectors; affine maps preserve the family, and for jointly Gaussian variables uncorrelated does imply independence — unlike in general.
Mahalanobis distance
√((x−μ)ᵀΣ⁻¹(x−μ)): distance scaled by covariance.
More detail
Half its square is the density's exponent; it is Euclidean distance in coordinates whitened by Σ^{-1/2}.
Gaussian conditioning
x_a|x_b is Gaussian with mean μ_a + Σ_abΣ_bb⁻¹(x_b−μ_b).
More detail
The conditional mean is a linear regression on the observed block and the covariance shrinks — observing is information, computed not asserted.
Schur complement
Σ_aa − Σ_abΣ_bb⁻¹Σ_ba: the residual covariance after observing a block.
More detail
Appears both in the conditional law and in block inversion of Σ; it is variance explained away, in matrix form.
Markov's inequality
P(X ≥ a) ≤ E[X]/a for nonnegative X.
More detail
Proved by comparing X with the indicator a·1_{X≥a}; weak but assumption-free, and the parent of every stronger tail bound.
Chebyshev's inequality
P(|X−μ| ≥ kσ) ≤ 1/k²: a two-sided deviation bound.
More detail
Markov applied to (X−μ)²; distribution-free, so tight in the worst case and loose for named distributions.
Law of large numbers
X̄ₙ → μ: the sample mean settles on the expectation.
More detail
The weak law follows from Var(X̄ₙ) = σ²/n via Chebyshev — convergence in probability; the strong law's almost-sure convergence is stated, and the Cauchy counterexample shows the finite-mean hypothesis is load-bearing.
Moment generating function
M_X(t) = E[e^{tX}]: a distribution packed into one function.
More detail
M^{(k)}(0) = E[Xᵏ] by differentiating the series, and M_{X+Y} = M_XM_Y under independence — convolutions become products; existing near zero is itself a tail condition, and the Gaussian MGF e^{μt+σ²t²/2} falls out by completing the square.
Central limit theorem
√n(X̄ₙ−μ)/σ ⇒ 𝒩(0,1) for i.i.d. variables with finite variance.
More detail
The MGF's second-order expansion is the proof idea; it gives the shape of the error — with a continuity correction for lattice distributions — but no finite-sample bound, which is what Berry–Esseen prices.
Chernoff method
P(X ≥ a) ≤ min_t e^{−ta}M_X(t): Markov applied to e^{tX}.
More detail
Exponentiating tilts weight toward the tail and t is then optimised; any MGF becomes an exponential tail bound this way.
Hoeffding's inequality
P(|X̄ₙ−μ| ≥ t) ≤ 2exp(−2nt²/(b−a)²) for variables bounded in [a,b].
More detail
Needs boundedness alone — no variance knowledge; its lemma bounds e^{sx} by the chord on [a,b].
Sub-Gaussian variable
A variable whose MGF is dominated by a Gaussian's.
More detail
The property Hoeffding-style bounds actually use; bounded variables qualify, and the class is closed under independent sums.
Union bound over many estimates
Bounding K simultaneous deviations costs only ln K in the exponent.
More detail
Concentration plus a union bound covers many hypotheses at once — the price of breadth is logarithmic, not linear.
Sample size bound
n ≥ (b−a)²/(2t²)·ln(2/δ): solve the tail bound for n.
More detail
Chebyshev, CLT and Hoeffding give different answers under different assumptions — finite variance, asymptotic normality, boundedness; the honest choice matches what is actually known.
Markov property
The next state depends on the present alone, not the history.
More detail
A modelling assumption with computational payoff — the whole state is summarised by one probability vector.
Transition matrix
P with P_{ij} = P(X_{t+1}=j|X_t=i), rows summing to one.
More detail
n-step probabilities are matrix powers, (Pᵗ)_{ij} — the Chapman–Kolmogorov equations; state distributions update as π_{t+1} = π_tP.
Communicating classes and recurrence
States partition by mutual reachability; a recurrent state is returned to with probability one, a transient one eventually left for good.
More detail
Periodicity — returns locked to multiples of d > 1 — is the remaining obstruction to convergence; the class structure decides which behaviours persist.
First-step analysis
Condition on the first transition to get linear equations for hitting probabilities.
More detail
Gambler's ruin and expected hitting times reduce to solving systems; it is the recursion behind every Markov-chain calculation.
Stationary distribution
π = πP: a distribution the dynamics leave fixed.
More detail
A left eigenvector with eigenvalue 1; it exists for every finite chain and is unique when the chain is irreducible.
Detailed balance
πᵢP_{ij} = π_jP_{ji}: pairwise flow equality.
More detail
Sufficient for stationarity and stronger — it forbids circulation; checking it is the design recipe behind Metropolis–Hastings.
Ergodic theorem
(1/T)Σf(X_t) → Σπᵢf(i): time averages converge to space averages.
More detail
The law of large numbers for dependent samples; it licenses estimating expectations from a single long chain.
Mixing time
How long until π_t is close to π.
More detail
For reversible chains the second eigenvalue |λ₂| sets the geometric decay of convergence; burn-in is the wait it prices.
First-order necessary condition
∇f(x*) = 0 at a differentiable local minimum.
More detail
Necessary, not sufficient — maxima and saddles satisfy it too; it filters candidates rather than certifying them.
Second-order conditions
∇²f(x*) ⪰ 0 is necessary, ≻ 0 sufficient, for a local minimum.
More detail
Positive Hessian eigenvalues mean upward curvature in every direction; a zero eigenvalue leaves the test silent, as x⁴ versus x³ shows.
Saddle point
A critical point with curvature of both signs.
More detail
A minimum along some directions and a maximum along others; in high dimension saddles outnumber minima and are what descent slows around.
Local versus global minimum
Lowest in a neighbourhood versus lowest overall.
More detail
Algorithms certify the first; only extra structure — convexity — promotes local to global.
Convex set
A region containing every segment between its points.
More detail
Intersections, affine images, half-spaces and norm balls are convex; convex combinations Σθᵢxᵢ with θ ≥ 0, Σθ = 1 generate the convex hull, and the PSD matrices form a convex cone.
Separating hyperplane
A plane strictly dividing two disjoint convex sets.
More detail
Stated geometrically at this level; it is the engine behind duality and the existence of subgradients.
Convex function
f(θx+(1−θ)y) ≤ θf(x)+(1−θ)f(y): chords lie above the graph.
More detail
Equivalently the epigraph is a convex set; nonnegative sums, affine composition and pointwise maxima all preserve convexity.
First-order convexity condition
f(y) ≥ f(x) + ∇f(x)ᵀ(y−x): the function lies above its tangents.
More detail
One inequality turns ∇f = 0 into a global guarantee — the tangent is a lower bound everywhere, not just nearby.
Strong convexity
∇²f ⪰ mI for some m > 0: curvature bounded below.
More detail
Upgrades the qualitative guarantee to a rate; the ratio L/m is the condition number that descent's geometric bound spends.
Local minima of convex functions
Every local minimum of a convex function is global.
More detail
The theorem deciding whether a found minimum can be trusted; strict convexity adds uniqueness on top.
Subgradient
g with f(y) ≥ f(x) + gᵀ(y−x): a supporting slope at a kink.
More detail
The subdifferential ∂f(x) is the set of them — ∂|x|(0) = [−1,1]; the optimality condition becomes 0 ∈ ∂f(x*).
Soft-thresholding
argmin ½(x−a)² + λ|x| = sign(a)·max(|a|−λ, 0).
More detail
The subdifferential condition produces it in three cases; it is the atomic step inside L1-penalised methods.
Jensen's inequality
f(E[X]) ≤ E[f(X)] for convex f.
More detail
One tangent line at E[X] proves it; E[log X] ≤ log E[X] and AM ≥ GM are the corollaries that keep paying off.
Lagrange multiplier
λ in ∇f = λ∇g: the gradient balance at a constrained optimum.
More detail
At the optimum ∇f is perpendicular to the constraint surface, hence parallel to ∇g; λ also reads as the sensitivity of the optimal value to the constraint level.
Lagrangian
ℒ(x,λ) = f(x) − λᵀg(x): objective and constraint in one function.
More detail
Its unconstrained stationary points are the constrained candidates; maximising xᵀAx subject to ‖x‖ = 1 lands on the top eigenvector.
KKT conditions
Stationarity, primal and dual feasibility, and complementary slackness.
More detail
μᵢ ≥ 0 with μᵢhᵢ = 0 encodes bind-or-slack per inequality; under a constraint qualification like Slater's they are necessary, and for convex problems sufficient.
Complementary slackness
μᵢhᵢ(x) = 0: a constraint either binds or its multiplier vanishes.
More detail
Identifies which constraints matter at the optimum; solving the cases is how small KKT problems are done by hand.
Lagrange dual function
g(λ,μ) = infₓ ℒ(x,λ,μ): the best lower bound per multiplier.
More detail
Always concave — an infimum of affine functions — so the dual problem is convex whatever the primal is.
Weak and strong duality
d* ≤ p* always; equality holds under Slater's condition for convex problems.
More detail
The gap p*−d* certifies how far a feasible point sits from optimal; strong duality is what makes solving the dual a route to the primal.
Gradient descent
x_{k+1} = x_k − η∇f(x_k): stepping against the local slope.
More detail
Derived as minimising the quadratic upper bound rather than adopted as a heuristic; the step of maximal guaranteed progress is η = 1/L.
L-smoothness
‖∇²f‖ ≤ L: a quadratic upper bound on the function.
More detail
Yields the descent lemma f(x−η∇f) ≤ f − η(1−Lη/2)‖∇f‖²; steps beyond 2/L diverge even on a quadratic.
Convergence rates of descent
O(1/k) for convex f; geometric (1−m/L)ᵏ under m-strong convexity.
More detail
Rates convert curvature assumptions into iteration counts; the condition number L/m decides how geometric the geometric rate is.
Zigzagging
Gradient descent bouncing across a narrow valley.
More detail
In the Hessian's eigenbasis the error in coordinate i multiplies by 1−ηλᵢ per step; the steepest direction caps η while the flattest crawls.
Conditioning and rate
Convergence factor (κ−1)/(κ+1) on quadratics.
More detail
The optimal step is 2/(λ_max+λ_min); at κ = 10⁴, six digits of accuracy costs tens of thousands of iterations — the motivation for curvature-aware methods.
Preconditioning
Rescaling variables to shrink κ.
More detail
Even a diagonal reparameterisation removes most zigzag; momentum, stated rather than proved, improves the dependence to √κ.
Newton's method
x_{k+1} = x_k − [∇²f]⁻¹∇f: minimise the local quadratic model.
More detail
Solves a quadratic exactly in one step and is affine-invariant — rescaling coordinates changes nothing; the per-step cost is a linear solve, not an inverse.
Quadratic convergence
‖x_{k+1}−x*‖ ≤ C‖x_k−x*‖²: correct digits double per step.
More detail
Local only — far from a minimum, or with an indefinite Hessian, the step can climb; damping and line search supply the global behaviour.
Stochastic gradient
g_b: a minibatch average with E[g_b] = ∇f.
More detail
Unbiasedness legitimises substituting it for the true gradient; its variance shrinks like 1/b in batch size.
Noise floor
The accuracy level a constant step size cannot pass.
More detail
Expected progress is descent minus an η²σ²/b penalty; the noise term balances the gain at a floor proportional to ησ²/b.
Robbins–Monro conditions
Ση_k = ∞ and Ση_k² < ∞: reach the root while averaging out noise.
More detail
η_k ~ 1/k is the canonical choice; the two conditions trade total travel against variance decay.
Coordinate descent
Minimise one coordinate or block at a time with the rest fixed.
More detail
Each step is low-dimensional — a soft threshold or a small solve; monotone decrease is free, but convergence needs smoothness or separable non-smoothness, and a non-separable kink can stall every coordinate away from the minimum.
Stochastic approximation
x_{k+1} = x_k + α_k(h(x_k) + noise): solve an equation from noisy evaluations.
More detail
Robbins–Monro targets a root of h rather than a minimum — α_k = 1/k on h(x) = μ−x recovers the running average; the ODE method reads the iterates as following ẋ = h(x), and constant steps track a moving target at the price of residual noise.
Work–accuracy trade-off
Total work is cost per step times steps to accuracy ε.
More detail
GD pays O(nd) per step for κ log(1/ε) steps, Newton pays O(nd²+d³) for log log(1/ε), SGD achieves O(d/ε); dimension, data size and target accuracy pick the winner.
Estimator
A function of the data estimating a parameter — itself a random variable.
More detail
Judged by its distribution over resampled datasets, not by one answer; bias, variance and consistency are the criteria.
Bias
E[θ̂] − θ: the systematic error of the recipe.
More detail
The 1/n sample variance undershoots by exactly (n−1)/n — Bessel's correction divides by n−1 to fix it; a little bias can buy a lot of variance.
Mean squared error
MSE = bias² + Var: expected squared error decomposed.
More detail
The split has no residual term; a biased shrinkage estimator can beat an unbiased one outright on MSE.
Consistency
θ̂ₙ → θ as n → ∞: the estimator converges to the truth.
More detail
The law of large numbers supplies it for the sample mean; it constrains the limit only, saying nothing about finite n.
Standard error
The standard deviation of an estimator — σ/√n for a mean.
More detail
The unit of estimation uncertainty; when σ is estimated from the same data, the t-distribution prices the extra uncertainty.
Likelihood
L(θ) = Πp(xᵢ;θ): the data's probability read as a function of θ.
More detail
Not a probability over θ — it need not integrate to one; the log-likelihood Σlog p is what gets maximised, both for calculus and because the raw product underflows.
Maximum likelihood estimator
θ̂ = argmax L(θ): the parameter making the data least surprising.
More detail
p̂ = k/n for Bernoulli, μ̂ = x̄ and the 1/n variance for Gaussians; invariant under reparameterisation — the MLE of g(θ) is g(θ̂).
Negative log-likelihood
−Σlog p(xᵢ;θ): likelihood rewritten as a loss to minimise.
More detail
The general form most training losses take; per sample it is the average code length that cross-entropy formalises.
Exponential family
p(x|η) = h(x)exp(ηᵀT(x) − A(η)).
More detail
Bernoulli, Gaussian, Poisson and gamma all fit the form; the natural parameter η and sufficient statistic T(x) — the only channel through which data enters the likelihood — are what make inference uniform.
Log-partition function
A(η): the normaliser whose derivatives are the moments.
More detail
∇A = E[T] and ∇²A = Cov[T] ⪰ 0 — convexity for free, which is why the MLE condition ∇A(η̂) = (1/n)ΣT(xᵢ) is moment matching.
Score function
s(θ) = ∇_θ log p(x|θ): the likelihood's sensitivity to θ.
More detail
Has mean zero — the fact that powers baselines in gradient estimators; curvature of the log-likelihood is measured through it.
Fisher information
I(θ) = E[ssᵀ] = −E[∇²log p]: how sharply data pin down θ.
More detail
The two forms agree by differentiating ∫p = 1 twice; for Bernoulli, I = 1/(p(1−p)) — most information where the outcome is least predictable.
Cramér–Rao bound
Var(θ̂) ≥ 1/(nI(θ)): a floor no unbiased estimator beats.
More detail
Also the asymptotic variance of the MLE, √n(θ̂−θ) ⇒ 𝒩(0,I⁻¹); Fisher information is the local curvature of KL divergence.
Posterior
p(θ|D) ∝ p(D|θ)p(θ): updated belief over the parameter.
More detail
Combines likelihood and prior as probability laws; the normalising constant p(D) is usually the computational bottleneck.
Conjugate prior
A prior whose posterior stays in the same family.
More detail
Beta on Bernoulli data returns Beta(α+k, β+n−k) — data just increments hyperparameters; conjugacy is a property of a likelihood–prior pair.
Posterior predictive
p(x_{n+1}|D) = ∫p(x|θ)p(θ|D)dθ: prediction averaging over parameter uncertainty.
More detail
Integrates θ out instead of plugging in a point estimate; for Beta–Bernoulli it is simply the updated success fraction.
Credible interval
An interval holding θ with posterior probability 1−α.
More detail
The direct reading a confidence interval does not permit — here the parameter is random and the interval fixed; the two notions must not be conflated.
MAP estimate
argmax of the posterior: a penalised log-likelihood.
More detail
log p(θ) is the penalty — a Gaussian prior adds an L2 term, a Laplace prior an L1; unlike the MLE it is not invariant to reparameterisation.
Confidence interval
x̄ ± z_{1−α/2}·s/√n: a random interval with a coverage guarantee.
More detail
95% refers to the procedure's long-run capture rate — the parameter is fixed and the interval random; a pivot like (X̄−μ)/(s/√n) is inverted into the endpoints, with Student's t for small n.
Wilson interval
A proportion interval that stays valid near p = 0 or 1.
More detail
Inverts the score test rather than plugging p̂ into the standard error; the symmetric ±z·SE form breaks down at extreme p.
Null and alternative hypotheses
H₀ is the no-effect claim the data must surprise; H₁ the alternative.
More detail
The test computes evidence against H₀, never for it — the asymmetry is structural, not a rhetorical habit.
p-value
P(T ≥ t_obs | H₀): how extreme the data are under no effect.
More detail
It is not P(H₀|D) — conditioning runs on the hypothesis, not the data; the test–interval duality means a level-α test rejects exactly the values outside the (1−α) confidence interval.
Type I and II errors and power
False rejection, missed detection, and P(reject | H₁).
More detail
The significance level α controls the first; power trades against the effect size Δ and sets the required sample size.
Family-wise error rate
P(at least one false rejection among m tests).
More detail
Grows like 1−(1−α)ᵐ under independence; at m = 20 and α = 0.05 it is already near two-thirds.
Bonferroni correction
Test each of m hypotheses at level α/m.
More detail
The union bound gives FWER control under arbitrary dependence; the price is power, so it suits confirmatory rather than exploratory testing.
False discovery rate
The expected fraction of rejections that are false; Benjamini–Hochberg controls it.
More detail
The step-up rule compares sorted p-values against iα/m; tolerating a controlled fraction of false finds buys much more power than FWER control.
Inverse-transform sampling
X = F⁻¹(U) with U uniform has CDF F.
More detail
The universal method when the quantile function is computable; −ln(U)/λ produces an exponential in one line.
Rejection sampling
Draw from a proposal q dominating M·p; accept with probability p/(Mq).
More detail
The acceptance rate is 1/M and collapses in high dimension — the limit that motivates Markov chain methods.
Box–Muller transform
Two uniforms become two independent Gaussians via polar coordinates.
More detail
A change-of-variables construction; combined with μ + Lz from a Cholesky factor it generates arbitrary Gaussian vectors.
Monte Carlo estimator
μ̂ₙ = (1/n)Σf(Xᵢ): replace the integral with a sample average.
More detail
Unbiased by linearity, with standard error σ_f/√n independent of dimension — the reason grids lose and sampling wins in high dimension.
Control variate
f − c(g − E[g]): subtract a correlate whose mean is known.
More detail
The optimal c = Cov(f,g)/Var(g) removes the correlated share of the variance without touching the mean — the simplest variance reduction.
Importance sampling
E_p[f] = E_q[f·p/q]: average under a proposal, reweighted.
More detail
Unbiased whenever q > 0 where f·p ≠ 0; the optimal proposal q* ∝ |f|p concentrates samples where the integrand is large.
Self-normalised importance sampling
Σwᵢfᵢ/Σwᵢ when the target is known only up to a constant.
More detail
The unknown normaliser cancels in the ratio at the cost of a small bias — the usable form for unnormalised posteriors.
Effective sample size
ESS = (Σwᵢ)²/Σwᵢ²: how many real samples a weighted set is worth.
More detail
One dominant weight collapses the ESS toward one; weight degeneracy is the failure mode this diagnostic catches.
Score-function estimator
∇_θE[f] = E[f·∇_θ log p_θ]: the log-derivative trick.
More detail
Needs only a differentiable density, so it works for discrete x where sampling itself is not differentiable; E[∇ log p] = 0 means subtracting any baseline stays unbiased while removing variance.
Reparameterisation estimator
Write x = g(θ,ε) and differentiate through: ∇_θE[f] = E[∇_θf(g(θ,ε))].
More detail
Moves θ out of the distribution into the function — x = μ + σε for Gaussians; far lower variance than the score estimator whenever it applies.
Bootstrap
Resample the data n at a time with replacement to simulate the sampling distribution.
More detail
The empirical distribution F̂ₙ plays the role of the true F; the spread of resampled estimates gives a standard error and the percentile interval — failing at extremes and under dependence, where resamples no longer mimic the mechanism.
Metropolis–Hastings
Accept a proposal x′ with probability min(1, p̃(x′)q(x|x′) / p̃(x)q(x′|x)).
More detail
Derived from detailed balance, which is why the unknown normalising constant cancels; the chain's stationary distribution is the target by construction.
Burn-in and autocorrelation
Discard the transient, then price the dependence between draws.
More detail
ESS = n/(1+2Σρ_k): correlated draws are worth less than independent ones, and the proposal scale trades acceptance against step size.
Gibbs sampling
Update each component from its conditional; every draw is accepted.
More detail
Metropolis–Hastings with the conditional as proposal has acceptance one; it needs tractable conditionals, which conjugate structure supplies.
Langevin update
x_{k+1} = x_k + (ε/2)∇ log p(x_k) + √ε·z_k: drift up the log-density plus calibrated noise.
More detail
The √ε noise must balance the ε drift; a discretised diffusion whose stationary law approximates p with bias vanishing as ε→0 — wrapping the proposal in a Metropolis correction (MALA) removes the bias exactly.
Surprise
−log p: the information content of an outcome.
More detail
Derived from requiring rarer events to surprise more and independent events to add; the log base sets the unit — bits for 2, nats for e.
Entropy
H(X) = −Σp log p: expected surprise.
More detail
Between 0 and log n with equality iff uniform by Jensen; 0 log 0 = 0 by convention, the binary case H_b(p) peaks at p = ½, and the source-coding theorem makes entropy the compression limit.
Differential entropy
−∫f log f: the continuous analogue of entropy.
More detail
Can be negative and changes under rescaling — it is not a limit of the discrete quantity; the Gaussian maximises it at fixed variance.
Joint and conditional entropy
H(X,Y) is the pair's uncertainty; H(Y|X) what remains once X is seen.
More detail
The chain rule H(X,Y) = H(X) + H(Y|X) decomposes it, and conditioning reduces entropy on average: H(Y|X) ≤ H(Y).
Cross-entropy
H(p,q) = −Σp log q: the cost of coding p's data with q's code.
More detail
Splits as H(p) + D_KL(p‖q); minimising average cross-entropy to the empirical distribution is exactly maximum likelihood.
KL divergence
D_KL(p‖q) = Σp log(p/q): the excess bits from using q for p.
More detail
Gibbs' inequality gives D_KL ≥ 0 with equality iff p = q; asymmetric — its two directions produce mode-seeking versus mass-covering fits, and its local curvature is Fisher information.
Mutual information
I(X;Y) = H(Y) − H(Y|X): the uncertainty one variable removes about the other.
More detail
Equals D_KL(p(x,y)‖p(x)p(y)) — dependence as distance from independence; symmetric, nonnegative, zero iff independent, and it detects dependence correlation misses.
Data-processing inequality
X→Y→Z implies I(X;Z) ≤ I(X;Y): processing cannot create information.
More detail
Downstream variables know no more about X than the intermediate does; no clever feature rescues information the sensor never captured.
Divisibility
a | b: b = aq for some integer q.
More detail
Closed under integer combinations — a|b and a|c give a|(xb+yc); the gcd and prime arguments are built on this closure.
Division algorithm
a = qb + r with 0 ≤ r < b, uniquely.
More detail
Existence follows from well-ordering of the nonnegative candidates; the remainder is the object modular arithmetic computes with.
Infinitude of primes
There are infinitely many primes.
More detail
Euclid: the product of any finite list plus one has a new prime factor; the prime number theorem π(x) ~ x/ln x prices key sizes.
Greatest common divisor
The largest integer dividing both a and b.
More detail
Satisfies gcd(a,b) = gcd(b, a mod b) — the recursion Euclid's algorithm runs; gcd = 1 is coprimality.
Bézout's identity
gcd(a,b) = ax + by for some integers x, y.
More detail
The gcd is the least positive integer combination, by well-ordering; the coefficients are exactly what a modular inverse needs.
Fundamental theorem of arithmetic
Every integer greater than one factors uniquely into primes.
More detail
Existence is strong induction; uniqueness runs through Euclid's lemma p|ab ⇒ p|a or p|b, which Bézout supplies — factorisations differing only in order are the same.
Congruence
a ≡ b (mod n): n divides a − b.
More detail
An equivalence relation respecting addition and multiplication, so remainders can be taken before or after operating — the licence for residue arithmetic.
Residue classes and ℤₙ
The n congruence classes with arithmetic modulo n.
More detail
A finite number system; composite n brings zero divisors — 2·3 ≡ 0 (mod 6) with neither factor zero — which prime moduli avoid.
Modular inverse
a⁻¹ mod n exists iff gcd(a,n) = 1.
More detail
Read off Bézout coefficients ax + ny = 1; the invertible residues are exactly the units of ℤₙ.
Chinese remainder theorem
Coprime moduli decompose a congruence mod mn into independent congruences mod m and mod n.
More detail
Solutions mod mn correspond bijectively to pairs of small solutions; it splits big-modulus computation into independent pieces.
Group
A set with an associative invertible operation and an identity.
More detail
ℤₙ under addition and the units ℤₙˣ under multiplication are the running examples; the axioms prove each theorem once for all of them.
Coset
gH = {gh : h ∈ H}: a translate of a subgroup.
More detail
Cosets are equal or disjoint, so they partition the group; counting them gives the index [G:H] = |G|/|H|.
Lagrange's theorem
|H| divides |G| for any subgroup H.
More detail
The coset partition is the whole proof; the order of an element and Fermat's and Euler's theorems are its corollaries.
Cyclic group and generator
A group one element generates; g is the generator.
More detail
Every element is a power of g, and the order of an element divides |G|; the units mod a prime are cyclic — the existence of primitive roots — and solving gˣ = h is the discrete logarithm problem Diffie–Hellman rests on.
Euler's totient
φ(n): the count of units mod n.
More detail
φ(n) = nΠ_{p|n}(1−1/p) by inclusion–exclusion; φ(p) = p−1 for primes, and |ℤₙˣ| = φ(n) in general.
Euler's theorem
a^{φ(n)} ≡ 1 (mod n) when gcd(a,n) = 1.
More detail
Lagrange applied to the group of units — the order of a divides φ(n), so exponents reduce mod φ(n).
Fermat's little theorem
a^{p−1} ≡ 1 (mod p) for p ∤ a.
More detail
The prime case of Euler's theorem — the correctness basis of RSA and of Fermat's primality test, which Carmichael numbers like 561 fool despite being composite.
Ring and field
A ring adds and multiplies; a field also divides by nonzero elements.
More detail
ℤₙ is always a ring and a field exactly when n is prime — Bézout supplies the missing inverses.
Irreducible polynomial
A polynomial with no nontrivial factorisation over the field.
More detail
The polynomial analogue of a prime; quotienting by one makes every nonzero remainder invertible, producing a field.
Finite field 𝔽_{pⁿ}
𝔽_p[x]/(m(x)) for an irreducible m of degree n.
More detail
Elements are remainder polynomials multiplied modulo m — 𝔽_4 = 𝔽_2[x]/(x²+x+1) is the smallest beyond the prime fields; 𝔽_{2⁸} with x⁸+x⁴+x³+x+1 is the field where bytes live, and every finite field's multiplicative group is cyclic.
finite population correction
The factor , the finite population correction, is the only difference from the binomial's mean and variance at .
Go to Sampling without replacement: the hypergeometric distribution →Which tool do I reach for?
Choose a tool for a problem covered by the authored lessons. Later mathematical tools appear as their lessons are written.
Specify exactly which inputs are allowed
Use sets, number domains and intervals.
More detail
Choose the number system first; then give the membership condition. Preserve order with tuples when a set would discard it.
Clarify what a requirement promises
Translate conditions and quantifiers before writing a proof.
More detail
Identify the forbidden case of an implication. Distinguish one fixed witness for everyone from a witness chosen separately for each input.
Establish or refute an all-input claim
Choose a proof method from the logical form.
More detail
Try definitions directly; use the contrapositive when its premise is easier to represent. One in-domain counterexample refutes a universal, while finite favourable tests do not establish it.
Show a property survives every finite update
Use a base and a successor step; carry a prefix for strong induction.
More detail
Check the first transition and all required bases. A program invariant still needs a separate termination argument.
Compute a structured finite total
Write the index domain, then look for linearity, cancellation or a progression.
More detail
Arithmetic totals require a fixed increment; geometric totals a fixed ratio. Changed bounds, caps or weights may require the original finite sum.
Change traversal order in a nested total
Reconstruct bounds from the same set of index pairs.
More detail
Rectangles swap directly; triangles need dependent bounds rewritten. Exact real equalities do not guarantee identical floating-point rounding.
Guarantee a tolerance without knowing every error
Combine absolute-error bounds with the triangle inequality.
More detail
Add same-unit bounds for a deterministic guarantee. Use exact signed arithmetic when errors are known; tighter probabilistic guarantees require later probability assumptions.
Recover an input from its output
Invert the map, which exists exactly when it is bijective.
More detail
Check both halves: no shared outputs and no missed targets. A pipeline undoes its stages in reverse order.
Find where a quantity crosses zero
Treat it as a polynomial root question when powers are involved.
More detail
A degree-n polynomial has at most n roots; divide out each found factor before seeking the next. No real root may mean complex roots instead.
Model a repeating signal or a rotation
Use sine and cosine on the unit circle, with angles in radians.
More detail
Amplitude scales peaks, frequency sets the period as its reciprocal, phase slides in time. Library trig functions assume radians.
Work with roots the reals cannot supply
Extend to complex numbers and multiply as rotate-and-scale.
More detail
Divide by multiplying with the conjugate over the squared modulus. Polar form makes powers and roots of unity routine.
Multiply many small factors or invert compound growth
Use exponents for the accumulation and a logarithm to solve for the count.
More detail
Choose the base by the unit of the answer: 2 for bits and doublings, e for calculus. A power law reads as a straight line on log–log axes.
Show an iteration settles to one value
Prove convergence with the ε–N contract or monotone boundedness.
More detail
A finite run is evidence, not proof; a shrinking gap between neighbours is not convergence. Monotone plus bounded needs no candidate limit in advance.
Total an infinite schedule of contributions
Ask whether the partial sums converge; test with comparison or ratio.
More detail
A fixed ratio below one sums to 1/(1−r); terms shrinking to zero is necessary but not sufficient. Reorder only an absolutely convergent series.
Count arrangements without listing them
Multiply independent stages; add disjoint cases; divide by systematic overcounts.
More detail
Order matters gives factorials and k-permutations; order irrelevant divides by k!. A bijection to an easy set is often the cleanest count.
Expand (x+y)ⁿ or read off one coefficient
The coefficient of xᵏyⁿ⁻ᵏ is the position-choosing count, and identities come free.
More detail
Build a row by Pascal's rule when many coefficients are needed. Substituting values specialises the theorem into counting identities.
Count a union of overlapping sets
Apply inclusion–exclusion, or bound the union by the sum.
More detail
Alternate the signs as intersection sizes grow. With many sets, the union bound is the cheap over-estimate and the first truncation.
Show a function reaches a value or bracket a root
A sign change plus continuity gives a crossing (IVT); a bounded continuous function attains its extremes (EVT).
More detail
Bisection turns IVT into an algorithm. Neither theorem locates the point — it certifies existence, which is what a bracket needs.
Get a rate of change at a single point
Take the limit of difference quotients; read it as the best linear approximation.
More detail
Differentiability gives f(x+h) ≈ f(x) + f′(x)h. A finite-difference table estimates f′ but degrades when h hits rounding noise.
Differentiate a built-up function without a limit argument
Apply the product, quotient and power rules once per combination type.
More detail
Match the combination's shape first — the quotient rule needs a nonzero denominator, the product rule both factors' derivatives. Reserve the limit definition for functions no rule covers.
Differentiate a pipeline of functions
Apply the rules once per combination type; compositions multiply stage derivatives.
More detail
Forward-store intermediate values, then multiply correction factors backwards. This is scalar backpropagation.
Turn a slope bound into a function bound
Use the mean value theorem: |f′| ≤ L gives |f(x)−f(y)| ≤ L|x−y|.
More detail
MVT also turns f′ > 0 into strict increase and f′ = 0 into constancy. The second-derivative sign classifies interior extrema.
Evaluate a 0/0 or ∞/∞ limit
Differentiate numerator and denominator separately (L'Hôpital), checking hypotheses first.
More detail
Reorder the form until a determinate limit appears. Repeating xᵏ/eˣ shows any fixed power loses to exponential growth.
Model a total produced by a varying rate
Write the quantity as a limit of slices: the definite integral.
More detail
Distance from speed, energy from power and probability from density are the same object. Set up the slices first; evaluating the resulting integral is the fundamental theorem's job.
Accumulate a total from a rate
The definite integral is the limit of Riemann sums; FTC turns evaluation into finding an antiderivative.
More detail
Linearity, additivity and |∫f| ≤ ∫|f| govern manipulation. A variable upper limit differentiates back to the integrand — the CDF–density relation.
Integrate a chain-rule or product-rule image
Substitution reverses the chain rule; parts reverses the product rule.
More detail
Spot the inner function's derivative beside it for substitution; differentiate the factor that simplifies for parts. Limits transform under substitution.
Integrate a product of unlike factors
Trade ∫u dv for uv − ∫v du, choosing u to be the factor that simplifies under differentiation.
More detail
Logs and powers differentiate down; exponentials and trig integrate without damage. The move handles x·e^(−λx) — expected waits — and powers stripped one degree at a time.
Integrate over an infinite range or past a blow-up
Define it as a limit of proper integrals; compare against p-integrals.
More detail
∫₁^∞ x⁻ᵖ converges exactly when p > 1. The integral test converts series questions into integral ones and back.
Approximate a smooth function near a point
Match derivatives to build the Taylor polynomial; price the gap with the Lagrange remainder.
More detail
The bound |Rₙ| ≤ M|h|ⁿ⁺¹/(n+1)! is the usable form — ξ is never located. The series equals f only where the remainder vanishes.
Rotate a point or take complex powers
Write re^{iθ}: multiplication adds angles, powers scale and spin.
More detail
n-th roots of unity are e^{2πik/n}. A planar rotation of (x, y) is multiplication by e^{iθ} — matrices generalise it to n dimensions.
Predict which real numbers a computer can hold
Model storage as a fixed grid: a sign, a significand and an exponent, with gaps that grow with magnitude.
More detail
Each operation returns the exact result rounded once, and the unit roundoff bounds that single error. Equality tests between computed floats are unreliable — compare within a tolerance scaled to the operands.
Keep a formula accurate in finite precision
Rewrite the computation, not the operation: log-sum-exp for softmax, log-space for long products, log1p and expm1 near zero.
More detail
A thousand probabilities can multiply to zero although each operation kept its promise; the formula spent the accuracy, not the hardware. Subtracting near-equal numbers and exponentiating unshifted scores are the classic leaks.
Score alignment between two lists of numbers
Use the dot product: a sum of products that measures directional agreement and is bounded by Cauchy–Schwarz.
More detail
u·v = ‖u‖‖v‖cos θ turns similarity, orthogonality and projection into one computation. The bound |u·v| ≤ ‖u‖‖v‖ is the estimate most later inequalities stand on.
Choose a size measure for a vector
‖·‖₂ for Euclidean error and energy, ‖·‖₁ for robust totals and sparsity pressure, ‖·‖∞ for worst-case guarantees.
More detail
Pick the norm by the question being asked: the largest single miss, the total absolute miss or the typical miss are different numbers. In fixed dimension the norms bound each other within constants, so the choice is about meaning.
Transform every data point by one shared rule
Use a matrix: it is a linear map, completely determined by what it does to a basis.
More detail
Rescaling, rotating and mixing channels are linear; thresholds and products of inputs are not, and no matrix expresses them. Check linearity before reaching for the entries.
Fuse a pipeline of linear stages into one pass
Multiply the matrices: composition of linear maps is the matrix product, applied rightmost-first.
More detail
One combined pass replaces three sweeps over the data, and associativity lets you pick the cheapest multiplication order. AB ≠ BA — stage order is part of the semantics.
Move a matrix across a dot product
Use the transpose: ⟨Ax, y⟩ = ⟨x, Aᵀy⟩, and symmetric matrices are exactly the self-adjoint ones.
More detail
(AB)ᵀ = BᵀAᵀ reverses products. Symmetry looks like bookkeeping here but is the hypothesis the spectral theorem spends later.
Pin down parameters with linear constraints
Solve Ax = b by elimination: each pivot removes a degree of freedom and reveals what the system allows.
More detail
A zero row facing a nonzero constant means inconsistent; free variables mean a whole family of solutions. Elimination reports which case you are in, not just an answer.
Describe every output a fixed matrix can reach
Ask for the column span: Ax = b is solvable exactly when b is a combination of the columns of A.
More detail
Span turns one solvability verdict into a description of every reachable right-hand side. It is closed under addition and scaling — a subspace, not just a list.
Detect redundancy among directions
Test independence: a vector already expressible through the others enlarges no span and shows up as a free variable.
More detail
Independent lists give unique coordinates; dependent ones carry waste. A total column that merely sums other features is the canonical redundancy.
Name a space by its size
Use a basis: spanning plus independent means every vector has exactly one coordinate list, and the basis size is the dimension.
More detail
Any list longer than the dimension is dependent; a shorter one cannot span. Dimension is the invariant that survives every choice of basis.
Measure what a matrix keeps and what it destroys
Rank counts output directions, nullity counts flattened input directions, and the two sum to the column count.
More detail
Rank equals the number of pivots. A nontrivial null space means information loss — many inputs landing on one output — and non-unique solutions.
Undo a linear map instead of re-solving
When the map loses nothing — square, full rank — compute A⁻¹ once and reuse it across right-hand sides.
More detail
Invertibility, a trivial null space and a nonzero determinant are the same fact restated. For a single solve, elimination alone is cheaper than forming the inverse.
Measure how a map scales volume or certify invertibility
Use det A: the signed volume factor of the map, zero exactly when a dimension collapses.
More detail
det A = 0 is the singular case — the yes-or-no behind invertibility. It also rescales areas and volumes under a change of variables and records orientation flips.
Re-express one map in different coordinates
Conjugate by the change-of-basis matrix: the same map is P⁻¹AP in the new basis P.
More detail
The map is one object; only its numbers change with the names of inputs and outputs. Determinant and trace survive — choose the basis that makes the map simple.
Get closest to a target the model cannot reach
Project onto the column space: the closest reachable point leaves a residual orthogonal to everything reachable.
More detail
When Ax = b has no solution, the projection satisfies Aᵀ(b − p̂) = 0. Geometry turns impossible into best approximation.
Make coordinates and projections trivial
Work in an orthonormal basis: coordinates are single dot products and QᵀQ = I.
More detail
Gram–Schmidt orthogonalises any basis; packaged as A = QR it is the numerically stable route to projections and least squares.
Fit more equations than unknowns
Solve the normal equations AᵀAx̂ = Aᵀb: the least-squares answer is a projection, not a compromise.
More detail
It minimises ‖Ax − b‖² exactly. Reach for the QR route rather than forming AᵀA when conditioning matters, and remember squared error lets outliers dominate.
See what a matrix does applied a hundred times
Decompose into eigen-directions: in the eigenbasis, Aᵏx just scales each component by λᵏ.
More detail
Long-run behaviour is governed by the largest |λ|. Diagonalisation is a gift, not a guarantee — shears and rotations can fail to provide a real eigenbasis.
Get an eigenbasis you can always trust
Require symmetry: real eigenvalues and an orthonormal eigenbasis are guaranteed, A = QΛQᵀ.
More detail
This is the hypothesis behind principal curvatures, quadratic-form geometry and the SVD's construction. Without symmetry even real eigenvalues can fail to exist.
Sum eigenvalues without computing them
Read the diagonal: the trace equals the eigenvalue sum and is unchanged by any change of basis.
More detail
tr(AB) = tr(BA) lets products rotate inside a trace — the identity that makes Frobenius norms and matrix-calculus gradients cheap.
Read the shape of a quadratic loss or exponent
Diagonalise xᵀAx: along eigen-directions it is a weighted sum of squares, and the eigenvalue signs decide the geometry.
More detail
All-positive eigenvalues give elliptic bowls, mixed signs give saddles, zeros give flat-bottomed troughs. One expression covers Hessian losses, Gaussian exponents and transformed lengths.
Certify a quadratic form never goes negative
Test positive definiteness: A ⪰ 0 when every eigenvalue — equivalently every xᵀAx — is nonnegative.
More detail
Strict positivity gives a strict bowl and a strict local minimum; semidefinite allows flat directions. Covariance matrices and Gram matrices BᵀB are PSD by construction.
Factorise a rectangular or non-diagonalisable matrix
Use the SVD: every matrix is rotate–stretch–rotate, A = UΣVᵀ, with singular values taken from AᵀA.
More detail
Eigendecomposition demands a square self-map; the SVD demands nothing. Rank, pseudo-inverse, conditioning and best low-rank fit all read off the same factorisation.
Bound how much a solve amplifies input error
Compute the condition number κ(A) = ‖A‖·‖A⁻¹‖ — the worst-case ratio of output error to input error.
More detail
A floating-point solve returns the exact answer to a slightly different problem; κ decides whether that matters. ‖A‖₂ is the largest singular value, so the SVD already priced it.
Compress a matrix to its few strongest directions
Keep the top singular triples: the truncated SVD is provably the closest rank-k approximation.
More detail
The error is the first dropped singular value in the spectral norm, or the tail sum of squares in Frobenius. When the spectrum decays fast, a handful of terms carries the structure.
Reason about a loss over millions of parameters
Treat it as a scalar field on ℝⁿ: read level sets for shape and norms for neighbourhoods.
More detail
Limits and continuity carry over, but approach can come from infinitely many directions — that is where differentiability fails even when every partial exists.
Find the steepest direction on a multi-parameter surface
Compute the gradient: one partial per coordinate, and −∇f is the direction of steepest descent.
More detail
The directional derivative along u is ∇f·u, so Cauchy–Schwarz makes the gradient itself the maximiser. Coordinate slopes alone cannot see diagonal movement.
Differentiate a map that returns a vector
Assemble the Jacobian: one row of partials per output — the local linear approximation to a map ℝⁿ → ℝᵐ.
More detail
Nudging one input moves every output, so mn rates live in one matrix. Its determinant is the volume rescale used by change of variables and density transforms.
Differentiate through a pipeline of vector maps
Multiply the Jacobians stage by stage — the scalar chain rule with matrices.
More detail
Store the forward intermediates, then propagate the correction matrices backwards: this is backpropagation in its general form.
Read the curvature of a loss surface
Compute the Hessian: the symmetric matrix of second partials whose eigenvalues are the principal curvatures.
More detail
Two surfaces can share a gradient while one bowls upward, one caps over and one saddles — only second derivatives separate them, and they set the safe step length.
Approximate a multivariable function one step away
Use f(x + h) ≈ f(x) + ∇f·h + ½hᵀ(∇²f)h, with the remainder bounded by a norm of the third derivative.
More detail
This quadratic model is what gradient descent bounds from above and what Newton's method minimises outright — the workhorse of optimisation analysis.
Differentiate a loss written in matrix notation
Expand f(X + dX) with differentials and read off the gradient, using trace identities to cycle products.
More detail
∇w‖Xw − y‖² = 2Xᵀ(Xw − y) falls out in a few lines where entrywise bookkeeping drowns. The differential method beats memorised tables on anything new.
Accumulate a quantity over a region rather than an interval
Iterate the integral one variable at a time by Fubini, with inner bounds that may depend on the outer variable.
More detail
Joint probabilities and masses over areas are double integrals. Swapping integration order means re-deriving the bounds from the same region — the two-dimensional reindexing of a double sum.
Integrate in coordinates that fit the region
Substitute coordinates and multiply by |det J|: the Jacobian determinant is the local volume rescale.
More detail
Round regions want polar coordinates, and the same rule transforms probability densities. Forgetting the determinant factor silently changes the answer.
Reconstruct a trajectory from a rate law
Solve ẋ = f(x): linear systems go through e^(At) and the eigendecomposition; Euler discretises the flow when closed forms fail.
More detail
The law gives slopes, not positions; integration turns them back into a path. Euler's local error is second order in the step and accumulates to a first-order global error.
Assign probabilities when outcomes are not equally likely
Work from the axioms: events are sets, and nonnegativity, totality and additivity imply complements, unions and the union bound.
More detail
P(A ∪ B) ≤ P(A) + P(B) holds without disjointness — the cheap over-estimate used everywhere. Counting faces is only the equally likely special case.
Update a probability when evidence arrives
Split P(E) over the cases that produce it by total probability, then flip the conditioning with Bayes' rule.
More detail
P(H|E) = P(E|H)P(H)/P(E): base rates dominate, so a sensitive test on a rare condition still returns mostly false positives. Condition on the evidence actually observed.
Factorise probabilities when events share no information
Independence makes P(A ∩ B) = P(A)P(B): joint questions multiply and repeated-trial models become tractable.
More detail
It is a property of the distribution, not of the story — check it rather than assume it. Zero correlation is weaker and does not imply it.
Turn outcomes into numbers that compute
Define a random variable — a function on outcomes — and carry its distribution as PMF, density or CDF.
More detail
The CDF F(x) = P(X ≤ x) works for every type, including mixed ones; the density is its derivative where one exists. Events say what happened; variables say how much.
Summarise a distribution by centre and spread
Use E[X] for the probability-weighted centre and Var(X) for the typical squared miss around it.
More detail
Expectation is linear even without independence; variances add only under uncorrelatedness. These two moments are all that the cheap tail bounds consume.
Match a counting story to a named discrete law
Bernoulli for one trial, binomial for n trials, geometric for the wait to first success, Poisson for rare events in volume, categorical for one of k.
More detail
Choose by the story — fixed trial count versus unbounded rate — not by the shape of the PMF. Each name is a short exact answer to a recurring counting question.
Match a continuous story to a named density
Uniform for indifference on an interval, exponential for memoryless waits, gamma for a wait through stages, beta for an unknown probability, Laplace for heavier two-sided tails.
More detail
A density is not a probability and can exceed 1; only its integrals are probabilities. Pick the family whose generating story matches the mechanism.
Model accumulated small effects or instrument error
Use the Gaussian: standardise with z = (x − μ)/σ and read probabilities from the standard normal.
More detail
The bell is justified by the central limit theorem — a theorem about sums, not a universal shape. Check that accumulation or measurement error really is the mechanism before defaulting to it.
Answer questions about two variables at once
Carry the joint law: marginalise by summing or integrating out, condition by slicing and renormalising.
More detail
Marginals alone cannot reconstruct the joint — the dependence lives between them. Bayes' rule for densities is this same slice-and-renormalise.
Summarise co-movement without carrying the whole joint law
Use covariance or correlation: Var(ΣXᵢ) = ΣVar(Xᵢ) + 2ΣCov prices the spread of a total.
More detail
Covariance sees only linear co-movement — X and X² can be uncorrelated yet fully dependent. Any covariance matrix must be positive semidefinite.
Predict a variable after observing related information
Use E[Y | X]: the best mean-squared predictor given the observation, itself a function of X.
More detail
The tower property E[E[Y | X]] = E[Y] prices averages in stages — take the inner expectation first, then average over what was observed.
Find the law of a function of a random variable
Push probability through the map: densities pick up the Jacobian factor, and sums of independents convolve.
More detail
f_Y(y) is not f_X evaluated at a new point — the volume rescale is essential. For sums, convolve directly or switch to generating functions.
Model several coordinates that drift together
Use the multivariate Gaussian: a mean vector and a positive-semidefinite covariance Σ give a bell in d dimensions.
More detail
Independent per-coordinate bells only paint axis-aligned ellipses; correlation needs the full Σ. The Cholesky factor Σ = LLᵀ is how you sample and evaluate it.
Reprice part of a Gaussian vector given the rest
Condition a joint Gaussian: the result is still Gaussian, with mean and covariance given by the Schur complement.
More detail
Marginals come free. This one formula powers Kalman filtering, Gaussian processes and Bayesian linear regression — linear-Gaussian worlds never leave the family.
Bound a tail when only moments are known
Markov needs only a mean (P(X ≥ a) ≤ E[X]/a for nonnegative X); Chebyshev adds a variance (P(|X − μ| ≥ a) ≤ σ²/a²).
More detail
They are assumption-light and therefore weak — polynomial decay only. When independence supplies a moment generating function, Chernoff and Hoeffding buy exponential tails instead.
Justify trusting a sample average
The law of large numbers: the mean of n independent draws converges to E[X].
More detail
It certifies that the average settles, not how fast — a guarantee at fixed n still needs a tail bound, and an approximate distribution needs the central limit theorem.
Handle a sum of independent variables as a product
Use the moment generating function M(t) = E[e^(tX)]: sums multiply MGFs, and moments are its derivatives at 0.
More detail
The MGF determines the distribution and powers the Chernoff method — bound P(X ≥ a) by minimising e^(−ta)M(t) over t. Existence on a neighbourhood of 0 is the hypothesis to check.
Approximate a standardised sum as Gaussian
The central limit theorem: (Sₙ − nμ)/(σ√n) converges to N(0,1), whatever the underlying law.
More detail
It is an approximation with no guaranteed error at fixed n — fine for intervals and quick estimates. When the requirement is a hard probability guarantee, a concentration bound is the honest tool.
Bound an average's deviation exponentially
Chernoff–Hoeffding: P(|X̄ − μ| ≥ t) ≤ 2e^(−2nt²/(b−a)²) for [a,b]-bounded summands — exponential where Chebyshev is polynomial.
More detail
The price is a hypothesis: boundedness or a sub-Gaussian proxy such as Hoeffding's lemma supplies. A union bound over m questions multiplies the failure probability by m.
Choose a sample size for a target tolerance and confidence
Set the bound equal to δ and solve for n: Hoeffding needs about log(1/δ)/ε², Chebyshev about σ²/(δε²), the CLT inverts a normal quantile.
More detail
Each tool prices the same (ε, δ) requirement differently — Chebyshev pays 1/δ where Hoeffding pays log(1/δ). The bound you are willing to assume decides the n you must collect.
Model a system whose future needs only its present
Use a Markov chain: a transition matrix moves the state distribution forward, πₜ₊₁ = πₜP.
More detail
Check the memoryless property first — if history matters, enlarge the state until it does not. Multi-step distributions are matrix powers; hitting times are linear systems.
Find where a chain settles in the long run
Solve π = πP: irreducible, aperiodic chains converge to the unique stationary distribution from any start.
More detail
The second eigenvalue controls the mixing speed, and time averages along one run obey a law of large numbers — the fact every MCMC estimate is spending.
Certify an unconstrained optimum
∇f = 0 is necessary; the Hessian classifies: positive definite gives a strict minimum, negative definite a maximum, indefinite a saddle.
More detail
A vanishing gradient alone cannot separate the three cases. An inconclusive Hessian sends you to higher-order terms or directional checks.
Check whether a feasible region can trap a search
Verify convexity: a convex set contains the whole segment between any two of its points.
More detail
Norm balls, half-spaces and the PSD cone qualify; intersections preserve convexity while unions break it. Non-convex regions are where local methods stall.
Secure that a local answer is the global answer
Require a convex function: it lies above all its tangents, and where smooth the test is ∇²f ⪰ 0.
More detail
Convexity upgrades every local minimum to global and every KKT point to a solution. Least squares and norms qualify; deep training losses do not.
Optimise a convex function through its corners
Use subgradients: the subdifferential ∂f(x) is the set of supporting slopes, and 0 ∈ ∂f(x) is the optimality test at a kink.
More detail
Hinge losses and L1 penalties bend exactly where they are not differentiable. Any subgradient gives a descent direction; optimality needs zero inside the set.
Compare f of an average with the average of f
Jensen's inequality: convex f gives f(E[X]) ≤ E[f(X)], and concave reverses it.
More detail
Curvature alone decides the direction — this one inequality sits under the ELBO, entropy bounds and AM ≥ GM. Check which way f bends before moving an expectation inside it.
Optimise on an equality-constrained surface
Lagrange multipliers: at a constrained extremum ∇f = λ∇g — the gradient is normal to the constraint surface.
More detail
Probability budgets and unit-length directions are surface constraints. The method returns candidate points; classifying them is a separate step.
Optimise inside a region bounded by inequalities
KKT conditions: stationarity plus feasibility, complementary slackness and nonnegative multipliers on the inequalities.
More detail
A constraint is either active, biting like an equality, or silent with multiplier zero. For convex problems a KKT point is a global minimum.
Bound a minimum by solving a friendlier problem
Form the dual: every dual-feasible point lower-bounds the primal optimum, and Slater's condition makes the bound exact for convex problems.
More detail
The dual variables are few, real and merely sign-constrained. A nonzero gap between the two values certifies how far from optimal you still are.
Minimise a smooth loss with cheap first-order steps
Gradient descent x ← x − α∇f(x): the descent lemma guarantees progress when α stays under 1/L for L-smooth f.
More detail
One step size must serve every curvature at once, so the rate is governed by the conditioning. Cheap per step, many steps — the baseline every other method is priced against.
Diagnose zigzagging descent iterates
Check the conditioning: κ = L/m sets the per-step factor (κ − 1)/(κ + 1), so ill-conditioned losses bounce across the valley.
More detail
A step safe along the steepest direction barely moves along the flattest. Rescale coordinates to shrink κ, or spend a curvature-aware method.
Spend a Hessian solve per step to remove conditioning
Newton's method x ← x − (∇²f)⁻¹∇f minimises the local quadratic model outright, and κ leaves the rate.
More detail
Each step is a linear solve in n variables and descends only when ∇²f ≻ 0. It wins when few expensive steps beat many cheap ones.
Descend when the true gradient is a million-term sum
Stochastic gradient descent: a minibatch gradient is unbiased, and shrinking step sizes average out the noise.
More detail
Cost per step falls by the batch factor, but a constant step parks the iterate at a noise floor and rates degrade toward 1/k. The default when n is huge.
Minimise when each single-variable solve is easy
Coordinate descent: freeze all but one variable or block, solve that subproblem exactly, and cycle.
More detail
A scalar quadratic has a closed-form vertex and a quadratic plus |xᵢ| has soft thresholding — no gradient or step size needed. It stalls when the variables genuinely couple.
Solve an equation from noisy evaluations
Robbins–Monro stochastic approximation: x ← x − αₖgₖ with Σαₖ = ∞ and Σαₖ² < ∞ finds a root of the expected map.
More detail
SGD is the special case with an objective behind it. Use this when there is no loss at all — running means, fixed points, Bellman-style updates.
Choose between gradient, Newton, stochastic and coordinate methods
Balance cost per step against steps needed: huge n favours SGD, an affordable positive-definite Hessian favours Newton, separable structure favours coordinate descent, corners need subgradients.
More detail
Ask four questions — how big is n, is the Hessian available and positive definite, does the objective split by blocks, is it smooth — and the conditioning prices what is left.
Judge an estimation recipe before running it
Score the estimator as a random variable: bias, variance and consistency across resampled data, not one output.
More detail
The sample mean is unbiased with variance σ²/n. A biased recipe can still win on mean-squared error — the decomposition decides, not the label.
Choose parameters that make the data least surprising
Maximum likelihood: maximise the likelihood product, equivalently minimise the negative log-likelihood.
More detail
Compute in log-space — products of probabilities underflow. MLE is consistent and asymptotically efficient, but small samples can return degenerate certainty like p̂ = 1.
Recognise when one parametric form covers many laws
Exponential families p(x|θ) = h(x)e^(θ·T(x) − A(θ)) cover Bernoulli, Gaussian, Poisson and categorical at once.
More detail
The log-partition A(θ) is convex and generates moments by differentiation; the sufficient statistics T(x) are all the data need to supply. MLE inside a family is moment matching.
Measure how sharply data pin down a parameter
Fisher information prices the curvature of the log-likelihood; the Cramér–Rao bound holds any unbiased variance above 1/(nI(θ)).
More detail
A sharper likelihood means more information and a lower achievable variance. The MLE attains the bound asymptotically — that is what efficiency purchases.
Treat the parameter itself as random
Bayesian inference: posterior ∝ likelihood × prior — a full distribution over θ rather than one setting.
More detail
Conjugate priors make the update a closed-form parameter change. The cost is a prior you must defend and a normalising integral that usually refuses closed form.
Get one parameter value with a prior's protection
MAP estimation: maximise the posterior — likelihood penalised by −log prior, with Gaussian and Laplace priors giving L2 and L1 penalties.
More detail
Cheaper than carrying a full posterior, safer than MLE on small samples. It is still a point estimate: the posterior's uncertainty is thrown away.
Attach an error bar with a coverage guarantee
Confidence interval: estimate ± quantile × standard error — the procedure covers the truth in the stated fraction of repeated samples.
More detail
Coverage is a property of the recipe over resampling, not a probability that this interval holds the value. The usual ±1.96 standard-error endpoints come from the central limit theorem.
Decide whether an observed gap could be chance
Hypothesis test: assume no effect and compute the p-value — the probability of data this extreme under the null.
More detail
A small p-value rejects; a large one fails to reject and never accepts. The p-value is not the probability the null is true — that inversion is Bayes' job.
Test many hypotheses without multiplying false discoveries
Apply a multiple-comparison correction: Bonferroni divides α by m, and FDR procedures control the false share instead.
More detail
m honest level-α tests still yield up to mα expected false positives — each test kept its promise while the collection broke it. The union bound is the cheap fix.
Turn uniform random bits into draws from a named law
Invert the CDF when the quantile is computable (X = F⁻¹(U)); use Box–Muller for Gaussians and affine maps for multivariate ones.
More detail
Rejection sampling needs an envelope and degrades fast with dimension. When no direct sampler applies, the fallback is a Markov chain.
Price an expectation by averaging samples
Monte Carlo: μ̂ = (1/n)Σf(Xᵢ) is unbiased with standard error σ/√n — a dimension-free rate where grids pay m^d.
More detail
You need actual draws from p and finite variance; the error bar comes from the central limit theorem. Correlated draws silently inflate the effective variance.
Estimate an expectation under a law you cannot sample
Importance sampling: draw from a convenient q and reweight by w = p/q, since E_p[f] = E_q[f·w].
More detail
Unbiased when q covers p's support and the weights are exact; self-normalised weights handle targets known only up to a constant. A badly matched q lets a few huge weights dominate and the variance explodes.
Differentiate an expectation when the parameter sits inside the law
Score-function estimator ∇E_p[f] = E[f·∇log p] works for any f; reparameterisation x = g(θ, ε) differentiates pathwise with far less variance.
More detail
The score function needs only a differentiable density but pays in variance; reparameterisation needs the distribution expressible as a noise transformation. Choose by which you have.
Get an error bar when no formula supplies one
Bootstrap: resample the n observations with replacement, recompute the statistic, and read the spread of the resample values.
More detail
Medians and odd statistics get a sampling distribution without a pivot or closed-form standard error. The resample is only as representative as the original sample — dependence and tiny n break it.
Sample a density known only up to a constant
MCMC: run a Markov chain whose stationary law is the target — Metropolis–Hastings accepts a proposal y with probability min(1, π(y)/π(x)).
More detail
You trade independent draws for tractability: burn-in precedes usable samples and correlation makes the effective sample size smaller than n. The missing envelope stops mattering.
Steer a sampling walk with the target's gradient
Langevin sampling: add a ∇log p drift to Gaussian noise of order √ε — the Euler discretisation of a diffusion whose equilibrium is p.
More detail
Gradients remove the blindness that stalls a symmetric random walk in high dimensions. The unadjusted chain is biased at finite step size; a Metropolis correction restores exactness.
Measure a distribution's intrinsic uncertainty
Entropy H(X) = −Σp log p: expected surprise in bits, maximised by the uniform law and zero at a point mass.
More detail
The same quantity prices compression length and forecast vagueness. The 0 log 0 term is set to 0 by its L'Hôpital limit.
Measure the uncertainty a measurement leaves behind
Conditional entropy H(Y|X) = H(X,Y) − H(X): the doubt about Y that survives once X is read.
More detail
The chain rule splits joint uncertainty, and conditioning never raises entropy on average. This is the term mutual information subtracts.
Price a model that assumes the wrong distribution
KL divergence D(p‖q) ≥ 0 measures the excess description cost; cross-entropy H(p,q) = H(p) + D(p‖q) is the loss classifiers minimise.
More detail
D(p‖q) is asymmetric and not a distance — check which argument is the truth. Minimising cross-entropy over q is exactly maximum likelihood.
Measure dependence of any shape, not just linear
Mutual information I(X;Y) = H(Y) − H(Y|X): how much one variable tells about the other, zero exactly under independence.
More detail
Correlation inspects second moments only — X and X² can be uncorrelated yet fully dependent, while mutual information catches it. It is symmetric and equals D(p_{XY}‖p_Xp_Y).
Ask which integers divide which
Use the division algorithm for quotients and remainders, and unique prime factorisation for the multiplicative structure.
More detail
Primality testing and factoring split apart: testing is cheap while factoring is the hardness RSA banks on. A checksum is a divisibility question.
Find shared divisors and the coefficients that build them
Euclid's algorithm returns gcd(a, b) quickly; extended, it produces Bézout coefficients x, y with ax + by = gcd.
More detail
A multiplicative inverse mod n exists exactly when the gcd is 1, and Bézout's x is that inverse — the subroutine behind modular division.
Compute inside a finite ring of remainders
Use modular arithmetic ℤₙ: add, subtract and multiply wrap mod n; divide only by units whose gcd with n is 1.
More detail
Hashing, clocks, checksums and RSA live here. ℤₙ is a field exactly when n is prime — otherwise nonzero elements can multiply to zero and division fails where a protocol needs it.
Prove one theorem for every invertible-operation world
Use the group axioms — one associative operation with identity and inverses — and cyclic groups when a single generator produces everything.
More detail
Clock arithmetic, modular units, rotations and permutations are the same object. Lagrange's theorem — subgroup size divides group size — is what Fermat's and Euler's theorems spend.
Collapse huge exponents modulo n
Fermat and Euler: a^(φ(n)) ≡ 1 mod n for units, so exponents reduce mod φ(n); prime moduli give a^(p−1) ≡ 1.
More detail
This is RSA's correctness core and a compositeness certificate — a^(n−1) mod n differing from 1 proves composite without factoring.
Get a finite domain where division always works
Use a finite field: one exists for every prime power pⁿ — ℤ_p for primes, polynomial arithmetic mod an irreducible otherwise.
More detail
A byte has 2⁸ values and 256 is not prime, so GF(2⁸) rather than mod-256 arithmetic is what erasure codes and AES compute in.