Crate random_partition

source ·
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

Generates a random partition of total into number_of_parts.
Generates a random partition of total into number_of_parts writing the result into the provided buffer.
Generates multiple random partitions of total into number_of_parts.