Mean distance from a uniform random point of a region to its centroid
edit · history · discussion · files · short url · integral probability theory elementary geometry
Numbers
$K$ 
$M(K)$
interval of length $1$:
1/4
comment: The exact mean is $1/4$, the average of $|x-1/2|$ on $[0,1]$.
square of side $1$:
0.3825978582321063456723830081982483979329720339397639139883292244406849437806888544473490710396496026
comment: The exact mean is $(\sqrt2+\log(1+\sqrt2))/6$ [2].
rectangle of sides $1$ and $2$:
0.5932334160689498628380017801080482331770625465286820255564495349534952602600691298412400564110453052
comment: The exact mean is $[4\sqrt5+\log(2+\sqrt5)+8\log((1+\sqrt5)/2)]/24$, from the rectangle formula in [1].
equilateral triangle of side $1$:
0.2656144173368095164266632794622062876618106932826820964377825675457959010685580027909172992758110519
comment: The exact mean is $\sqrt3/9+\log(2+\sqrt3)/18$, obtained from (P1) with $n=3$ and $h=\sqrt3/6$.
disk of radius $1$:
2/3
comment: The exact mean is $2/3$, from the radial density $2r$ on $0\leq r\leq1$.
regular pentagon of circumradius $1$:
0.5836055928196374973893088151128968911905709436020110792612258719566432914545421778960333169204344102
comment: The exact mean is $\frac13[1+\cos(\pi/5)\cot(\pi/5)\log(\sec(\pi/5)+\tan(\pi/5))]$.
regular hexagon of circumradius $1$:
0.6079864055003607561821446425639647594952059727890206962670069167427069066379855750517372720367663555
comment: The exact mean is $1/3+\log3/4$, the $n=6$ case of (P1) with circumradius $1$.
regular heptagon of circumradius $1$:
0.6231148846150509845109352187097555132480694335959327454021877179936465920236810648327185983078152030
comment: The exact mean is $\frac13[1+\cos(\pi/7)\cot(\pi/7)\log(\sec(\pi/7)+\tan(\pi/7))]$.
regular octagon of circumradius $1$:
0.6331045961842020580753813506466827771748406283119455319614566089338466296016806348770708028237061591
comment: The exact mean is $\frac13[1+\cos(\pi/8)\cot(\pi/8)\log(\sec(\pi/8)+\tan(\pi/8))]$.
cube of side $1$:
0.4802959782275264797125539756969031801204884537728619938454492576551938316700816445156139678458874123
comment: The exact mean is $\sqrt3/8+\log(2+\sqrt3)/4-\pi/48$, half the corner-distance box integral $B_3(1)$ of [2].
solid ball in $\mathbb R^3$ of radius $1$:
3/4
comment: The exact mean is $3/4$, from the radial density $3r^2$ on $0\leq r\leq1$.
circle of radius $1$:
1
comment: Every point has distance exactly $1$ from the centroid.
sphere in $\mathbb R^3$ of radius $1$:
1
comment: Every point has distance exactly $1$ from the centroid.
Definition
For a bounded region $K$ with specified uniform probability measure $\mu_K$ and centroid $c_K=\int_K x\,d\mu_K(x)$, the mean Euclidean distance to its centroid is $M(K)=\int_K\|x-c_K\|_2\,d\mu_K(x)$ [1] [2].
Parameters
$K$
—   region (A bounded Euclidean region with positive finite intrinsic measure and a specified size. Uniformity is with respect to length, area or volume in the region, or arc length or surface area on a circle or sphere.)
Formulas
(1)
$M(aK+b)=aM(K)$ for $a>0$ and a translation vector $b$, with the corresponding uniform measure on the transformed region.
(P1)
For a regular $n$-gon with $n\geq3$, inradius $h$ and $\theta=\pi/n$, $M(K)=\frac h3\bigl[\sec\theta+\cot\theta\log(\sec\theta+\tan\theta)\bigr]$. If the circumradius is $R$, then $h=R\cos\theta$; if the side length is $a$, then $h=(a/2)\cot\theta$ [1].
(3)
For a rectangle of side lengths $a,b>0$, put $d=\sqrt{a^2+b^2}$. Then $M(K)=[2abd+a^3\log((b+d)/a)+b^3\log((a+d)/b)]/(12ab)$ [1].
(4)
For the solid ball $B_R^d\subset\mathbb R^d$ of radius $R$, with $d\geq1$, the radial density is $d r^{d-1}/R^d$ on $0\leq r\leq R$, so $M(B_R^d)=dR/(d+1)$.
(5)
For the sphere $S_R^{d-1}=\{x\in\mathbb R^d:\|x\|_2=R\}$ with uniform surface measure, $M(S_R^{d-1})=R$.
Comments
(6)
The interval has length $1$. The square, cube and equilateral triangle have side $1$, and the rectangle has sides $1$ and $2$. The disk, solid ball, circle and sphere have radius $1$. The regular pentagon, hexagon, heptagon and octagon have circumradius $1$, as in the corresponding planar domains.
(7)
The interval, polygons, disk, cube and solid ball carry normalized Lebesgue measure in their dimensions. The circle carries normalized arc length, and the sphere carries normalized surface area. Their centroids are their geometric centers. On the circle and sphere the distance is measured in the ambient Euclidean space.
(9)
The interval, disk, solid-ball, circle and sphere means are stored exactly. Each remaining entry is a certified decimal enclosure, with an exact expression in its comment. All logarithms are natural.
Programs
(P1)
Sage
# Mean distance to the centroid of a regular n-gon of circumradius R.
import numberdb.sage as numberdb
from sage.rings.real_arb import RealBallField

def mean_regular_polygon(n, R=1, digits=100):
    if n < 3:
        raise ValueError("n must be at least 3")
    F = RealBallField(numberdb.bits(digits, losing=80))
    theta = F.pi()/n
    h = F(R)*theta.cos()
    return h/3*(1/theta.cos()
                +(1/theta.cos()+theta.tan()).log()/theta.tan())

print(mean_regular_polygon(6))
References
[1]
H. Li and X. Qiu, Moments of Distance from a Vertex to a Uniformly Distributed Random Point within Arbitrary Triangles, Mathematical Problems in Engineering 2016 (2016), Article 8371750, 10 pages. (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)
Links
Similar tables
Mean distance between two uniform random points of a region —   Both endpoints are sampled independently, instead of fixing one at the centroid.
Areas of regular polygons —   Areas used to normalize the uniform measure on regular polygons.
Volumes of unit balls —   Volumes used to normalize the uniform measure on disks and solid balls.
Surface areas of unit spheres —   Surface measures used to normalize the uniform measure on circles and spheres.
Data properties
Entries are of type: real number
digits: 100 (Unknown key)
Table is complete: no (it holds thirteen classical sampling benchmarks: the unit interval, unit square, $1\times2$ rectangle, unit-side equilateral triangle, unit-radius disk, regular polygons with five through eight sides and circumradius $1$, unit cube, unit-radius solid ball in $\mathbb R^3$, unit circle and unit sphere in $\mathbb R^3$; this selection covers regular polygons with three through eight sides in the stated normalizations and familiar low-dimensional boxes and round regions without imposing an aspect-ratio or dimension grid)
Sources of data: [1], [2]
How they were obtained:

The eight irrational entries are evaluated throughout in Arb ball arithmetic, using 80 guard bits beyond 100 significant digits. The largest measured ball radius is less than $4.3\times10^{-124}$, and every relative radius is less than $10^{-120}$. The five rational entries are returned exactly. The regular-polygon and rectangle closed forms are given in equation (23) and Examples 1–3 of [3]. The square and cube forms follow from equation (4) and Section 7 of [4].

more

Independent quadratures integrate the radial distance density for polygons and balls, polar coordinates for rectangles, and a face-pyramid decomposition for the cube. They are run at 130 and 170 decimal digits, after normalization and second-moment controls, and agree with every closed form to absolute tolerance $10^{-120}$. Scaling is checked for every region. These numerical quadratures are agreement checks; the certified error bounds come from Arb evaluation of the closed forms. Direct uniform sampling of 300000 points in each region also checks the centroid, second moment and mean. The attached checks can compare all independent values and certified balls with the intervals read from the database.