1 |
|
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 | ## Examples
|
32 |
|
33 | ```js
|
34 | math.composition(5, 3) // returns 6
|
35 | ```
|
36 |
|
37 |
|
38 | ## See also
|
39 |
|
40 | [combinations](combinations.md)
|
41 |
|
\ | No newline at end of file |