Learn R Programming

rpartitions (version 0.1)

top_down: Top down method of generating uniform random partitions of Q having N parts.

Description

Top down method of generating uniform random partitions of Q having N parts.

Usage

top_down(part, Q, D, rand_int, use_c, use_hash)

Arguments

part
a list to hold the partition
Q
the total sum of the partition
D
a dictionary for the number of partitions of Q having N or less parts (or N or less as the largest part), i.e. P(Q + N, N).
rand_int
a number representing a member of the feasible set
use_c
boolean if TRUE then compiled c code is used
use_hash
boolean, if TRUE then a hash table is used

Examples

Run this code
top_down(c(5, 4), 4, hash(), 1, TRUE, FALSE)

Run the code above in your browser using DataLab