On this page
Your sense of space was trained in three dimensions. Machine learning works in hundreds, and there that sense misleads you. Here are three surprises, worked for n = 2, 10 and 100.
What is the curse of dimensionality?
The curse of dimensionality is the set of problems that appear when data lives in many dimensions: the volume of the space grows so fast that any fixed amount of data becomes sparse (Wikipedia: Curse of dimensionality). The phrase was coined by the mathematician Richard Bellman, as Pedro Domingos of the University of Washington recounts in his review A few useful things to know about machine learning (Communications of the ACM, 2012).
A dimension is just one number needed to describe a thing. Your marks in physics, chemistry and maths make a point in 3 dimensions; a 28 × 28 greyscale photo is a point in 784.
Why is most of a high-dimensional cube near its surface?
Domingos puts it vividly: "most of the volume of a high-dimensional orange is in the skin, not the pulp" (Domingos, 2012). Here is the arithmetic.
Take a cube of side 1 in n dimensions, and call a point near the surface if it lies within 0.05 of any face. The points that are not near the surface form a smaller cube of side 0.9, whose volume is 0.9ⁿ. So the share near the surface is 1 − 0.9ⁿ (our calculation).
n = 2 (a square): 1 − 0.81 = 0.19, so 19% of the area is in the thin border.
n = 10: 1 − 0.349 = 0.651, so 65% of the volume is near a face.
n = 100: 1 − 0.0000266, so 99.997% of the volume is near a face.
The border did not thicken; there are just more directions in which to be near an edge.
The same effect shrinks a ball inside a cube; see the volume of an n-dimensional ball. If four dimensions already feel slippery, start with how to build and count a 4D hypercube.
Why do random points become equally far apart?
Domingos describes the second surprise plainly: "in high dimensions all examples look alike", so as dimension grows, the choice of nearest neighbour becomes "effectively random" (Domingos, 2012).
Here is why. For two random points in the unit cube, the squared gap in each coordinate averages 1/6, so the root-mean-square distance is √(n/6): 0.58 for n = 2, 1.29 for n = 10 and 4.08 for n = 100 (our calculation). The spread does not grow with it; for large n the standard deviation settles near 0.24. So in 100 dimensions almost every pair is about 4.1 apart, give or take a quarter, and the spread shrinks from about 19% of the distance at n = 10 to 6% at n = 100. When everything is equally far, "closest" tells you little.
How many samples does a grid need in n dimensions?
To cover a line segment at spacing 0.1 you need 10 points. A square needs 10 × 10 = 100. A 10-dimensional cube needs 10¹⁰, ten billion. A 100-dimensional cube needs 10¹⁰⁰. At spacing 0.01 a 10-dimensional cube needs 10²⁰ points (Wikipedia: Curse of dimensionality).
Domingos gives the data-side view: even with 100 dimensions and a trillion training examples, the data "covers only a fraction of about 10⁻¹⁸ of the input space" (Domingos, 2012).
What does the curse of dimensionality mean for machine learning?
Three lessons follow from Domingos's review (Domingos, 2012):
More features can hurt. One might think extra features never hurt, but "their benefits may be outweighed by the curse of dimensionality." In his example, 98 irrelevant features swamp the signal in the 2 that matter, and a nearest-neighbour classifier guesses at random.
Real data is kinder than random data. Examples usually sit near a lower-dimensional surface, which he calls the "blessing of non-uniformity": nearest neighbour works for handwritten digits even though each image has one dimension per pixel.
So reduce before you search. Methods such as principal component analysis, explained with a worked example, find the few directions where the data actually varies.
Before adding features to a model, run this check:
Count examples per feature. If features grow faster than data, expect trouble.
Keep a feature only if it plausibly carries signal, not because it is available.
For a few points, compare nearest and farthest distances. A ratio near 1 means nearest neighbour and clustering will struggle.
Try a few principal components instead, and keep them if they do as well.
All of this rests on Class 11 and 12 ideas: powers, limits such as 0.9ⁿ → 0, independent events and averages. If one feels shaky, the Fermi Concept Library has a lesson for every concept in mathematics and computing, with its place in the map, and the Fermi Problem Library works problems step by step, explaining the reasoning rather than printing an answer.
Try it now: work out 1 − 0.9ⁿ for n = 3 and n = 20, and watch the skin swallow the orange.



