Learn R Programming

rinform (version 1.0.2)

partitioning: Partitioning

Description

Partition a number n of items into all possible different subsets. The number of partitions is given by the Bell number `B_n'.

Usage

partitioning(n)

Arguments

n

Numeric specifying the number of items of the set to partition.

Value

Matrix giving all possible partitioning schemata.

Examples

Run this code
# NOT RUN {
# All possible partitions of a set with 2 items
partitioning(2)

# All possible partitions of a set with 4 items
P <- partitioning(4)
t(P)
# }

Run the code above in your browser using DataLab