Home▸AI & Machine Learning▸Random Projection Lab: How Many Dimensions Keep the Distances? Johnson-Lindenstrauss (3D)

Random Projection Lab: How Many Dimensions Keep the Distances? Johnson-Lindenstrauss (3D)

Squeeze points from a space of hundreds of dimensions into only k with a random matrix and ask how much the distances change. For one pair the ratio of squared distances is exactly chi-square(k)/k, so the chance of staying within 1 +/- epsilon is an exact number, and k about 4 ln n / (epsilon^2/2 - epsilon^3/3) keeps all n(n-1)/2 pairs. Add the rows one by one and watch the histogram narrow on a slate plinth, red lines mark the pairs that broke the limit, and a glass gauge compares the observed fraction with the exact chance. Gaussian, sparse (Achlioptas) or Rademacher matrices, 14 numerical checks.

AI & Machine Learning3DAdvanced60 FPS📱 Mobile-adapted🟠 Blender⇄ 2D version
Random Projection Lab: How Many Dimensions Keep the Distances? Johnson-Lindenstrauss (3D) ↗ Open standalone

Squeeze points from a space of hundreds of dimensions into only k with a random matrix and ask how much the distances change. For one pair the ratio of squared distances is exactly chi-square(k)/k, so the chance of staying within 1 +/- epsilon is an exact number, and k about 4 ln n / (epsilon^2/2 - epsilon^3/3) keeps all n(n-1)/2 pairs. Add the rows one by one and watch the histogram narrow on a slate plinth, red lines mark the pairs that broke the limit, and a glass gauge compares the observed fraction with the exact chance. Gaussian, sparse (Achlioptas) or Rademacher matrices, 14 numerical checks.

⚙ Under the hood

Squeeze points from a space of hundreds of dimensions into only k with a random matrix and ask how much the distances change. For one pair the ratio of squared distances is exactly chi-square(k)/k, so the chance of staying within 1 +/- epsilon is an exact number, and k about 4 ln n / (epsilon^2/2 - epsilon^3/3) keeps all n(n-1)/2 pairs. Add the rows one by one and watch the histogram narrow on a slate plinth, red lines mark the pairs that broke the limit, and a glass gauge compares the observed fraction with the exact chance. Gaussian, sparse (Achlioptas) or Rademacher matrices, 14 numerical checks.

random projectionJohnson-Lindenstrauss lemmadimensionality reductionchi-square distributionconcentration of measuresketchinghigh-dimensional data

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)