RandomProbabilities

RandomProbabilities is a function that generates a random probability vector (i.e., its entries are non-negative and sum to 1), uniformly distributed on the unit simplex.

Syntax

 * P = RandomProbabilities(N)

Argument descriptions

 * N: The number of entries in the desired probability vector.

Uniform distribution of length-3 probability vectors
The following code randomly generates 10000 probability vectors of length 3, and then demonstrates that their distribution on the unit simplex really is approximately uniform:

The scatter plot produced by the above code is displayed below: