points are drawn uniformly in the unit ball in dimensions. Show that the median distance from the origin to the nearest point is . What is its value for with and , and what does it mean for k-NN?
Supervised learning, k-nearest neighbours
Level L3 Intermediate. Length Medium. Nature Th+Mat Both.
What's being asked
Whether you can turn "volume scales as " into a distribution for the nearest neighbour distance.
Key idea
The chance a point lies within radius is , so ; set it to .
Steps
- The ball of radius has a fraction of the volume of the unit ball. So one random point falls within with probability .
- All points must fall outside for the nearest distance to exceed . They are independent, so .
- Median: , so , and .
- With : , so .
- For : . The nearest point is very close.
- For : . The nearest neighbour is more than half-way to the edge of the ball, even with 500 points.
- Meaning: in high dimensions, "nearest" neighbours are not near. The k-NN assumption that nearby points share a label fails, so k-NN bias grows. You need exponentially large in to keep the neighbourhood small.
Common mistakes
- Using with the wrong exponent, or .
- Forgetting that the probabilities are for all points together, which is the power .
- Concluding that k-NN never works in high dimensions. If the data lie near a low-dimensional manifold, the effective dimension is small.
How long your answer should be
Half a page; 5 minutes.
Last checked on 4 December 2026.
Read this
Previous in Supervised learning: A Gaussian naive Bayes classifier has two classes. Class A has prior , feature means and feature variances . Class B has prior , means and variances . Which class is the point assigned to?
Next in Supervised learning: Multiple discriminant analysis (multi-class Fisher LDA) solves . For classes in dimensions with training points, how many useful discriminant directions are there, and what goes wrong with ? How can you fix it?