47 lines
829 B
Markdown
47 lines
829 B
Markdown
|
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||
|
|
||
|
# Function composition
|
||
|
|
||
|
The composition counts of n into k parts.
|
||
|
|
||
|
composition only takes integer arguments.
|
||
|
The following condition must be enforced: k <= n.
|
||
|
|
||
|
|
||
|
## Syntax
|
||
|
|
||
|
```js
|
||
|
math.composition(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 | Returns the composition counts of n into k parts.
|
||
|
|
||
|
|
||
|
### Throws
|
||
|
|
||
|
Type | Description
|
||
|
---- | -----------
|
||
|
|
||
|
|
||
|
## Examples
|
||
|
|
||
|
```js
|
||
|
math.composition(5, 3) // returns 6
|
||
|
```
|
||
|
|
||
|
|
||
|
## See also
|
||
|
|
||
|
[combinations](combinations.md)
|