Stirling numbers of the second kind

 StirlingS2[n, k]

The Stirling numbers of the second kind describe the number of ways a set with n elements can be partitioned into k disjoint, non-empty subsets.

For example, the set {1, 2, 3} can be partitioned into three subsets in the following way --

  • {{1}, {2}, {3}},
  • into two subsets in the following ways --

  • {{1, 2}, {3}}
  • {{1, 3}, {2}}
  • {{1}, {2, 3}},
  • and into one subset in the following way --

  • {{1, 2, 3}}.
  • The numbers can be computed recursively using this formula:

    StirlingS2[n, k] = StirlingS2[n-1, k-1] + k StirlingS2[n-1, k].

    Here are some diagrams representing the different ways the sets can be partitioned: a line connects elements in the same subset, and a point represents a singleton subset.

    StirlingS2[3, k]:
    [ StirlingS2[3, k] (sorry -- doesn't make much sense without the graphics) ]

    StirlingS2[4, k]:
    [ StirlingS2[4, k] ]

    StirlingS2[5, k]:
    [ StirlingS2[5, k] ]

    StirlingS2[6, k]:
    [ StirlingS2[6, k] ]

    The sums of the Stirling numbers of the second kind,

     Sum[StirlingS2[n, k], {k, 0, n}] ,

    are called the Bell numbers.

    Designed and rendered using Mathematica 3.0 for the Apple Macintosh.

    Copyright © 1996 Robert M. Dickau

    Back to Stirling

    [ mail rmd ]