rndPartition {xegaDerivationTrees}R Documentation

Randomly partitions n in k parts.

Description

Sampling a partition is a two-step process:

  1. 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.

  2. We permute the partitions.

Usage

rndPartition(n, k)

Arguments

n

The integer to divide.

k

Number of parts.

Value

The integer partition of n in k parts.

Examples

 rndPartition(10, 4)

[Package xegaDerivationTrees version 1.0.0.0 Index]