How can I find the average euclidean distance between two points randomly chosen (independent and uniform) on the surface of a unit $n$-cube? I am specifically interested in the closed forms of this average for a square and cube.
The related problem of determining the average distance with two points in (not on) a square is discussed here. In general, the formula for the expected distance between two random points of a unit $n$-cube is $$ \begin{aligned} \Delta(n) &= \int_{\vec{r},\,\vec{q} \in [0,1]^n} |\vec{r} -\vec{q}| \,\mathcal{D}\vec{r}\,\mathcal{D}\vec{q} \\ &= \int_{0}^{1} \!\cdots\int_{0}^{1} \bigl[(r_1 - q_1)^2 + \cdots +(r_n - q_n )^2\bigr]^{1/2} \,dr_1 \cdots dr_n\,dq_1 \cdots dq_n \end{aligned} $$
Also, the expected distance of a random point from any vertex of the $n$-cube is $$ B(n) = \int_{0}^{1} \!\cdots \int_{0}^{1} (r_1^2 + \cdots + r_n^2)^{1/2} \,dr_1 \cdots dr_n $$ However, I am not sure how to set up an equation that represents the problem above (the surface of the $n$-cube rather than inside the $n$-cube). The integrals above only represent a similar variant of this problem, or a specific case (only the vertex, not entire surface). Any insight is appreciated, thanks.