| nStirling2 | R Documentation |
The function computes the Stirling number of the second kind.
nStirling2( n, k )
n |
integer |
k |
integer less or equal to |
The Stirling number of the second kind S(n,k) is equal to the number of ways to split a
set of cardinality n into k nonempty subsets. For example, if the set is [a,b,c,d], then
the partitions in 2 blocks are: [[a], [bcd]], [[b], [acd]], [[c], [abd]], [[d],[abc]] with
cardinalities (1,3) and [ab, cd], [ac, bd], [ad, bc] with cardinalities (2,2). Then S(4,2)
is equal to 7. Note that (1,3) and (2,2) are also the partitions of the integer 4 in 2 parts.
integer |
the Stirling number of the second kind |
Called by the nKS and nKM functions in the kStatistics package.
Elvira Di Nardo elvira.dinardo@unito.it,
Giuseppe Guarino giuseppe.guarino@rete.basilicata.it
R. P. Stanley (2012) Enumerative combinatorics. Vol.1. II edition. Cambridge Studies in Advanced Mathematics, 49. Cambridge University Press, Cambridge.
mkmSet,
mCoeff,
intPart,
countP,
ff
# Return the number of ways to split a set of 6 objects into 2 nonempty subsets nStirling2(6,2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.