Stirling Number Calculator
Count set partitions into a chosen number of nonempty groups.
How the stirling number calculator works
A Stirling number of the second kind counts ways to partition n labeled objects into k nonempty unlabeled groups. The recurrence considers the final object: it can join any of k existing groups or form a new singleton beside a partition into k minus one groups. Dynamic programming builds the table from the empty-set base case without enumerating every partition.
The defaults n equal 5 and k equal 2 produce the verified value 15. These are the ways to split five distinct objects into two nonempty groups when swapping the two group labels does not create a new partition. The recurrence combines 2 times S of 4,2 with S of 4,1, giving 14 plus 1.
Reading stirling number calculator results privately
Objects are distinct, groups are unlabeled, and empty groups are forbidden; changing any of those conditions changes the count. Inputs are capped at 18 for exact safe-integer arithmetic. This is the second kind, which counts set partitions, not the first kind, which counts permutations by their cycle count. This stirling number calculator calculation runs entirely in your browser, so the numbers you enter never leave your device.
Frequently Asked Questions
Why are the groups called unlabeled?
Renaming or reordering the groups does not create a new partition; only group membership matters.
How is the second kind different from the first kind?
Second-kind numbers count set partitions. First-kind Stirling numbers count permutations with a specified number of cycles.
Is the stirling number calculator private?
Yes. Its inputs and results stay in your browser. Bushe.co does not upload or store the values used in this calculation.
Browse the full set of free, private, in-browser tools.