The simplex

The space of convex combinations of things. Hacks for it.

Simulating uniformly from the simplex

This one is apparently “folk wisdom”.

But say you wish to simulate a vector drawn uniformly from the \(n\)-simplex.

  • simulate \(n\) random uniform variables on the unit interval, \((u_1,_u_2,\dots,u_n)\)

  • Sort them in decreasing order, \((u'_1,_u'_2,\dots,u'_n)\)

  • Your random vector is \((u'_1-0, u'_2-u'_1, u'_3-u'_2,\dots,u'_n-u'_{n-1})\)

This surprisingly relates to Dirichlet variables. Can you see how?


Friedman, Greg. 2008. “An Elementary Illustrated Introduction to Simplicial Sets.” September 24, 2008.

Warning! Experimental comments system! If is does not work for you, let me know via the contact form.

No comments yet!

GitHub-flavored Markdown & a sane subset of HTML is supported.