WLJS LogoWLJS Notebook

StirlingS2

StirlingS2[n, m] gives the Stirling number of the second kind, the number of ways to partition n elements into m non-empty subsets.

Examples

Stirling numbers of the second kind:

Table[StirlingS2[4, k], {k, 0, 4}]
(* {0, 1, 7, 6, 1} *)

Partition count:

StirlingS2[5, 3]
(* 25 - ways to partition 5 elements into 3 groups *)

Please visit the official Wolfram Language Reference for more details.

On this page