Stirling Numbers Calculator

Enter n and k to get the Stirling numbers of the first and second kind.

How to use

  1. Enter your values in the fields above.
  2. Press Calculate to see your result instantly.
  3. Use the Share button to copy a link to your result.

About this calculator

Stirling numbers come in two families that both decompose n objects around the integer k, but they count different things. Stirling numbers of the first kind, s(n,k), count permutations of n elements that break into exactly k disjoint cycles; Stirling numbers of the second kind, S(n,k), count the ways to partition a set of n elements into exactly k non-empty, unordered subsets. Both satisfy simple recurrence relations — S(n,k) = k·S(n−1,k) + S(n−1,k−1), for instance — which is how this calculator builds them up from smaller cases.

Combinatorics and discrete math students use these numbers to solve counting problems on permutation cycle structure and set partitioning, while computer scientists apply Stirling numbers of the second kind in analyzing algorithms that group or bucket data, and in formulas that convert between falling factorials and ordinary powers.

Was this helpful?

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators