High-Dimensional Probability
Nine modules, one per chapter: tail bounds, concentration of sums, random vectors and matrices, Johnson–Lindenstrauss, quadratic forms, Gaussian width, VC dimension and sparse recovery. Run a simulation, move a slider, place points, work through an example one step at a time, then check yourself with concept questions and practice problems.
Follows the chapter order of R. Vershynin, High-Dimensional Probability: An Introduction with Applications in Data Science, 2nd ed. (Cambridge University Press; pre-publication version of November 2025). Chapters 1–9 are covered, one module each; the short opening "Appetizer" is not. Chapter and exercise numbers refer to that edition; the questions and examples here are written for this page.
Tail bounds from moments
Almost every estimate in high-dimensional probability starts from a few blunt tools: Jensen, Markov, Chebyshev and the union bound. They are crude, but in a way you can control. Here you can see how much each one gives away, and why the next chapter wants exponential moments.
The idea
Explore
Worked example
You average i.i.d. measurements with unknown mean and variance . How large must be for with probability at least ? And what if you run 1000 such experiments and want all of them to succeed at once?
What does Chebyshev guarantee for one experiment?
, so . This is at most once .
What does the CLT suggest instead?
Treat as standard normal. A two-sided normal tail of needs , so , i.e. . That is 15 times fewer, but it is a heuristic, not a guarantee.
Now 1000 experiments must all succeed with total failure probability . Use the union bound. What failure probability can each experiment have, and what does each method ask for?
Each may fail with probability . Chebyshev needs , so : a thousand times more. The normal heuristic needs , so : only three times more.
Can you trust the 1952?
Not from the CLT alone. The normal approximation to the distribution function has error of order here, two thousand times bigger than the we are estimating. Chebyshev is rigorous but only polynomial in . What we want is a rigorous bound with Gaussian-like decay at every finite . That is the next module.
Check your understanding
All you know about is that and . What is the best upper bound on that holds for every such ?
- A bound needs a second moment, and you don't know . It could be huge.
- Exponential decay needs exponential moments. A nonnegative variable with mean 1 can have a heavy tail.
- There is no bound without more information.Markov's inequality uses exactly these two facts.
Which inequality holds for every random variable (with the expectations finite)?
- is convex, so Jensen goes the other way.
- for is concave, so Jensen gives .
- for is concave; try with equal probability.
You have events, each of probability at most . Roughly how large must be for the union bound to give ?
- That makes a single event unlikely. With a million of them you need each to have probability .
- The number of events enters only through a logarithm, not through itself.
- The union bound is useless for a million events.It loses a factor , but a Gaussian tail absorbs that easily.
Practice
Markov is sharp at every thresholdExtremal examples
Fix . Find a nonnegative with and . Then show that if equality holds in Markov's inequality, must take only the values and .
Hint
Write and ask when this is an equality.
Solution
Take with probability and otherwise. In general pointwise, so . Equality forces almost surely, so .
When is the union bound nearly exact?Independent rare events
Let be independent with . Show that . What does this say when ?
Hint
. Use and for .
Solution
The upper bound is the union bound. For the lower, , so . With , the union bound is off by at most half a percent of its value. It is wasteful only when the events overlap heavily.
More practice: Vershynin, Exercises 1.11 and 1.16.
Concentration of sums
A sum of independent terms with values in exceeds its mean by with probability at most , for every , not just in the limit. Hoeffding, Chernoff and Bernstein are three versions of this, and the differences between them matter exactly when some terms are rare.
The idea
All of these come from one move: apply Markov to , factor using independence, and optimise over .
a Gaussian tail for moderate , an exponential one far out.
Explore
Worked example
An A/B test estimates a click rate by the fraction of independent users who click. We want with probability at least . How many users are needed?
Use Chebyshev, knowing only .
. Setting this to gives .
Use Hoeffding (each click indicator lies in ).
Two-sided: . We need , i.e. . Sixty-five times fewer users.
Suppose you also know . Bernstein's inequality for variables with reads . What does it give?
Here and , so the exponent is . We need it to be at least :
Another factor of 11. Hoeffding pays for the worst-case variance ; Bernstein pays only for the actual variance.
How does each answer scale with the failure probability ?
Chebyshev needs ; Hoeffding and Bernstein need . Asking for instead of multiplies the Chebyshev answer by 1000, but the Hoeffding answer by less than 2.
Check your understanding
Which of these random variables is not subgaussian?
- A random variable with almost surelyBounded variables are subgaussian: , which is at most 2 for large .
- The Gaussian is the model subgaussian variable, with a constant times .
- An exponential random variable
- A sum of 100 independent random signsThat sum is bounded by 100, and better, it has norm of order .
, so . Hoeffding bounds by about ; Chernoff by about . Why is Hoeffding so weak here?
- It only uses that each term lies in , not that each term is almost always 0.
- Hoeffding needs identically distributed terms.It doesn't, and these terms are identically distributed anyway.
- Hoeffding needs symmetric terms.The version for bounded variables needs only independence and the ranges.
- Hoeffding only holds for large .It holds for every . It is a true bound here, just a useless one.
Let with i.i.d. standard normal, so the are mean-zero subexponential. For which deviations does Bernstein give a Gaussian-type bound for ?
- For
- For Compare with : which is smaller when is large?
- For all Then would be subgaussian, but alone already decays like .
- Only for is the typical size of the sum, but the Gaussian regime extends much further.
Practice
Two subgaussian normsComputing ψ₂ from the definition
(a) Show that if , then , with equality for with equal probability. (b) Compute for .
Hint
For (b), for .
Solution
(a) once ; for the first inequality is an equality, so this is the smallest. (b) Set : then , , .
From MGFs to a tail boundThe exponential moment method
Suppose are independent and for all . Prove for .
Solution
For , Markov and independence give with . The exponent is smallest at , where it equals . Random signs satisfy the hypothesis with , because ; this recovers Hoeffding.
More practice: Vershynin, Exercises 2.13 and 2.25.
Random vectors in high dimensions
A standard Gaussian vector in has length , and two independent ones are almost perpendicular. Both facts are concentration of a sum, and together they make high-dimensional space behave very differently from the plane.
The idea
So is typically of size : independent random directions are nearly orthogonal. Examples of isotropic distributions: , the uniform distribution on the sphere of radius , random sign vectors, and the coordinate distribution with uniform.
Explore
Worked example
Run Goemans–Williamson by hand on the 5-cycle (vertices , edges mod 5). The SDP is: maximise over unit vectors .
What is the maximum cut of ?
4. A cut of all 5 edges would 2-colour an odd cycle, which is impossible; alternating labels around the cycle cut 4 edges.
Try planar vectors . What SDP value do they give?
Neighbours are at angle , so each edge contributes , and the total is . The relaxation beats every actual cut.
Show no unit vectors do better. (Write the objective with the graph Laplacian and the Gram matrix .)
, since with unit diagonal. For , , so the bound is . The planar vectors are optimal.
Round with a random hyperplane through the origin: vertex goes to the side given by the sign of . What is the expected cut, and how does it compare with the guarantee?
An edge is cut when the hyperplane separates its two vectors, which happens with probability (angle). So the expected cut is : the rounding finds a maximum cut on average. The ratio to the SDP value is , just above the guarantee; is close to the worst case.
Check your understanding
with . Which description of is right?
- About , give or take about
- About , give or take about fluctuates by about around , but taking a square root divides that by .
- About , give or take about That describes , not .
- Anywhere between and with comparable probabilityThe density of peaks at the origin, but the volume near the origin is tiny. Look at the left histogram.
are independent and uniform on the unit sphere . What is the typical size of ?
- Of order
- Of order That is the size of , not of .
- Of order 1In the plane, yes. In high dimension, almost all of the sphere is near the "equator" orthogonal to .
- Exactly 0Orthogonality is approximate; has a continuous distribution.
In you want unit vectors that are pairwise almost orthogonal: for . How many can you have?
- Exponentially many in
- At most That is the limit for exactly orthogonal vectors. A little slack changes everything.
- At most Count with random vectors and the union bound: the failure probability per pair is exponentially small.
- At most Try the union bound on random vectors: for which does it still work?
Practice
Volume lives near the surfaceThe uniform distribution on a ball
is uniform in the unit ball of . Show . For , how thin is the outer shell that holds 99% of the volume?
Solution
By scaling, , so . For 99% in the shell, solve : .
Norm concentration with only two momentsA Chebyshev version
For , use and the inequality (for , ) to show . What does the theorem above add?
Solution
, so . This already shows fluctuations are . The theorem upgrades the tail to a subgaussian , which is what union bounds over many vectors need.
More practice: Vershynin, Exercises 3.12 and 3.41.
Singular values of random matrices
A tall random matrix stretches every direction by almost the same factor : its singular values all lie in . The proof combines one-direction concentration with a union bound over an -net of the sphere.
The idea
For Gaussian entries the constant is sharp: and (proved in Chapter 7). Equivalently, .
Explore
Worked example
Bound the number of points needed for an -net of the sphere , and see why that number decides how many rows a random matrix needs.
Take a maximal -separated subset of (pairwise distances , and no point can be added). Why is it an -net?
If some were at distance from all of , we could add it and stay separated, contradicting maximality.
Bound by comparing volumes.
Balls of radius around the points of are disjoint and all lie in the ball of radius . Comparing volumes,
For , at most points.
For a fixed unit , is a sum of independent terms with mean 1. What does Bernstein give?
Each is mean-zero subexponential with norm . Bernstein gives , with depending only on .
Union bound over a -net. When does it work?
The probability that some net point fails is at most , which is small once . Then on the whole net, and an approximation argument (any is within of a net point) extends the bounds to the whole sphere. The net has exponentially many points, but exponential concentration pays for them. That is why the number of rows needs to be only proportional to .
Check your understanding
is a matrix with i.i.d. entries. Where do you expect its singular values?
- Roughly in
- Roughly in The matrix is very tall, so it is far from singular: is close to , not to 0.
- Roughly in Those would be eigenvalues of if they concentrated to within ; singular values are their square roots.
- All within of The spread is of order , not .
For a square Gaussian matrix, . What is true of its smallest singular value?
- It is typically of order : much smaller than the rest, but not zero.
- It is typically of order , like the others.Take in the explorer and look at the left end of the histogram.
- It is 0 with positive probability.The set of singular matrices has measure zero, so a Gaussian matrix is invertible almost surely.
To show by a union bound over a -net of , roughly how small must be for a single fixed ?
- Much smaller than
- Smaller than The net has about points, not .
- Smaller than That controls one direction. The norm is a maximum over all directions at once.
- It doesn't matter, the net handles it.The net only makes the set of directions finite. The union bound still costs its size.
Practice
All 2×2 sign matricesAn exact computation
Let be a matrix with independent entries. Find the distribution of and , and compute and . Compare with .
Hint
The second row is either the first row, or orthogonal to it.
Solution
With probability the rows are each other: has rank 1, , . Otherwise the rows are orthogonal of length , so is orthogonal and . Hence and , inside . For tiny matrices the bounds are true but say little.
Approximate isometriesFrom AᵀA to singular values
Show that if with , then every singular value of lies in , and hence in .
Solution
is symmetric with eigenvalues , and its norm is the largest of their absolute values. So , i.e. . Finally and .
More practice: Vershynin, Exercises 4.35 and 4.47.
Lipschitz concentration and Johnson–Lindenstrauss
Any Lipschitz function of a high-dimensional Gaussian (or of a uniform point on the sphere) is nearly constant, whether or not it is a sum. One consequence: points in any dimension can be projected to about dimensions with every pairwise distance preserved up to .
The idea
The target dimension depends on and but not on , and is chosen without looking at the data. The proof: for one fixed vector , concentrates at 1 with subgaussian tails in ; then union-bound over the differences.
The dimension enters only as the factor in front, i.e. as a in the deviation. It handles covariance estimation for general (not subgaussian) distributions.
Explore
Worked example
Let and . How large is , and how much does it fluctuate?
Bound . (Hint: .)
By Jensen, . So , and gives . For that is about 5.26.
Show that is 1-Lipschitz for the Euclidean norm.
If the max of is at , then . Swap the roles of and for the other direction.
What does Gaussian concentration give?
for every . The maximum of a million Gaussians grows like , but it fluctuates by regardless of . (Its true fluctuations are even smaller, but the theorem needs no work to give .) Independence was never used in step 3; only the Lipschitz property was.
The same reasoning applies to as a function of the Gaussian entries of . Compute its Lipschitz constant and explain why JL needs .
With a unit vector and , , and is 1-Lipschitz in the Frobenius norm of . So deviates from its mean (which is close to 1) by more than with probability , roughly. For all pairs to succeed we need , i.e. .
Check your understanding
In the Johnson–Lindenstrauss lemma, what does the target dimension depend on?
- Only on the number of points and the accuracy
- On the ambient dimension The proof handles one difference vector at a time, and the law of is the same in every dimension.
- On how the points are arrangedThe projection is chosen without looking at the data. Switch data sets in the explorer.
- Only on More points mean more pairs that could fail; the union bound charges .
and is 1-Lipschitz. Which statement is guaranteed for every ?
- stays within of with high probability.
- is approximately Gaussian.Concentration controls the size of fluctuations, not their shape. Think of .
- is bounded independently of . is 1-Lipschitz and .
- .The variance is at most of order 1 (in fact at most 1), but it can be much smaller, e.g. 0 for a constant .
Fix the target dimension and add more and more points. How does the worst distortion over all pairs typically grow with ?
- Like
- It stays the same.Each new pair is another chance for an unlucky ratio.
- Like That would follow from Chebyshev-type tails. The per-pair tail is Gaussian.
- Like The number of pairs grows like , but the distortion only like the square root of its logarithm.
Practice
Sizing a projectionUnion bound arithmetic
Suppose that for each fixed difference vector, a random projection to dimensions distorts its length by more than with probability at most . How large should be so that points keep all pairwise distances within 20%, with failure probability at most 1%?
Solution
There are fewer than pairs, so the failure probability is below . Require : . The original dimension never entered.
The norm of a Gaussian imageLipschitz constant of x ↦ ‖Ax‖
Let be a fixed matrix and . Show that fluctuates around its mean by , while . When is the fluctuation small compared with the mean?
Hint
. For the mean, use Jensen and .
Solution
is -Lipschitz, so . Also , and since the variance is , . The fluctuation is small relative to the mean when is large, i.e. when the stable rank is large.
More practice: Vershynin, Exercises 5.9 and 5.14.
Quadratic forms and symmetrization
A quadratic form of independent variables is a sum of dependent terms . It still concentrates: its tail is Gaussian at scale and exponential at scale , and the ratio of the two decides which one you see.
The idea
The right side is linear in once is fixed, so tools for sums apply.
Explore
Worked example
Let and , so . Find its mean and variance, and the two scales in Hanson–Wright.
Compute for any isotropic .
.
For Gaussian and symmetric , show .
Write . Then by rotation invariance, and , a sum of independent terms with . So the variance is .
Apply it to this , and check directly.
The eigenvalues are , so (also ), and the variance is 12. Directly: , , and . Total 12.
What are and , and where does the tail switch from Gaussian to exponential?
and . The two terms in the minimum cross at , less than one standard deviation (). So this form has essentially no Gaussian regime: it is dominated by the single large eigenvalue, like . In the explorer this is stable rank .
Check your understanding
has independent coordinates and . Then always, but Hanson–Wright allows fluctuations of order . Is something wrong?
- No: Hanson–Wright is an upper bound, and here the diagonal terms don't fluctuate at all.
- Yes: Hanson–Wright requires Gaussian coordinates.It holds for any independent mean-zero subgaussian coordinates, signs included.
- Yes: the fluctuation must be exactly of order .The theorem bounds the tail from above. Nothing forces the form to fluctuate that much.
with large. For which is , after standardising, closest to a normal distribution?
- with Then is a single : stable rank 1, the most skewed case.
- One eigenvalue dominates: , so the stable rank is about 1.
The symmetrization inequality requires the to be:
- Independent with mean zero
- SymmetricIf they were symmetric, and would have the same law. Symmetrization is how you avoid assuming that.
- BoundedOnly integrability is needed.
- Identically distributedThe proof treats each separately; no common distribution is needed.
Practice
Estimating a trace with random signsHutchinson's estimator
You can only access a symmetric matrix through products . Show that for with independent entries, and . Why are signs better than Gaussians here?
Solution
. The products , , have mean 0, variance 1 and are pairwise uncorrelated, so the variance is . With Gaussian it is , which also counts the diagonal. For a nearly diagonal , signs are far more accurate.
Symmetrization on the lineThe basic argument
Prove for independent mean-zero real .
Hint
Let be an independent copy. Write and use Jensen conditionally on .
Solution
by Jensen. Each is symmetric, and they are independent, so has the same law as . Then the triangle inequality gives .
More practice: Vershynin, Exercises 6.7 and 6.20.
Gaussian processes and Gaussian width
How big is a set in ? Its Gaussian width, the expected maximum of a random linear function over it, is the answer that matters for random projections and for recovery problems. Some sets that look large, like the ball, turn out to be tiny.
The idea
Explore
Worked example
Compute, or bound, the Gaussian width of the cross-polytope , and compare it with the Euclidean ball.
Express in terms of .
A linear function on a polytope is maximised at a vertex, and the vertices are . So the sup is , and .
Bound using the moment generating function.
The maximum is over the variables . For , Jensen gives , so . With : .
Put in . How good is the bound?
The bound is . The exact value (an integral of the normal distribution function, which the explorer computes) is about 3.44. For comparison, .
What does this mean for a random projection of ?
Its effective dimension is for . A random projection to dimensions with well above 14 shrinks it to diameter about times the original, and for smaller to about . The ball, by contrast, has effective dimension . This gap is what makes sparse recovery possible in Chapter 9.
Check your understanding
and is an matrix with . How do and compare?
- A contraction can only shrink the increments .
- They are equal.Take : then .
- No general relation.Compare the increments of the two processes and use Sudakov–Fernique.
How does the Gaussian width of compare with that of its convex hull?
- They are equal.
- can be much larger.For a fixed , a linear function's sup over the convex hull is attained at a point of .
- is larger by a factor for finite .That factor appears when you compare a finite set's width with its diameter, not with its hull.
is the unit Euclidean ball of a -dimensional subspace sitting in , . What is approximately?
- Only the component of inside the subspace matters.
- 1That is the radius. The width also counts how many directions the set extends in.
- The width is the expected length of a -dimensional Gaussian vector, not its squared length.
Practice
Width of the cubeAn exact computation
Compute exactly and compare it with the width of the Euclidean ball of the same diameter .
Solution
, so . The ball of radius has width . So the cube is almost as wide as its circumscribed ball: its corners stick out in nearly every direction.
Linear images and widthUsing Sudakov–Fernique
Show for any matrix and bounded . Deduce that if lies in the unit ball then .
Solution
Compare () with : , so Sudakov–Fernique gives the claim. For the second part, .
More practice: Vershynin, Exercises 7.17 and 7.22.
Chaining and VC dimension
To bound the supremum of a process, chaining runs a union bound at every scale and adds up the costs. For classes of sets the relevant size is combinatorial: how many points the class can label in every possible way. Place points below and try to beat the VC dimension.
The idea
Chaining: approximate each by points of a -net, write , and union-bound each level separately. A link at level has length about , and there are about of them; summing over gives the integral.
The proof symmetrizes, bounds covering numbers of in terms of , and applies Dudley. In learning theory this says empirical risk minimisation over such a class has excess risk of order .
Explore
Worked example
Find the VC dimension of the class of closed intervals , and count exactly how many subsets it cuts out of points.
Show that two points are shattered.
: an interval far away. , : tiny intervals around each. : . All four subsets are cut out.
Why can no three points be shattered?
An interval containing and contains everything between them, including . So is never cut out. Hence .
How many subsets of points on the line do intervals cut out?
Exactly the empty set and the runs of consecutive points: . (A run is determined by its first and last point, possibly equal.)
Compare with the Sauer–Shelah bound for .
: exactly equal. So the lemma cannot be improved in general. For , intervals realise 56 of the 1024 subsets.
Check your understanding
What is the VC dimension of half-planes in ?
- 2Three points in a triangle are shattered: check it in the explorer.
- 3
- 4Try four points. In convex position, the two diagonals can't be separated; otherwise one point is inside the triangle of the others.
- InfiniteHalf-planes are described by 3 parameters, and indeed no 4 points can be shattered.
A class has VC dimension 3. At most how many different subsets can it cut out of 10 points?
- 176
- 1024That is every subset, which would mean 10 points are shattered.
- 120That is alone. Add the subsets of size 0, 1 and 2 in the Sauer–Shelah sum.
- The style bound is of this order, but the exact Sauer–Shelah sum is much smaller here.
Empirical risk minimisation over a class of VC dimension , from samples. With no further assumptions, how does the guaranteed excess risk scale?
- That faster rate needs extra assumptions (for example, a target in the class with no noise).
- , independent of The complexity of the class must enter: with infinite VC dimension, no rate is possible.
- Sauer–Shelah replaces the exponential count by a polynomial, so only appears, not .
Practice
Discs centred at the originA one-parameter class
Find the VC dimension of the class .
Solution
One point is shattered (take or ). For two points with , any disc containing contains , so is never cut out. The VC dimension is 1. Notice the class is a nested chain of sets; any such chain has VC dimension at most 1.
Finite classesA simple bound
Show that a finite class has . Give a class with and VC dimension exactly .
Solution
Shattering points needs different sets, so . For equality, take a -point set and let be all its subsets.
More practice: Vershynin, Exercises 8.12 and 8.14.
Random matrices on sets and sparse recovery
A random matrix with has a big kernel, so it cannot be injective. But it behaves like a scaled isometry on any set of small Gaussian width, and that is enough to recover an -sparse vector exactly from about random measurements.
The idea
Taking to be the sphere gives the singular value bounds of Chapter 4; taking normalised differences of points gives Johnson–Lindenstrauss.
Why: is a competing solution exactly when and , i.e. lies in the descent cone of the norm at . The cone has , so by the escape theorem the kernel misses it.
Explore
Worked example
The smallest case: , one measurement , and the 1-sparse vector . When does minimisation find ?
Take , so . Find the minimum -norm solution.
It is the point of the line closest to the origin, . Not sparse, and not .
Now minimise on the same line.
On the line , so minimise . This is piecewise linear with value 2 at and 1 at , and grows outside . The minimum is at : recovered. Geometrically, the smallest diamond that touches the line touches it at a corner.
Repeat with , so .
On , minimise : value 1 at but at . The minimiser is : sparse, but the wrong vector.
Explain both outcomes with the kernel and the descent cone .
Near , , so , a cone of half-angle 45° around . For the kernel is spanned by , which is steeper than 45° and misses : success. For it is spanned by , and : failure. In high dimension the descent cone is a small fraction of directions, and the escape theorem says a random kernel misses it once .
Check your understanding
is a random subspace of of codimension . By the bound, the Euclidean diameter of is at most about:
- 1 has points of length 1 (the vertices), but a random subspace avoids those directions.
- That is what the bound gives for the Euclidean ball, whose width is about . Use instead.
- 0 is a subspace of dimension , so contains nonzero points.
How many Gaussian measurements suffice for minimisation to recover a given -sparse with high probability?
- On the order of
- On the order of measurements would let you invert , sparse or not. Sparsity is what saves you.
- Exactly Even knowing the support you need ; not knowing it costs a logarithmic factor for .
- On the order of Some deterministic constructions need that many; random matrices do much better.
In the matrix deviation inequality, take , for which . What does it say?
- All singular values of lie in , on average.
- for every unit vector .The inequality allows a deviation of order , not zero.
- is invertible.If , has a kernel, and the bound becomes negative, so it says nothing about .
- .The scale of must appear; only the deviation is of order .
Practice
ℓ₁ minimisation is a linear programWhat the explorer solves
Show that subject to has the same optimal value as the linear program subject to , , and that at any optimum for each (so is optimal for the original problem).
Solution
Given feasible , , is feasible with . Conversely, feasible gives a feasible with . So the optimal values agree. If at an optimum, lowering both by keeps and feasibility but lowers the objective, a contradiction.
Too few measurementsA lower bound for any method
Show that if , no method at all can recover every -sparse (with ) from .
Hint
Look for two different -sparse vectors with the same image.
Solution
Any columns of are vectors in with , so they are linearly dependent: there is supported on those coordinates with . Split with each supported on of the coordinates. Then are both -sparse and . So is necessary, and the factor in the theorem is the price of a computationally easy method.
More practice: Vershynin, Exercises 9.30 and 9.32.