mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
838 B
838 B
Function stirlingS2
Calculate the Stirling number of the second kind for partitioning a set of n elements into k nonempty sets.
Syntax
math.stirlingS2(n, k)
Parameters
| Parameter | Type | Description |
|---|---|---|
n |
Number | BigNumber | Function input |
k |
Number | BigNumber | Function input |
Returns
| Type | Description |
|---|---|
| Number | BigNumber | The number of ways to partition a set of n elements into k nonempty sets. |
Examples
math.stirlingS2(5, 2); // returns Number 15
math.stirlingS2(math.bignumber(10), math.bignumber(4)); // returns Number 34105