Understand the subject
What is a set partition?
A set partition separates labelled objects into nonempty groups, while ignoring the order of the groups themselves.
Use it for grouping distinct objects into unlabeled teams or clusters of an exact count.
See the structure
The newest object joins a group or starts one
join one of kor start newS(n,k)
Worked example
Check the rule with a small case
Four labelled objects into 2 nonempty unlabeled groups: S(4,2) = 7.
Interpret with care
Choose the right counting model
If the groups have names, use a multinomial model instead.
Use the Permutation & Combination Generator when a small case needs to be inspected rather than only counted.
Quick guide
How to use this calculator
- Enter the number of labeled objects n.
- Enter the exact number of non-empty unlabeled groups k.
- Read the Stirling number of the second kind S(n,k).
Calculation method
Build the Stirling recurrence
The newest object either joins one of k existing groups or forms a new group: S(n,k)=kS(n−1,k)+S(n−1,k−1).
Worked example
Partition four objects into two groups
There are seven partitions into exactly two non-empty unlabeled groups.
S(4,2) = 2S(3,2)+S(3,1) = 7
Supported inputs
Precision and limits
Discrete domain
Inputs are whole counts. Negative, fractional, grouped, and scientific-notation inputs are rejected.
Exact integers
Results use arbitrary-precision integers and are never rounded. Inputs and output size are bounded to keep the page responsive.
Maximum n
n is limited to 500 for the exact recurrence table.