Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


ConsRank (version 2.1.5)

stirling2: Stirling numbers of the second kind

Description

Denote the number of ways to partition a set of n objects into k non-empty subsets

Usage

stirling2(n, k)

Value

a "list" containing the following components:

Sthe stirling number of the second kind
SMa matrix showing, for each k (on the columns) in how many ways the n objects (on the rows) can be partitioned

Arguments

n

(integer): the number of the objects

k

(integer <=n): the number of the non-empty subsets (buckets)

Author

Antonio D'Ambrosio antdambr@unina.it

References

Comtet, L. (1974). Advanced Combinatorics: The art of finite and infinite expansions. D. Reidel, Dordrecth, The Netherlands.

Examples

Run this code
parts<-stirling2(4,2)

Run the code above in your browser using DataLab