Data are spread uniformly in the unit hypercube [0,1]d. A nearest-neighbour method uses a small cube around each point that contains 1% of the data. What edge length must that cube have for d=1, 10 and 100, and what does this say about local methods in high dimensions?

Foundations, Curse of dimensionality
Level L2 Elementary. Length Medium. Nature Th+Mat Both.

What's being asked

Whether you can turn the vague phrase “curse of dimensionality” into a concrete calculation and draw the right conclusion.

Key idea

A cube with edge length e inside [0,1]d has volume ed, so it holds a fraction ed of uniform data. To hold a fraction r we need e=r1/d. As d grows this tends to 1, so a “local” neighbourhood stops being local.

Steps

  1. Set up the equation. A cube of edge e has volume ed. Setting ed=r gives ed(r)=r1/d.
  2. Plug in r=0.01. For d=1: e=0.01. For d=10: e=0.011/10=10−0.2≈0.63. For d=100: e=10−0.02≈0.955.
  3. Interpret. In 10 dimensions, to catch just 1% of the data you must cover 63% of the range of every feature. The “nearest” neighbours are far away, so averaging them is no longer a local estimate, and the bias of k-NN grows.
  4. Give a second view. The fraction of the cube within 0.05 of its boundary is 1−(1−2×0.05)d=1−0.9d. This is 0.1 for d=1, about 0.65 for d=10 and about 0.99997 for d=100. Almost every point is near an edge, where prediction becomes extrapolation.
  5. State the consequence. To keep the same density of samples, n must grow exponentially with d: if n1 points are enough in one dimension, you need about n1 d. Remedies are feature selection, dimensionality reduction, and models with strong built-in structure. Real data usually lie near a low-dimensional curved surface (a manifold), which is why learning still works.

Common mistakes

How long your answer should be

3–4 minutes: the formula, the three numbers, then two sentences of interpretation.

Last checked on 4 December 2026.

Read this

Previous in Foundations: What is k-fold cross-validation, how do the bias and the computation cost of the error estimate change with k, and why are k=5 and k=10 the usual choices?
Next in Foundations: What is pool-based active learning, and if a three-class classifier outputs predicted probabilities (0.50,0.45,0.05), (0.40,0.30,0.30) and (0.85,0.10,0.05) for unlabelled points A, B and C, which point do least-confidence and margin sampling query first?