keisoku

Stirling Numbers of the Second Kind Table

Enter a maximum order N to generate the triangular table of Stirling numbers of the second kind S(n,k) from n=0 to N, with the row sums (Bell numbers) shown alongside.

Input

Enter a maximum order N to generate the triangular table of Stirling numbers of the second kind S(n,k) from n=0 to N. The sum of each row (the Bell number) is shown too.

Enter an integer from 0 to 30.

Result

Bell number B(8) (sum of row n=8)

4,140

Triangle of Stirling numbers of the second kind S(n,k)

n / kk=0k=1k=2k=3k=4k=5k=6k=7k=8Bell
011
1011
20112
301315
40176115
501152510152
601319065151203
70163301350140211877
8011279661,7011,0502662814,140

The rightmost cell of each row is the Bell number, equal to that row sum. Cells where k exceeds n are blank because no such partition exists.

How it works

  • The Stirling number of the second kind S(n,k) counts the number of ways to partition a set of n distinguishable elements into k non-empty, unlabeled subsets. It is a fundamental quantity in combinatorics and set partition theory.
  • This tool fills the lower-triangular table using the recurrence S(n,k) = k * S(n-1,k) + S(n-1,k-1), starting from S(0,0)=1 and setting S(n,0)=0 for n greater than or equal to 1.
  • Every value is computed with BigInt (arbitrary-precision integers), so even at higher orders there is no overflow or rounding error and the results are exact integers.
  • The sum of each row, S(n,0)+S(n,1)+…+S(n,n), equals the Bell number B(n), which is the total number of partitions of an n-element set. The Bell number appears in the rightmost column of the table.
  • The maximum order N must be between 0 and 30 inclusive. Columns are indexed by k and rows by n; cells where k exceeds n are left blank because no such partition exists.

Reviews

Tell us what you think of this calculator.

Write a review

  1. Home
  2. Stirling Numbers of the Second Kind Table