Which plane figure has the minimal mean distance between two points on its perimeter, if all figures have the same area? Suppose you have a plane figure, and you select (independently) two random points $A$ and $B$ on its perimeter, in polar coordinates, uniformly sampling angles $\theta_A, \theta_B$ and deriving the corresponding $\rho$ (constant for a circle, like this for a square, etc).
You measure the Euclidean distance $d_{AB}$ between $A$ and $B$.
You repeat this many times, and plot the distribution of $d_{AB}$.
I tried this with a circle of radius $R = 1$, and the square with the same area (i.e. with side $R \sqrt{\pi}$), sampling 2000 points (1000 pairs).
Here are the resulting distributions and plots.
For the circle:


For the square:


The shapes of the distributions are quite puzzling to me (and it would actually be interesting to know how one could obtain them).
But the main question I have in mind is:

assuming equal areas, what plane figure would have the minimal mean distance?

I would be tempted to think it's the circle, not sure why, but I just wanted to check if this had been already addressed / if you can point me to posts or websites discussing this.
Here is the R script I used to run the simulations.
# Number of pairs of points to sample
N = 1000

# Distance between two random points on the perimeter of a circle of radius R

R = 1

set.seed(12123)
theta <- runif(2 * N, 0, 2 * pi)
x <- R * cos(theta)
y <- R * sin(theta)
x1 <- x[1:N]
y1 <- y[1:N]
x2 <- x[(N + 1):(2 * N)]
y2 <- y[(N + 1):(2 * N)]
ds <- sqrt((x2 - x1)^2 + (y2 - y1)^2)
hist(ds)
plot(x, y, pch = 16, cex = 0.1, asp = 1)
segments(x1, y1, x2, y2, col = ceiling(10*ds/max(ds)) )

# Distance between two random points on the perimeter of a square of side L

L = sqrt(pi) * R

set.seed(12123)
theta <- runif(2 * N, 0, 2 * pi)
R <- pmin(L/abs(cos(theta)), L/abs(sin(theta)), na.rm = TRUE) / 2
x <- R * cos(theta)
y <- R * sin(theta)
x1 <- x[1:N]
y1 <- y[1:N]
x2 <- x[(N + 1):(2 * N)]
y2 <- y[(N + 1):(2 * N)]
ds <- sqrt((x2 - x1)^2 + (y2 - y1)^2)
hist(ds)
plot(x, y, pch = 16, cex = 0.1, asp = 1)
segments(x1, y1, x2, y2, col = ceiling(10*ds/max(ds)))


EDIT - adding the general parametric equations for sampling points on the perimeter or regular polygons with $N$ sides, based on uniformly distributed angles $\theta$:
$\left[ x=-{{R\,\left(\sin \left({{N\,\vartheta+2\,\pi}\over{
 N}}\right)-\sin \left({{N\,\vartheta-2\,\pi}\over{N}}\right)\right)
 }\over{2\,\left(\sin \left({{2\,\pi\,\left \lceil {{N\,\vartheta
 }\over{2\,\pi}} \right \rceil-N\,\vartheta-2\,\pi}\over{N}}\right)-
 \sin \left({{2\,\pi\,\left \lceil {{N\,\vartheta}\over{2\,\pi}}
  \right \rceil-N\,\vartheta}\over{N}}\right)\right)}} , y={{R\,
 \left(\cos \left({{N\,\vartheta+2\,\pi}\over{N}}\right)-\cos \left(
 {{N\,\vartheta-2\,\pi}\over{N}}\right)\right)}\over{2\,\left(\sin 
 \left({{2\,\pi\,\left \lceil {{N\,\vartheta}\over{2\,\pi}}
  \right \rceil-N\,\vartheta-2\,\pi}\over{N}}\right)-\sin \left({{2\,
 \pi\,\left \lceil {{N\,\vartheta}\over{2\,\pi}} \right \rceil-N\,
 \vartheta}\over{N}}\right)\right)}} \right] $
 A: Consider a figure composed by four concentric circle arcs, two with radius $R$ and angle $\alpha$, the other two with radius $r<R$ and angle $\pi-\alpha$ (see diagram below). Take two points at random on its perimeter, $A$ and $B$, as described in the question (that is, selecting two angles uniformly, with vertex at the center).
If both points lie on the arcs of radius $R$, which happens with probability $(\alpha/\pi)^2$, then $AB\le2R$. If both points lie on the arcs of radius $r$, which happens with probability $(1-\alpha/\pi)^2$, then $AB\le2r$. If a point lies on the small arcs and the other on the large arc, which happens with probability $2(\alpha/\pi)(1-\alpha/\pi)$, then $AB\le(r+R)$. For the average length $\bar s$ of $AB$ we have then,
setting $x=\alpha/\pi$:
$$
\bar s\le x^2\cdot2R+(1-x)^2\cdot2r+2x(1-x)(r+R),
$$
that is:
$$
\bar s\le 2Rx+2r(1-x).
$$
If we want the figure to have area $\pi$, then:
$$
x\pi R^2+(1-x)\pi r^2=\pi,
$$
that is:
$$
R=\sqrt{1-(1-x)r^2\over x}.
$$
Inserting this into the inequality for $\bar s$ we get:
$$
\bar s\le 2\sqrt{x}\sqrt{1-(1-x)r^2}+2r(1-x).
$$
For $x\to0$ we have then $\bar s\le2r$, and taking $r$ sufficiently small, we can make $\bar s$ as little as we please.

