The probability function as a function of line length, illustrated above, was found in (nearly) closed form by Mathai et al. (1999). After simplifying, correcting typos, and completing the integrals, gives the closed form
(4)
The first even raw moments for , 2, ... are 1, 1/2, 11/30, 211/630, 187/525, 3524083/6306300, ... (OEIS A160693 and A160694).
Pick points on a cube, and space them as far apart as possible. The best value known for the minimum straight line distance between any two points is given in the following table.
Bailey, D. H.; Borwein, J. M.; Kapoor, V.; and Weisstein, E. W. "Ten Problems in Experimental Mathematics." Amer. Math. Monthly113, 481-509, 2006b.Beck, D. "Mean Distance in Polyhedra." 22 Sep 2023. https://arxiv.org/abs/2309.13177.Bolis, T. S. Solution to Problem E2629. "Average Distance between Two Points in a Box." Amer. Math. Monthly85, 277-278, 1978.Borwein, J. and Bailey, D. Mathematics by Experiment: Plausible Reasoning in the 21st Century. Wellesley, MA: A K Peters, 2003.Borwein, J.; Bailey, D.; and Girgensohn, R. Experimentation in Mathematics: Computational Paths to Discovery. Wellesley, MA: A K Peters, 2004.Finch, S. R. "Geometric Probability Constants." §8.1 in Mathematical Constants. Cambridge, England: Cambridge University Press, pp. 479-484, 2003.Ghosh, B. "Random Distances within a Rectangle and between Two Rectangles." Bull. Calcutta Math. Soc.43, 17-24, 1951.Holshouser, A. L.; King, L. R.; and Klein, B. G. Solution to Problem E3217, "Minimum Average Distance between Points in a Rectangle." Amer. Math. Monthly96, 64-65, 1989.Le Lionnais, F. Les nombres remarquables. Paris: Hermann, p. 30, 1983.Mathai, A. M.; Moschopoulos, P.; and Pederzoli, G. "Distance between Random Points in a Cube." J. Statistica59, 61-81, 1999.Robbins, D. "Average Distance between Two Points in a Box." Amer. Math. Monthly85, 278, 1978.Santaló, L. A. Integral Geometry and Geometric Probability. Reading, MA: Addison-Wesley, 1976.Schroeppel, R. (results due to R. H. Hardin and N. J. A. Sloane) "points in a cube." math-fun@cs.arizona.edu posting, May 30, 1996.Sloane, N. J. A. Sequences A073012, A160693, and A160694 in "The On-Line Encyclopedia of Integer Sequences."