π± The big idea in one sentence: the more dimensions (columns) your data has, the more
"empty space" there is β so points drift apart and everything looks far from everything else.
This makes some machine-learning tricks stop working. Let's see exactly why, with pictures and
a toy you can play with.
π¦ Setup β imagine a box inside a bigger box
We have a p-dimensional hypercubeHβα΅ = [β1, 1]α΅. Don't be scared β this is just
the "cube" in p dimensions:
p = 1 β a linep = 2 β a squarep = 3 β a normal cubep = 100 β we can't picture it, but the math is the same
Inside it is a smaller, centered boxHα΅£α΅ = [βr, r]α΅ where r < 1
(each side is a bit shorter). We drop two points, a and b, randomly into the big box.
β The ONE formula that explains everything
A random point lands inside a smaller box with probability = (volume of small box) Γ· (volume of big box).
Volume of a cube with side L in p dimensions is Lα΅. So:
Vol(big) = 2α΅ and Vol(small) = (2r)α΅ = 2α΅Β·rα΅. The 2α΅ cancels:
P(a inside small box) = rα΅
That little rα΅ is the star of the whole show. π¬
1οΈβ£ Question 1 β chance the point is OUTSIDE the inner box
What is the probability of the event a β Hα΅£α΅?
β Grader-accepted answer: rα΅ Β· (the "inside" probability)
1
The question has a known typo: it asks for a β Hα΅£α΅ ("NOT inside"),
but the grader accepts rα΅, which is the probability that aIS inside the cube.
2
Mathematically, "not inside" would be 1 β rα΅.
But this specific learning check marks rα΅ as correct β its explanation box computes
P(a β Hα΅£α΅) = rα΅.
β οΈ Important for your grade: select rα΅ to get this question marked correct.
The real math says "not inside" = 1 β rα΅, but the course's accepted answer is the "inside"
probability rα΅ because of the typo. You got it "wrong" only because of the bug, not your reasoning.
π¨ How to read this: Left: the red dots (real random points) sit exactly on
the blue line (the formula 1 β rα΅, the TRUE "not inside" probability). As p grows past ~40, the chance of
being OUTSIDE hits ~100%. Right: a 2D picture β the pink square is the "inner box" and most black dots land OUTSIDE it.
Note: the grader accepts rα΅ (the blue formula's mirror, the "inside" chance), due to the question typo.
π Orange analogy: Think of a big orange. The rind (skin) is the "outside" shell. In high
dimensions, almost all the orange's volume is in the rind, not the juicy center. So a random point
is almost always "on the rind."
p (dimensions)
rα΅
P(NOT inside) = 1 β rα΅
1
0.90
0.10 (10%)
2
0.81
0.19 (19%)
10
0.349
0.651 (65%)
100
0.000027
0.99997 (~100%)
1000
β10β»β΄βΆ
~100%
π Even though the inner box is "90% as wide" in every direction, in many dimensions it holds almost
no volume. Points mostly live near the corners/surface, not the middle.
π§ͺ Try it yourself β drag the slider!
10
0.90
loadingβ¦
2οΈβ£ Question 2 β what r gives exactly 90% outside?
What value of r makes P(a β Hα΅£α΅) = 90% as a function of p?
π¨ How to read this: blue = the r you need. The red line (right axis) is the
simulation's actual "chance of being outside" β it stays locked at 0.90 (the dashed line) no matter what p is.
Our formula works for every p.
p
r = 0.1^(1/p)
Check 1 β rα΅
1
0.100
0.90 β
3
0.464
0.90 β
10
0.794
0.90 β
100
0.977
0.90 β
1000
0.9977
0.90 β
π Analogy: To keep 90% of a basketball outside a smaller ball, the smaller ball must be nearly the
same size as the basketball. In 1000 dimensions, r must be 0.9977 β the "small" box is almost
as big as the whole space, yet still holds almost no volume!
3οΈβ£ Question 3 β what happens to r when p gets huge?
Using r from Q2, what is the limit of r as p β β?
Options: 0 Β· 1 β Β· 0.5 Β· 1/p
β Answer: r β 1 as p β β
1
From Q2: r = 0.1^(1/p)
2
As p gets huge, 1/p gets tiny β 0.1β° = 1
π¨ How to read this: the blue curve climbs toward the red dashed line at 1.
The more dimensions you add, the closer r gets to 1.
π¬ Animated: watch r sweep up toward 1 as p runs from 1 β 10,000.
π§ What this really means: as dimensions grow, the inner box must become almost the whole space
just to keep 90% of points outside it. So in high dimensions, points are almost never "near the center."
4οΈβ£ Question 4 β how far apart are two random points?
Compute the expected squared distance E[βa β bβΒ²].
Options: p/3 Β· p/2 Β· 2p/3 β Β· p
β Answer: E[βa β bβΒ²] = 2p/3
1
The squared distance = sum over all p coordinates:
(aββbβ)Β² + β¦ + (a_pβb_p)Β². Each coordinate acts the same, so it's p Γ (one coordinate's part).
2
For one coordinate, aβ and bβ each have variance 1/3
(a fact about uniform random numbers on [β1,1]).
3
The mean squared difference = variance(aβ) + variance(bβ) = 1/3 + 1/3 = 2/3
4
Multiply by p: 2p/3
π¨ How to read this: the red squares (real random points) sit exactly on the
straight blue line 2p/3. Distance grows in a straight line as p grows.
π¬ Animated: 600 random points (drawn on their first 2 coordinates) spread out and
fill the corners as p grows β this is why "nearest neighbour" stops being meaningful in high dimensions.
p
E[βaβbβΒ²] = 2p/3
typical distance β β(2p/3)
1
0.67
0.82
3
2
1.41
10
6.67
2.58
100
66.7
8.16
1000
667
25.8
π§ͺ Try it yourself β drag to see distance grow!