Calculator input
Example data table
| n | k | Pattern | S(n,k) | B(n) | Pattern count |
|---|---|---|---|---|---|
| 4 | 2 | 1,3 | 7 | 15 | 4 |
| 5 | 3 | 2,2,1 | 25 | 52 | 15 |
| 6 | 3 | 2,2,2 | 90 | 203 | 15 |
| 7 | 4 | 3,2,1,1 | 350 | 877 | 210 |
Formula used
Stirling recurrence: S(n,k) = S(n-1,k-1) + k × S(n-1,k)
Boundary values: S(0,0)=1, S(n,0)=0 for n>0, and S(n,n)=1
Bell number: B(n) = Σ S(n,k) for k from 1 to n
Fixed block-size pattern: count = n! / [∏(sᵢ!) × ∏(mⱼ!)]
Here, each sᵢ is a block size in the chosen pattern, and each mⱼ is the multiplicity of repeated block sizes.
The probability values shown by the calculator are approximate decimal shares computed against the Bell number for the same n.
How to use this calculator
- Enter n for the total number of elements in the set.
- Optionally enter k when you need partitions into exactly k nonempty subsets.
- Add a block-size pattern such as 2,2,3 to test one specific shape.
- Provide labels when you want the set displayed with names instead of numbers.
- Press the calculate button to place results above the form.
- Review Bell totals, exact Stirling values, pattern counts, and probabilities.
- Use the chart to compare how counts change across different k values.
- Export the current results as CSV or PDF when needed.
Frequently asked questions
1. What does a set partition count?
It counts ways to split a set into nonempty, disjoint subsets whose union is the full set. The subset order does not matter, so {A,B}|{C} equals {C}|{A,B}.
2. What is the difference between Bell numbers and Stirling numbers?
A Stirling number S(n,k) counts partitions of n labeled elements into exactly k nonempty subsets. A Bell number B(n) adds those counts across every valid k.
3. Why does the chart use logarithms?
Partition counts grow very quickly. Log10 scaling keeps large differences visible without flattening smaller bars, so you can compare the full distribution more clearly.
4. What does the block-size pattern represent?
The pattern lists subset sizes only. For example, 2,2,1 means two pairs and one singleton. The calculator counts how many unlabeled partitions have exactly that structure.
5. Why must the pattern sum equal n?
Every element must belong to exactly one block. If the listed sizes do not add up to n, the pattern cannot cover the whole set.
6. Can I use labels instead of numbers?
Yes. Labels do not change the counts, but they make the universe display easier to interpret for named objects, tasks, or symbols.
7. Are the probabilities exact?
The counts are exact integers. The displayed probabilities are decimal approximations based on exact integer division against the Bell number for the same n.
8. What input size is practical here?
This page computes exact values up to n = 30, which is already very large for partition counts. That range balances mathematical depth with responsive browser output.