[Math] How to randomly draw an ensemble of unit vectors that sum to zero

mg.metric-geometrypr.probability

Inspired by this question, I would like to determine the probability that a random knot of 6 unit sticks is a trefoil. This naturally leads to the following question:

Is there a way to sample uniformly from the set of ensembles of $n$ unit vectors $\{ v_i \}_{i=1}^n$ in $\mathbb{R}^d$ that sum to zero? I would like some sort of analytic expression for the distribution (something I might be able to prove a theorem with), but also an algorithmic process to implement in code.

UPDATE: It looks like what I want is basically the Hausdorff measure of an algebraic variety. Can I use the construction of this measure produce an analytic expression for the distribution?

Best Answer

Here is one approach. Start with a regular $n$-gon in the $xy$-plane with unit edge lengths; say its vertices are $v_i$, $i=0,\ldots,n-1$. Now iterate the following process.

Select a random diagonal, $v_i v_j$. Rotate the chain $v_i, v_{i+1}, \ldots, v_j$ (indices appropriately mod $n$) as a rigid unit about the line through $v_i v_j$, by a random angle $\theta \in [0,2\pi)$.

Continue until there is sufficient "mixing." I illustrate the process below for 30 iterations applied to a hexagon.
           HexVecsAnim
(Apologies for the scale—the chain wanders away from its initial locaion.)

Related Question