Suppose $M$ is a compact subset of the separable Hilbert space $l_2$. Suppose, $X$ and $Y$ are i.i.d. random vectors with support in $M$. What is the largest possible $E \| X - Y \| $?
Suppose $M$ is a compact subset of the separable Hilbert space $l_2$. Then $M$ is closed and bounded, and there exist such $x$ and $y$ in $M$, such, that $\| x - y \| = \operatorname{diam}(M)$. Now, suppose $X$ and $Y$ are i.i.d. random vectors, such that $P(X = x) = P(X = y) = \frac{1}{2}$. One can see, that
$$E\| X - Y \| = \frac{1}{4}\| x - x \| + \frac{1}{4}\| x - y \| + \frac{1}{4}\| y - x\| + \frac{1}{4}\| y - y \| = \frac{1}{2}\operatorname{diam}(M)$$
Now let’s prove that it is the maximal possible expected distance, or to be more exact, that if $X = (X_n)_{i = 1}^{\infty}$ and $Y = (Y_n)_{i = 1}^{\infty}$ are i.i.d. random vectors with support in $M$, then $E\| X - Y \| \leq \frac{1}{2}\operatorname{diam}(M)$. By Hölder inequality:
$$E\| X - Y \| \leq \left(E(\| X - Y \|^2)\right)^{\frac{1}{2}}.$$
And one can see, that
\begin{align*} E(\| X - Y \|^2) &= E\langle X - Y, X - Y \rangle = 2E\langle X, X \rangle - 2E\langle X, Y \rangle \\ &= 2\left(\sum_{n = 1}^\infty E(X_n)^2 - \sum_{n = 1}^\infty EX_n Y_n \right) \\ &= 2\left(\sum_{n = 1}^\infty E(X_n)^2 - \sum_{n = 1}^\infty EX_n EX_n\right ) \\ &\leq 2\left(\sum_{n = 1}^\infty E(X_n)^2 \right) \\ &= 2E\langle X, X \rangle = 2E(\| X \|^2) \end{align*}
Now, suppose, that the least closed ball containing $M$ is the closed ball with radius $\frac{1}{2}$ and center $0$. That will result in $\| X \|$ being a random variable on $[-1, 1]$. So, its second moment does not exceed $\frac{1}{4}$ (There are several proofs of this fact here: What is the largest possible variance of a random variable on $[0; 1]$?), and we get $E\| X - Y \| \leq \frac{1}{\sqrt{2}}$.
And now let’s return to the general case. Suppose $z$ is the center of the least closed ball containing $M$. Then $\frac{M - z}{\operatorname{diam}(M)}$ is such a subset, that the least closed ball containing it is the closed ball with radius $\frac{1}{2}$ and center $0$. So
$$E\| X - Y \| = \operatorname{diam}(M)E \left\| \frac{X - z}{\operatorname{diam}(M)} - \frac{Y - z}{\operatorname{diam}(M)}\right\| \leq \frac{1}{\sqrt{2}}\operatorname{diam}(M)$$
So we know, that the largest possible $E\| X - Y \|$ we search is certainly $\geq \frac{1}{2}\operatorname{diam}(M)$ and certainly $\leq \frac{1}{\sqrt{2}}\operatorname{diam}(M)$. However, I do not know, how to find its exact value.
This question is partially inspired by the following question: Probability distribution to maximize the expected distance between two points