### Choosing a Point from a Uniform Distribution in a Simplex

To choose a point from a uniform distribution within an n-simplex, we compute n+1 barycentric coordinates as follows.
Choose n numbers independently from the uniform distribution between 0 and 1.
Add 0 and 1 to that set.
Sort these n+2 numbers giving {x_{0}, x_{1}, …, x_{n+1}} so that 0≤i≤n → x_{i} ≤ x_{i+1} and x_{0} = 0 and x_{n+1} = 1.

For 0≤i≤n y_{i} = x_{i+1} − x_{i}.
Σ y_{i} = 1 and we take the y’s to be the barycentric coordinates of our random point.

This trick is used here.