1 |
|
2 |
|
3 | # Function stirlingS2
|
4 |
|
5 | The Stirling numbers of the second kind, counts the number of ways to partition
|
6 | a set of n labelled objects into k nonempty unlabelled subsets.
|
7 | stirlingS2 only takes integer arguments.
|
8 | The following condition must be enforced: k <= n.
|
9 |
|
10 | If n = k or k = 1, then s(n,k) = 1
|
11 |
|
12 |
|
13 | ## Syntax
|
14 |
|
15 | ```js
|
16 | math.stirlingS2(n, k)
|
17 | ```
|
18 |
|
19 | ### Parameters
|
20 |
|
21 | Parameter | Type | Description
|
22 | --------- | ---- | -----------
|
23 | `n` | Number | BigNumber | Total number of objects in the set
|
24 | `k` | Number | BigNumber | Number of objects in the subset
|
25 |
|
26 | ### Returns
|
27 |
|
28 | Type | Description
|
29 | ---- | -----------
|
30 | Number | BigNumber | S(n,k)
|
31 |
|
32 |
|
33 | ## Examples
|
34 |
|
35 | ```js
|
36 | math.stirlingS2(5, 3) //returns 25
|
37 | ```
|
38 |
|
39 |
|
40 | ## See also
|
41 |
|
42 | [bellNumbers](bellNumbers.md)
|
43 |
|
\ | No newline at end of file |