Two methods for generating random numbers that sum to 1.

probability

I want a vector $\vec{v}$ of $N$ non-negative random numbers that sum to 1.

Let $X(a)$ be the (continuous) uniform distribution over interval $[0, a]$.

Let $S(n) = \sum_{i = 1}^{n} v_{i}$ be the partial sum of the elements of $\vec{v}$

Method 1

  • Generate: For each $k$, set $v_k$ to a random number from $X(1)$.
  • Normalize: Divide $\vec{v}$ by sum of all elements of $\vec{v}$.

Method 2

Generate the elements of $\vec{v}$ one after another with the following steps.

  1. Generate 1st element: set $v_1$ to a random number from $X(1)$.

  2. Generate 2nd element: set $v_2$ to a random number from $X(1 – v_{1})$

  3. Generate the $k^{th}$ element: set $v_k$ to a random number from $X(1 – S(k-1))$.

  4. Calculate the last element: set $v_N$ to $1 – S(N – 1)$.

Question

If I generate $\vec{v}$ with method 2, are the probability distributions of the elements of $\vec{v}$ independent from each other?

Thank you.

Best Answer

The answer is no, these will not be independent. Consider the example where $N = 2$, then your method 2 is equivalent to:

  1. Choose $v_1 \sim \text{Unif}[0,1]$.
  2. Set $v_2 = 1-v_1$.

Note that $v_2$ is itself uniformly distributed on $[0,1]$.

Now if $v_1,\,v_2$ were independent, we would have for all $s,t \in [0,1]$

$$ \mathbf P[ v_1 \leq s, v_2 \leq t] = \mathbf P[v_1 \leq s] \mathbf P[v_2 \leq t] = st.$$

However, since $v_2 = 1 - v_1$ we actually have

$$\mathbf P[v_1 \leq s, (1-v_1) \leq t] = \mathbf P[v_1 \leq s, v_1 \geq 1-t] = \mathbf P[(1-t) \leq v_1 \leq s].$$

The exact formula of the final expression depends on the values of $s,t \in [0,1]$, but as an example if $s = t = 1/2$ then

$$ \mathbf P[(1-t) \leq v_1 \leq s] =\mathbf P[ v_1 = 1/2] = 0 \neq \frac14, $$ where $\frac14$ is the answer you would expect for independent $v_1,v_2$.

Related Question