stirlingS2.md (1038B)
1 <!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. --> 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 <= n, then s(n,k) = 1 11 If k = 0 < n, then s(n,k) = 0 12 13 Note that if either n or k is supplied as a BigNumber, the result will be 14 as well. 15 16 17 ## Syntax 18 19 ```js 20 math.stirlingS2(n, k) 21 ``` 22 23 ### Parameters 24 25 Parameter | Type | Description 26 --------- | ---- | ----------- 27 `n` | Number | BigNumber | Total number of objects in the set 28 `k` | Number | BigNumber | Number of objects in the subset 29 30 ### Returns 31 32 Type | Description 33 ---- | ----------- 34 Number | BigNumber | S(n,k) 35 36 37 ### Throws 38 39 Type | Description 40 ---- | ----------- 41 42 43 ## Examples 44 45 ```js 46 math.stirlingS2(5, 3) //returns 25 47 ``` 48 49 50 ## See also 51 52 [bellNumbers](bellNumbers.md)