Suppose x1, x2, … , xn are n independent values of a random variable uniformly distributed within the interval [0,1]. If you sort the values in ascending order, then the k-th value will have a beta distribution with parameters
,
. The density of beta distribution is given by

where
,
;
is the gamma function.