composition.md (829B)
1 <!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. --> 2 3 # Function composition 4 5 The composition counts of n into k parts. 6 7 composition only takes integer arguments. 8 The following condition must be enforced: k <= n. 9 10 11 ## Syntax 12 13 ```js 14 math.composition(n, k) 15 ``` 16 17 ### Parameters 18 19 Parameter | Type | Description 20 --------- | ---- | ----------- 21 `n` | Number | BigNumber | Total number of objects in the set 22 `k` | Number | BigNumber | Number of objects in the subset 23 24 ### Returns 25 26 Type | Description 27 ---- | ----------- 28 Number | BigNumber | Returns the composition counts of n into k parts. 29 30 31 ### Throws 32 33 Type | Description 34 ---- | ----------- 35 36 37 ## Examples 38 39 ```js 40 math.composition(5, 3) // returns 6 41 ``` 42 43 44 ## See also 45 46 [combinations](combinations.md)