Stirling
The Stirling number of the second kind : the number of ways to partition an n-set into k non-empty blocks
Stirling numbers of the second kindMathWorldStirlingNumberoftheSecondKindWikidataQ2601117DLMF26.8.i.p3Fungrim entry9fbe4fOEISA008277Wolfram LanguageStirlingS2✓Stirling(n, k)the number of partitions of an -set into blocksstirling_number2(n, k)✓SymPystirling(n, k)mpmathstirling2(n, k)JuliaCombinatorics.stirlings2(big(n), k)Typed signatures
| Type | Package | Applies |
|---|---|---|
(integer, integer) -> integer | compute-engine | always |
(integer, integer) -> integer | number-theoryreplaces compute-engine | always |
Details
- compute-engine spells the second-kind number as .
- It satisfies the recurrence
- Summing over gives the Bell number: (see BellNumber)
- The signed first-kind numbers are StirlingS1
Plot
Examples
3 more kept as data, checked against the oraclesScope #
Properties #
Nothing to partition into zero blocks, for
live ↗Known value · Wolfram MathematicalFunctionData, StirlingS2
More blocks than elements gives
live ↗Known value · Wolfram MathematicalFunctionData, StirlingS2
Nonempty set cannot fill zero blocks
live ↗Known value · Wolfram MathematicalFunctionData, StirlingS2
Zero blocks only fit the empty set
live ↗Known value · Wolfram MathematicalFunctionData, StirlingS2
Three ways to pick the lone element
live ↗Known value · Wolfram MathematicalFunctionData, StirlingS2
, choosing the pair that shares a block
live ↗Known value · Wolfram MathematicalFunctionData, StirlingS2
Possible issues #
About
| Examples | 39 |
|---|---|
| Checked against | Wolfram Language 39 agreeSageMath 33 agree4 errorSymPy 33 agree1 differ3 errormpmath 32 agree1 errormathlib4 31 agree1 differ2 errorJulia 31 agree1 unevaluated1 errorCombinatorica 1 agree |
| Crosswalk | WikipediaMathWorldWikidataDLMFFungrim entryOEISWolfram LanguageSageMathSymPympmathJulia |
Implementation
wolframpackages/oracle/src/mappings.tscompute-engine's Stirling is the SECOND kind (Wolfram's StirlingS2). Combinatorics.jl's stirlings2 needs n as a BigInt past its Int64 lookup table (n > 20).
sympypackages/oracle/src/mappings.tscompute-engine's Stirling is the SECOND kind (Wolfram's StirlingS2). Combinatorics.jl's stirlings2 needs n as a BigInt past its Int64 lookup table (n > 20).
sagepackages/oracle/src/mappings.tscompute-engine's Stirling is the SECOND kind (Wolfram's StirlingS2). Combinatorics.jl's stirlings2 needs n as a BigInt past its Int64 lookup table (n > 20).
juliapackages/oracle/src/mappings.tscompute-engine's Stirling is the SECOND kind (Wolfram's StirlingS2). Combinatorics.jl's stirlings2 needs n as a BigInt past its Int64 lookup table (n > 20).
mathlib4packages/oracle/src/mappings.tscompute-engine's Stirling is the SECOND kind (Wolfram's StirlingS2). Combinatorics.jl's stirlings2 needs n as a BigInt past its Int64 lookup table (n > 20).
mpmathpackages/oracle/src/mappings.tsThe second kind.
See also: StirlingS1, BellNumber, SetPartitions