Expand description
Generate approximately uniformly distributed random integer partitions. So given natural numbers n, k find a sequence of natural (nonzero) p₁, …, pₖ such that n = ∑ᵢ₌₁ᵏ pᵢ.
Functions§
- number_
of_ partitions_ into_ parts - number_
of_ partitions_ into_ parts_ with_ max - random_
partition - Generates a random partition of
total
intonumber_of_parts
. - random_
partition_ buf - Generates a random partition of
total
intonumber_of_parts
writing the result into the provided buffer. - random_
partitions - Generates multiple random partitions of
total
intonumber_of_parts
.