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.
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.
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.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install