Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.A shadow that keeps the distances
Shine a light on a 3-D object and its shadow on the wall is flat. Some information is lost. Now imagine points in a space with thousands of dimensions. Surprisingly, if you cast their “shadow” onto a random lower-dimensional wall, the distances between the points barely change.
This is the Johnson–Lindenstrauss lemma. It’s one of the most useful surprises in mathematics.
A Mars rover or a deep-space probe can only send back a trickle of data. Random projections (and their cousin, compressed sensing) let a spacecraft send a short random summary of an image or signal, from which the important structure can be recovered on Earth.
- 1. A random projection to fewer dimensions keeps distances…
- 2. How many dimensions you need depends on…
- 3. A shadow of a 3-D object on a wall has how many dimensions?
Level 1: Beginner
★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.Random projection
Take a matrix with independent entries and map . The scaling makes lengths right on average:
Each output coordinate is a random weighted sum of all the inputs, so it’s a fair “vote” on the length. With votes, the average is accurate to about .
How many dimensions?
- It depends on the number of points , only logarithmically.
- It does not depend on the original dimension . That’s the magic: 1,000 points in a million dimensions need the same as 1,000 points in 100 dimensions.
- Halving costs 4× the dimensions.
- 1. ‖x‖ = 3. The expected ‖(1/√k)Sx‖² = ?
- 2. Going from 10³ to 10⁶ points multiplies the needed k by…
- 3. Halving ε multiplies k by…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.The Johnson–Lindenstrauss lemma
For any points in and , if , then a random Gaussian map satisfies for all pairs with probability at least . Repeating the draw a few times makes success virtually certain.
The randomized toolbox
| Task | Randomized method | Cost instead of |
|---|---|---|
| Top- SVD of | range finder: , , SVD of (A2.3-6) | vs |
| Least squares, | sketch-and-solve: with of size , | a problem times smaller |
| from products only | Hutchinson: | never forming |
| Kernel methods | random Fourier features | kernel matrix |
| Nearest-neighbour search | JL + locality-sensitive hashing | high-dimensional distances |
The randomized SVD needs two tricks for accuracy. Oversampling means using random vectors, with –. Power iterations, , raise the singular values to the power , which sharpens a slowly decaying spectrum.
- 1. Variance of ‖Sx‖²/‖x‖² for a Gaussian sketch with k = 200?
- 2. Randomized SVD with target rank 10 and oversampling 5 draws how many random vectors?
- 3. Hutchinson's estimator for A = diag(1, 2, 3) has expected value…
Level 3: Advanced
★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.Why it works: concentration
For a fixed unit vector , each coordinate of is (a sum of Gaussians, by rotation invariance). Hence , with mean and variance . A Chernoff bound on the chi-square distribution gives
Apply this to each of the difference vectors and use a union bound. Choosing as in the lemma makes the total failure probability less than 1. ∎ No property of the data was used, and that’s why never appears.
Is necessary?
Yes. Larsen and Nelson (2017) proved that JL’s dimension is optimal for linear and nonlinear maps alike. Faster variants keep the guarantee with cheaper matrices: sparse ±1 matrices (Achlioptas, 2003), the Fast JL transform (FFT plus random signs, Ailon and Chazelle, 2009) and CountSketch.
Hutchinson’s variance
For Rademacher (random ), for symmetric , so the diagonal contributes no noise. For Gaussian , the variance is . Averaging samples divides the variance by . Newer methods (Hutch++, Meyer et al., 2021) combine a randomized low-rank part with Hutchinson to reach error .
Exercise 3.1: Show E‖Sx‖² = k‖x‖² for Gaussian S
. The cross terms vanish because the entries are independent with mean 0.
- 1. ‖Sx‖² for unit x and Gaussian S (k rows) follows…
- 2. How many difference vectors does the union bound cover for 100 points?
- 3. Is the log n / ε² dimension optimal?
Level 4: Expert
★★★★★ Expert⏱ 40 minResearchers: original papers and open problems.Randomized numerical linear algebra in practice
Halko, Martinsson and Tropp (2011) made randomized SVD a standard tool. It’s what sklearn’s randomized_svd and many PCA implementations use on large data. Their bound, for oversampling , is
Randomized solvers (Blendenpik, LSRN) beat LAPACK on huge least-squares problems, and sketching is used for streaming data and for low-memory optimizer states.
Where randomness pays off
- Machine learning at scale: random features for kernels (Rahimi and Recht, 2007, the NeurIPS test-of-time award), sketching for second-order optimizers, Hessian trace and spectrum estimates for loss-landscape analysis (Hutchinson, stochastic Lanczos), and low-rank gradient compression (PowerSGD, A2.3-6).
- Compressed sensing (Candès, Romberg and Tao, 2006; Donoho, 2006): random measurements of a sparse signal allow exact recovery from far fewer samples. It has been applied to MRI, single-pixel cameras and spaceborne imaging.
- Robotics: random projections speed up nearest-neighbour lookups for place recognition and loop closure in SLAM. Sketched Gaussian processes and Kalman filters scale estimation to many sensors.
- Privacy: random projections underlie some differentially private releases of data summaries.
References
- W. Johnson, J. Lindenstrauss (1984). “Extensions of Lipschitz mappings into a Hilbert space.” Contemporary Mathematics, 26.
- S. Dasgupta, A. Gupta (2003). “An elementary proof of a theorem of Johnson and Lindenstrauss.” Random Structures & Algorithms, 22(1).
- D. Achlioptas (2003). “Database-friendly random projections.” Journal of Computer and System Sciences, 66(4).
- A. Rahimi, B. Recht (2007). “Random features for large-scale kernel machines.” NeurIPS.
- M. Hutchinson (1990). “A stochastic estimator of the trace of the influence matrix for Laplacian smoothing splines.” Communications in Statistics – Simulation and Computation, 19(2).
- N. Halko, P.-G. Martinsson, J. Tropp (2011). “Finding structure with randomness.” SIAM Review, 53(2).
- K. G. Larsen, J. Nelson (2017). “Optimality of the Johnson–Lindenstrauss lemma.” FOCS.
- P.-G. Martinsson, J. Tropp (2020). “Randomized numerical linear algebra: Foundations and algorithms.” Acta Numerica, 29.
- E. Candès, J. Romberg, T. Tao (2006). “Robust uncertainty principles: exact signal reconstruction from highly incomplete frequency information.” IEEE Transactions on Information Theory, 52(2).