Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose that I want to generate a random probability vector $p = (p_1,\dots,p_d) \in [0,1]^d$, distributed uniformly over the simplex of probability vectors in $\mathbb{R}^d$. I would like to generate $U_i \stackrel{i.i.d.}{\sim} F, \;i=1,\dots,d$ from some distribution $F$, so that $(p_i) := (\frac{U_i}{\sum_{j=1}^d U_j})$ gives the desired random probability vector. What should $F$ be?

share|cite|improve this question
up vote 1 down vote accepted

An exponential distribution $f_U(u)= \lambda \, e^{-\lambda \,u}$, $u \ge 0$, with arbitrary $\lambda>0$ should work. The joint probability

$$f_{\bf u}({\bf u})=\lambda^d \exp[-\lambda (u_1+u_2 +\cdots +u_d)]$$

is constant over the unit simplex. And it's also uniform over any simplex $u_1+u_2 +\cdots +u_d = t$. And the operation $(p_i) := (\frac{U_i}{\sum_{j=1}^d U_j})$ amounts to a radial projection over the unit simplex, which, by geometric similarity, preserves the uniformity.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.