Mean distance between two uniform random points of a region
edit · history · discussion · files · short url · integral probability theory elementary geometry
Numbers
$K$ 
$\Delta(K)$
interval of length $1$:
1/3
comment: The exact mean is $1/3$ [2].
square of side $1$:
0.5214054331647206783309823566072439749140315677790083417962105187505078933048158318679281329252614525
comment: The exact mean is $(2+\sqrt2+5\log(1+\sqrt2))/15$ [2].
rectangle of sides $1$ and $2$:
0.8047718415129873521721811982447313682538674432192283326666918843192734681710528849264741093309313292
comment: The exact mean is $(33-5\sqrt5)/60+(11/12)\log((1+\sqrt5)/2)$, the $a=1$, $b=2$ case of [1], equation (1.4).
equilateral triangle of side $1$:
0.3647918433002164537092867855383788556971235836734124177602041500456241439827913450310423632220598133
comment: The exact mean is $1/5+(3/20)\log3$ [1].
disk of radius $1$:
0.9054147873672267990407609649636372595738148735457077973200631128683906709858220662904251890702397779
comment: The exact mean is $128/(45\pi)$ [1].
cube of side $1$:
0.6617071822671762351558311332484135817464001357909536048089442294795846461385976313066524807681071202
comment: This is the Robbins constant: $[4+17\sqrt2-6\sqrt3+21\log(1+\sqrt2)+42\log(2+\sqrt3)-7\pi]/105$ [2].
solid ball in $\mathbb R^3$ of radius $1$:
36/35
comment: The exact mean is $36/35$, obtained from the solid-ball distance density in [3], equation (15).
circle of radius $1$:
1.273239544735162686151070106980114896275677165923651589981338752471174381073812280720910422130024688
comment: The exact mean chord length is $4/\pi$.
sphere in $\mathbb R^3$ of radius $1$:
4/3
comment: The exact mean chord length is $4/3$.
Definition
For a region $K$ with the specified uniform probability measure $\mu_K$, $\Delta(K)=\mathbf E\|X-Y\|_2$ is the mean Euclidean distance between two independent points $X,Y$ sampled from $\mu_K$, also called the mean length in line picking [2] [1].
Parameters
$K$
—   region (A bounded Euclidean region with positive finite length, area or volume in its dimension, with its size and uniform measure specified.)
Formulas
(1)
$\Delta(aK)=a\Delta(K)$ for $a>0$, with uniform measure on the scaled region.
(2)
For the circle $C_R$ of radius $R$, $\Delta(C_R)=\pi^{-1}\int_0^\pi 2R\sin(\theta/2)\,d\theta=4R/\pi$, where $\theta$ is the smaller angle between the two radius vectors.
(3)
For the sphere $S_R^2\subset\mathbb R^3$ of radius $R$, $\Delta(S_R^2)=\tfrac12\int_{-1}^1 R\sqrt{2-2u}\,du=4R/3$, where $u$ is the cosine of the central angle.
Comments
(4)
On the interval, polygons, disk, cube and solid ball, uniformity means normalized Lebesgue measure in the corresponding dimension. On the circle and sphere, it means normalized arc length and surface area, respectively. Distances on the circle and sphere are straight chord lengths in the ambient Euclidean space.
(5)
The labels fix every length normalization. The square and cube have side $1$, the rectangle has sides $1$ and $2$, the equilateral triangle has side $1$, and the disk, solid ball, circle and sphere have radius $1$.
(7)
The interval, three-dimensional solid ball and two-dimensional sphere have rational means, which are stored exactly. The remaining entries are certified decimal enclosures of the closed forms in their comments.
Programs
(P1)
Sage
# Mean distance inside a cube of side 1, in certified ball arithmetic.
import numberdb.sage as numberdb
from sage.rings.real_arb import RealBallField
R = RealBallField(420)
s, t = R(2).sqrt(), R(3).sqrt()
mean = (4 + 17*s - 6*t + 21*(1+s).log()
        + 42*(2+t).log() - 7*R.pi()) / 105
print(mean)
References
[1]
N. G. Aharonyan, Mean distance between two points in a domain, Proceedings of the Yerevan State University, Physical and Mathematical Sciences 46(3) (2012), 3–8. (doi)
[2]
D. H. Bailey, J. M. Borwein and R. E. Crandall, Box integrals, Journal of Computational and Applied Mathematics 206 (2007), 196–208. (doi)
[3]
S.-J. Tu and E. Fischbach, Random distance distribution for spherical objects: general theory and applications to n-dimensional physics, Journal of Physics A: Mathematical and General 35 (2002), 6557–6570. (arXiv) (doi)
Links
Similar tables
Areas of regular polygons —   Areas of the regular polygons used as planar regions.
Volumes of unit balls —   Volumes used to normalize uniform measure on disks and solid balls.
Surface areas of unit spheres —   Surface measures used to normalize uniform measure on circles and spheres.
Data properties
Entries are of type: real number
digits: 100 (Unknown key)
Table is complete: no (it holds nine classical low-dimensional line-picking examples: the unit interval, unit square, $1\times2$ rectangle, unit-side equilateral triangle, unit-radius disk, unit cube, unit-radius solid ball in $\mathbb R^3$, unit circle and unit sphere in $\mathbb R^3$; these standard shapes provide closed-form benchmarks for uniform sampling without imposing an aspect-ratio or dimension grid)
Sources of data: [1], [2], [3]
How they were obtained:

The six decimal entries are obtained by evaluating closed forms throughout in Arb ball arithmetic with 80 guard bits beyond the 100 significant digits stored. The largest measured ball radius at this precision is less than $3\times10^{-124}$. The interval, solid-ball and sphere values are returned as exact rationals. The planar closed forms come from [1] (publisher copy [4]); the square and cube formulas come from [2] (author preprint [5]). The solid-ball density is from [3].

more

Independent computations integrate coordinate-difference densities for the boxes, the triangle covariogram for the equilateral triangle, overlap densities for the disk and solid ball, and uniform angular or surface-coordinate densities for the circle and sphere. Their normalization controls, known moments and scaling checks are run before the means are compared. Numerical quadratures at 130 and 170 decimal digits agree to an absolute tolerance of $10^{-120}$ and lie inside every stored 100-digit interval. These quadratures provide an independent check, not the proof of their error bounds; the certified enclosures come from Arb applied to the closed forms. The solid-ball density is also integrated with exact rational arithmetic. The attached checks reproduce these comparisons and can check the values read from the database.