UNPKG

939 BMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function permutations
4
5Compute the number of ways of obtaining an ordered subset of `k` elements
6from a set of `n` elements.
7
8Permutations only takes integer arguments.
9The following condition must be enforced: k <= n.
10
11
12## Syntax
13
14```js
15math.permutations(n)
16math.permutations(n, k)
17```
18
19### Parameters
20
21Parameter | Type | Description
22--------- | ---- | -----------
23`n` | number &#124; BigNumber | The number of objects in total
24`k` | number &#124; BigNumber | The number of objects in the subset
25
26### Returns
27
28Type | Description
29---- | -----------
30number &#124; BigNumber | The number of permutations
31
32
33## Examples
34
35```js
36math.permutations(5) // 120
37math.permutations(5, 3) // 60
38```
39
40
41## See also
42
43[combinations](combinations.md),
44[combinationsWithRep](combinationsWithRep.md),
45[factorial](factorial.md)
46
\No newline at end of file