mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
1.3 KiB
1.3 KiB
| layout |
|---|
| default |
Function stirlingS2 #
The Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. stirlingS2 only takes integer arguments. The following condition must be enforced: k <= n.
If n = k or k = 1, then s(n,k) = 1
Syntax #
math.stirlingS2(n, k)
Parameters #
| Parameter | Type | Description |
|---|---|---|
n |
Number | BigNumber | Total number of objects in the set |
k |
Number | BigNumber | Number of objects in the subset |
Returns #
| Type | Description |
|---|---|
| Number | BigNumber | S(n,k) |
Examples #
math.stirlingS2(5, 3) //returns 25