Work out stirling number instantly with clear inputs, formula shown and shareable results.
The Stirling number of the second kind S(n, k) counts ways to partition n labelled items into k non-empty unlabelled blocks. The recurrence S(n,k) = k·S(n−1,k) + S(n−1,k−1) asks whether the new item joins an existing block or starts its own.
Stirling recurrence
S(n, k) = k·S(n−1, k) + S(n−1, k−1), S(0,0) = 1
Surjections
onto functions = k! · S(n, k)
90, and multiplying by 3! gives 540 onto functions from 6 items to 3 labels.
Summing S(n, k) over all k gives the Bell number, the total number of partitions of the set.