Advanced Machine Learning

07: Curse of Dimensionality

Schedule (you are here )

# date topic description
124-Aug-2026Introduction
226-Aug-2026Foundations of learningDrop/Add
331-Aug-2026PAC learnabilityHW1
402-Sep-2026Linear learning models
507-Sep-2026Labor Day HolidayHoliday
609-Sep-2026Principal Component AnalysisProject ideas
714-Sep-2026Curse of DimensionalityHW2, HW1 due
816-Sep-2026Bayesian Decision Theory
921-Sep-2026Parameter estimation: MLE
1023-Sep-2026Parameter estimation: MAP & NBfinalize teams
1128-Sep-2026Logistic RegressionHW3, HW2 due
1230-Sep-2026Kernel Density Estimation
1305-Oct-2026Support Vector Machines
1407-Oct-2026Matrix Factorization
1512-Oct-2026* MidtermExam, HW3 due
1614-Oct-2026k-means clustering
1719-Oct-2026Invited: Intro to Causal Learning I
# date topic description
1821-Oct-2026Invited: Intro to Causal Learning II
1926-Oct-2026* Mid-point projects checkpointHW4, P
2028-Oct-2026Expectation Maximization
2102-Nov-2026Stochastic Gradient Descent
2204-Nov-2026Automatic Differentiation
2309-Nov-2026Nonlinear embedding approachesHW5, HW4 due
2411-Nov-2026Model comparison
2516-Nov-2026Model Calibration
2618-Nov-2026Convolutional Neural Networks
2723-Nov-2026Thanksgiving BreakHoliday
2825-Nov-2026Thanksgiving BreakHoliday
2930-Nov-2026Word Embedding
3002-Dec-2026Project Final PresentationsHW5 due, P
3107-Dec-2026Presentation spillover / Exam prepClasses End
3209-Dec-2026* Final ExamExam
3316-Dec-2026Project Reportsdue
3417-Dec-2026Grades due 5 p.m.PAWS

Outline of this lecture

  • Curse of dimensionality

Curse of dimensionality

watermelon cover

How much rind?

Step 1/8: Real Watermelon
Dim: D = 1, Rind: ε = 15%
Flesh: (1 − ε)D = 85.0%
Rind: 1 − (1 − ε)D = 15.0%
15%

Generalized Pythagoras Theorem

Generalized Pythagoras $ D^2 = \sum_{i=1}^{n} x^2_{i} $
Trapezoid
Trapezoid rule

Stirling approximation for $n!$

  • $\ln n! = \sum_{k=1}^n \ln k$
  • $\int_1^n \ln x dx$
  • $\int_1^n \ln x dx = n\ln n -n +1$
  • $\int_1^n \ln x dx \sim {1 \over 2}\ln 1 + \ln 2 + \ln 3 + \dots + {1 \over 2}\ln n$
  • $\sum_{k=1}^n \ln k \sim n\ln n - n + 1 + {1 \over 2}\ln n$
  • $n! \sim Cn^ne^{-n}\sqrt{n}$
  • $C = \sqrt{2\pi}$
  • $n! \sim n^ne^{-n}\sqrt{2\pi n}$

Stirling approximation for $n!$

$n$ Stirling True Stirling/True
1 0.92214 1 0.92214
2 1.91900 2 0.95950
3 5.83621 6 0.97270
4 23.50618 24 0.97942
5 118.01917 120 0.98349
6 710.07818 720 0.98622
7 4,980.3958 5,040 0.98817
8 39,902.3955 40,320 0.98964
9 359,536.87 362,880 0.99079
10 3,598,695.6 3,628,800 0.99170

$\Gamma$ (Gamma) function

  • $\Gamma(n) = \displaystyle\int_0^{\infty} x^{n-1}e^{-x}dx$
  • Integration by parts: $\int udv = uv - \int vdu$
  • $u=x^{n-1}$, $dv = e^{-x}dx$, $du = (n-1)x^{n-2}dx$, $v = -e^{-x}$
  • $\Gamma(n) = -e^{-x}x^{n-1} \displaystyle|_0^{\infty} + (n-1)\int_0^{\infty} x^{n-2}e^{-x}dx$
  • $\Gamma(n) = (n-1)\Gamma(n-1)$
  • $\Gamma(1) = 1$
  • $\Gamma(n) = (n - 1)!$

$\Gamma({1 \over 2})$

  • $\Gamma({1 \over 2}) = \displaystyle\int_0^{\infty} x^{-{1 \over 2}}e^{-x}dx$
  • Set $x = t^2$, follows $dx = 2tdt$
  • $\Gamma({1 \over 2}) = 2 \displaystyle\int_0^{\infty} e^{-t^2}dt = \displaystyle\int_{-\infty}^{\infty} e^{-t^2}dt$
  • $\Gamma^2(\frac{1}{2}) = \displaystyle\int_{-\infty}^{\infty}\displaystyle\int_{-\infty}^{\infty} e^{-(x^2+y^2)dxdy}$
  • $\Gamma^2(\frac{1}{2}) = \displaystyle\int_{0}^{2\pi}\int_{0}^{\infty} r e^{-r^2} dr d\theta$
  • $\Gamma^2(\frac{1}{2}) = \pi $
  • $\Gamma(\frac{1}{2}) = \sqrt{\pi} $

Hypersphere Volume

  • $\mbox{volume} = C_n r^n$
  • $C_1 = 2$, $C_2 = \pi$, $C_3 = \frac{4\pi}{3}$
  • $\mbox{surface area} = \frac{dV_n(r)}{dr} = n C_n r^{n-1}$
  • $\left(\frac{dV_n(r)}{dr}\right)dr = n C_n r^{n-1}dr$
  • \begin{align} \Gamma^n\left(\frac{1}{2}\right) = \pi^{n/2} &= \displaystyle \int_0^{\infty} e^{-r^2} \left(\frac{dV_n(r)}{dr}\right)dr \\ & = \frac{nC_n}{2} \displaystyle \int_0^{\infty} e^{-t} t^{n/2-1}dt \\ & = \frac{nC_n}{2} \Gamma\left(\frac{n}{2}\right)\\ & = C_n \Gamma\left(\frac{n}{2} + 1\right) \end{align}

hyperSphere Volume

\begin{align} C_n &= \frac{\pi^{n/2}}{\Gamma(\frac{n}{2} + 1)}\\ C_nr^n & = \frac{(\pi r^2)^k}{k!} \to 0 \\ & \mbox{ as } k\to\infty \end{align}
Dimension $n$ Coefficient $C_n$
1 2 = 2.0000...
2 $\pi$ = 3.14159...
3 $4\pi/3$ = 4.18879...
4 $\pi^2/2$ =4.93480...
5 $8\pi^2/15$ =5.26379...
6 $\pi^3/6$ =5.16771...
7 $16\pi^3/105$ =4.72477...
8 $\pi^4/24$ =4.05871...
9 $32\pi^4/945$ =3.29851...
10 $\pi^5/120$ =2.55016...
$2k$ $\pi^k/k!$ $\to 0$

In a general hyperwatermelonsphere

\begin{align} \frac{C_nr^n - C_nr^n(1-\epsilon)^n}{C_nr^n} &= 1 - (1-\epsilon)^n\\ \frac{V_{rind}}{V_{total}} &= 1 - (1 - r)^d \end{align}

Fraction of volume

\[ \frac{V_{rind}}{V_{total}} = 1 - (1 - \epsilon)^D \]
What volume fraction of a hyper-melon does the rind occupy if it takes up an $\epsilon$ fraction of its radius?
fraction

Gaussian distribution

\[ G({\bf x}) = \frac{1}{(2\pi)^{K/2} |{\bf C}|^{1/2}} e^{-\frac{1}{2}{\bf x}^{\;{\rm T}} {\bf C}^{-1} {\bf x}} \]
What's the probability of a random sample falling on a radius $r$ "shell" around the mean? density estimation

What if the flesh isn't in the center?

Question: What is the probability of randomly hitting the flesh?

Local minima and multiple starts

blackboard
Cosines Law
Law of cosines

Angles between vectors

  • $\cos\theta = \frac{1}{\sqrt{n}} \to 0$ and $\theta \to \frac{\pi}{2}$
  • $\cos\theta = \frac{\sum_{k=1}^n x_k y_k}{XY}$
  • Draw vectors to two random points $(\pm 1, \pm 1, \pm 1. \dots, \pm 1)$
  • $\cos\theta = \frac{\sum_{k=1}^n (\pm 1)}{n} \stackrel{a.s.}\to 0$, as $n \to \infty$

Angles between vectors

Dim: D = 2
Mean Angle: θ̄ = 90.0°
Std Dev: σθ ≈ 40.5°
Near-Orthogonal (90±10°): 11.1%
D = 2: Angles are uniformly spread across 0° to 180°.
2
3D:

Probability of orthogonality

angles orth

Estimating probability

density estimation
Question: What's the minimum number of samples we need to estimate a $d$ dimensional density in a cube?

4x4 paradox

4x4 paradox

Alternative distances

L₂ (Euclidean Norm)
‖x‖2 = √(x12 + x22) = 1
Probe: x = (0.80, 0.60)
‖x‖1 = 1.40  |  ‖x‖2 = 1.00
‖x‖p = 1.00  |  ‖x‖∞ = 0.80
Click/drag canvas to move probe x
2.0

Conditions on a metric

  1. $D(x,y) \ge 0$ (non-negative)
  2. $D(x,y) = 0$ iff $x=y$ (identity)
  3. $D(x,y) = D(y,x)$ (symmetry)
  4. $D(x,y) + D(y,z) \ge D(x,z)$ (triangle inequality)

Case study: an average human

average human

Take-home message

"Abandon common sense, all ye who enter $\mathbb{R}^D$ ($D \gg 3$)."
  • 🍉 Melons: All rind, no flesh — everything is on the surface ($1 - (1-\epsilon)^D \to 1$)
  • 🦔 Hypercubes: All thorns, no body — volume lives in the diagonal corners
  • 📐 Random vectors: Almost surely perpendicular ($\theta \stackrel{a.s.}\to 90^\circ$)
  • 📏 Distances: Everything is equidistant ($(d_{\max} - d_{\min})/d_{\min} \to 0$)
  • 👤 Average human: A pure myth — everyone is an extreme outlier
Our 3D intuition is a local illusion. In high dimensions, you must trust the math.

Reading list

  • p. 33 of "Pattern recognition and Machine Learning" by C. Bishop
  • p. 22 of "The Elements of Statistical Learning" by T. Hastie, R. Tibshirani, and J. Friedman
  • Chapter 9 of "The Art of Doing Science and Engineering: Learning to Learn" by R. Hamming