Calculator Inputs
Interpretation
Counts partitions of n labeled items into exactly k nonempty sets.
Computed Summary
- Selected type: Second Kind
- Computed pair: (n,k) = (6, 3)
- Result value: 90
- Whole set partitions B(6): 203
- Useful when analyzing set partitions, cycle structures, and polynomial basis changes.
Example Data Table
| n | k | Type | Value | Meaning |
|---|---|---|---|---|
| 5 | 2 | Second Kind | 15 | Partitions of five labeled elements into two nonempty subsets. |
| 6 | 3 | Second Kind | 90 | Partitions of six elements into three groups. |
| 5 | 3 | First Kind Unsigned | 35 | Permutations of five elements with three cycles. |
| 5 | 3 | First Kind Signed | 35 | Signed coefficient for the falling factorial expansion term. |
Reference Table
Values shown from n = 0 to n = 8 for the selected Stirling type.
| n \ k | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|---|
| 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 2 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
| 3 | 0 | 1 | 3 | 1 | 0 | 0 | 0 | 0 | 0 |
| 4 | 0 | 1 | 7 | 6 | 1 | 0 | 0 | 0 | 0 |
| 5 | 0 | 1 | 15 | 25 | 10 | 1 | 0 | 0 | 0 |
| 6 | 0 | 1 | 31 | 90 | 65 | 15 | 1 | 0 | 0 |
| 7 | 0 | 1 | 63 | 301 | 350 | 140 | 21 | 1 | 0 |
| 8 | 0 | 1 | 127 | 966 | 1701 | 1050 | 266 | 28 | 1 |
Plotly Graph
This chart plots the selected Stirling values across k = 0 to k = 6 for the current n.
Formula Used
Stirling numbers are computed with dynamic programming from their recurrence relations. This avoids repeated recursion and builds exact integer values row by row.
- Second kind: S(n,k) = S(n−1,k−1) + kS(n−1,k)
- First kind unsigned: c(n,k) = c(n−1,k−1) + (n−1)c(n−1,k)
- First kind signed: s(n,k) = (−1)n−k c(n,k)
- Boundary conditions: S(0,0)=1, c(0,0)=1, and values are zero when k>n or k<0.
These formulas support partition counting, permutation cycle counting, and algebraic basis transformations involving falling factorials.
Article
Partition Counting Context
Stirling numbers quantify how discrete arrangements expand as n and k change. In the second kind, S(n,k) counts ways to divide n labeled items into k nonempty groups. Common checkpoints include S(5,2)=15, S(6,3)=90, and S(8,2)=127. These values are useful in clustering logic, set partition studies, and exact enumeration tasks where approximate counts are not acceptable.
Cycle Structure Interpretation
Unsigned first kind values count permutations containing exactly k cycles. For example, c(5,3)=35 shows that thirty-five permutations of five labeled elements decompose into three cycles. This interpretation matters in algebra and permutation statistics because cycle structure reveals how rearrangements are organized. Signed first kind values extend the same magnitude pattern while introducing alternating signs for expansion formulas.
Growth Across Reference Tables
Table growth is uneven. Edge values stay simple because S(n,1)=1, S(n,n)=1, and c(n,n)=1. Interior values carry most of the size. When n rises, central entries grow far faster than boundary entries. A reference table therefore helps users compare sparse edge behavior with middle behavior and quickly judge whether an input pair lies in a low-volume or high-volume combinatorial region.
Why Recurrence Matters
The recurrence formulas replace direct counting with structured reuse. S(n,k)=S(n-1,k-1)+kS(n-1,k) separates starting a new group from joining an existing group. Similarly, c(n,k)=c(n-1,k-1)+(n-1)c(n-1,k) splits cycle formation from element insertion into older cycles. Dynamic programming applies these relations row by row, keeps results exact, and avoids repeated recursive expansion.
Operational Use in Computation
A calculator becomes valuable because manual evaluation grows tedious at moderate n. Exact tables, Bell numbers, and factorial comparisons provide context for the computed value. Bell numbers summarize all second-kind partitions for a chosen n, while factorials show the scale of total permutations. Together, these measures help users interpret whether a specific Stirling result is relatively small, central, or dominant.
Decision Support for Learners
Choose the second kind for grouping questions and the first kind for cycle-based permutation questions. Use signed values for algebraic identities rather than direct counting. The graph below the calculator plots values across k for the selected n, making trends visible and helping users interpret patterns that are harder to notice in large tables alone.
FAQs
1. What does the second kind measure?
It counts how many ways n labeled items can be partitioned into exactly k nonempty groups. It is mainly used for grouping and partition problems.
2. What does the first kind measure?
It counts permutations by cycle structure. The unsigned form gives cycle counts directly, while the signed form is used in algebraic expansions.
3. Why are some results zero?
Values become zero when k is greater than n, or when the pair violates the boundary conditions of the recurrence table.
4. Why are signed first kind values negative sometimes?
The sign depends on (-1)^(n-k). If n-k is odd, the signed value is negative; if even, it stays positive.
5. Why does the graph change with type selection?
Each Stirling type models a different combinatorial meaning, so the distribution across k changes when you switch between partitions, cycles, and signed values.
6. When should I use Bell numbers here?
Use Bell numbers when you want the total number of partitions for n without fixing k. They summarize all second-kind values in that row.
How to Use This Calculator
- Select the Stirling number type you want to evaluate.
- Enter integer values for n and k.
- Choose how large the reference table should be.
- Enable the steps option if you want a recurrence breakdown.
- Press Submit to display the result above the form.
- Use the CSV or PDF buttons to export the current output.