3
$\begingroup$

How can I randomly select a point $\vec p=\langle p_1,p_2,p_3...p_n\rangle$ such that all coordinates $p_i$ are between $0$ and $1$, and $$\sum_{i=1}^n\ p_i = 1$$ Notice that $\vec p$ lies on a hyperplane. I want the distribution of points on this hyperplane to be uniform. Specifically, the distribution an individual value $p_i$ should follow the probability density function $P(x)=(n-1)(1-x)^{n-2}$ when $0\leq x\leq 1$

One way to generate a point that follows this distribution is to repeatedly generate $n-1$ coordinates $p_1,p_2, ... p_{n-1}$ independent of each other with a uniform distribution in the range $[0,1]$ until finding a set of $n-1$ values whose sum is less than 1. The final value is easy to calculate: $$p_n=1-\sum_{i=1}^{n-1}\ p_i$$ Although the issue with this approach is that the average the number of initial sets of $n-1$ coordinates that have to be generated before finding one that works grows exponentially, and so this method wouldn't work before the heat death of the universe for $n>100$

$\endgroup$
  • $\begingroup$ In other words, you want a uniformly random probability distribution on a finite set? $\endgroup$ – Lorenzo Apr 23 '17 at 3:10
  • $\begingroup$ Wouldn't it be a uniformly random probability distribution on an infinite set? $\endgroup$ – J. Antonio Perez Apr 23 '17 at 3:11
  • $\begingroup$ Oh I thought $n$ was fixed. $\endgroup$ – Lorenzo Apr 23 '17 at 3:12
  • $\begingroup$ Arg... $n$ is fixed, but you're selecting a point from an infinite set of possible points. $\endgroup$ – J. Antonio Perez Apr 23 '17 at 3:17
  • 1
    $\begingroup$ I might be missing something, but is this not answered by uniformly drawing from a probability simplex? $\endgroup$ – user3658307 Apr 23 '17 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.