View source: R/derivationTrees.R
rndPartition | R Documentation |
Sampling a partition is a two-step process:
The k parts of the partion are sampled in the loop. This implies that the first partition p is a random number between 1 and 1+n-k. The next partition is sampled from 1 to 1+n-k-p.
We permute the partitions.
rndPartition(n, k)
n |
The integer to divide. |
k |
Number of parts. |
The integer partition of n in k parts.
rndPartition(10, 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.