Stirling 2ª espécie S(n,k) (n≤6)
- Created by
- Renato Passos, Eng. de Software
- Reviewed by
- Renato Passos, Eng. de Software
Last updated: Apr 18, 2026
Formula
tabela S(n,k)
About this calculator
The Stirling numbers of the second kind S(n,k) calculator for n≤6 quickly computes the number of ways to partition a set of n elements into k non-empty subsets. These numbers are fundamental in combinatorics, especially for counting set partitions. The calculator provides the exact value for any pair (n,k) within the specified range, eliminating manual calculations.
It works based on a precomputed table of Stirling numbers of the second kind for n from 0 to 6. The user selects n (total elements) and k (number of blocks) between 1 and n, and the calculator displays S(n,k). For example, S(4,2)=7, as there are 7 ways to split a set of 4 elements into 2 non-empty subsets. The recursive formula S(n,k)=k*S(n-1,k)+S(n-1,k-1) generates these values, but here a fixed table is used for quick results.
When to use? Ideal for students and professionals solving combinatorial problems, such as assigning tasks to groups, distributing objects into non-empty boxes, or analyzing data structures. Also useful in probability, e.g., calculating probabilities of partition-related events. For n>6, consider using other tools or implementing the recursion.
Caveats: Ensure k does not exceed n, as S(n,k)=0 for k>n. Also, note that Stirling numbers of the second kind count partitions where the order of blocks does not matter. If block order matters, multiply by k! (k factorial) to get the number of assignments. The calculator is limited to n≤6 for simplicity and to avoid large numbers.
Frequently asked questions
What does S(5,2)=15 mean?
It means there are 15 different ways to divide a set of 5 elements into 2 non-empty subsets.
Can I use it for n greater than 6?
No, this calculator is limited to n≤6. For larger n, use another tool or implement the recursive formula.
What is the difference between Stirling numbers of the second kind and first kind?
Stirling numbers of the first kind count permutations with a given number of cycles, while the second kind count set partitions into non-empty blocks.
How to calculate the number of surjective functions?
The number of surjective functions from an n-element set to a k-element set is k! * S(n,k). Use the calculator to get S(n,k) and multiply by k! (k factorial).
What if k is greater than n?
If k > n, the result is zero, as it is impossible to partition an n-element set into more than n non-empty blocks.