simple-squiggle/node_modules/mathjs/docs/reference/functions/combinations.md

50 lines
934 B
Markdown
Raw Permalink Normal View History

<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
# Function combinations
Compute the number of ways of picking `k` unordered outcomes from `n`
possibilities.
Combinations only takes integer arguments.
The following condition must be enforced: k <= n.
## Syntax
```js
math.combinations(n, k)
```
### Parameters
Parameter | Type | Description
--------- | ---- | -----------
`n` | number &#124; BigNumber | Total number of objects in the set
`k` | number &#124; BigNumber | Number of objects in the subset
### Returns
Type | Description
---- | -----------
number &#124; BigNumber | Number of possible combinations.
### Throws
Type | Description
---- | -----------
## Examples
```js
math.combinations(7, 5) // returns 21
```
## See also
[combinationsWithRep](combinationsWithRep.md),
[permutations](permutations.md),
[factorial](factorial.md)