Given m
, how can we generate m
uniformly distributed numbers that sum with 1
such that A1 > A2 > ... > Am
?
For example, if m=4
, then we should have:
a <- c(0.4, 0.3, 0.2, 0.1) abs(diff(a)) #[1] 0.1 0.1 0.1 sum(a) #[1] 1
Or for m=5
:
b <- c(0.30, 0.25, 0.20, 0.15, 0.10) abs(diff(b)) #[1] 0.05 0.05 0.05 0.05 sum(b) #[1]
source share