1 |
|
2 |
|
3 | # Function combinationsWithRep
|
4 |
|
5 | Compute the number of ways of picking `k` unordered outcomes from `n`
|
6 | possibilities, allowing individual outcomes to be repeated more than once.
|
7 |
|
8 | CombinationsWithRep only takes integer arguments.
|
9 | The following condition must be enforced: k <= n + k -1.
|
10 |
|
11 |
|
12 | ## Syntax
|
13 |
|
14 | ```js
|
15 | math.combinationsWithRep(n, k)
|
16 | ```
|
17 |
|
18 | ### Parameters
|
19 |
|
20 | Parameter | Type | Description
|
21 | --------- | ---- | -----------
|
22 | `n` | number | BigNumber | Total number of objects in the set
|
23 | `k` | number | BigNumber | Number of objects in the subset
|
24 |
|
25 | ### Returns
|
26 |
|
27 | Type | Description
|
28 | ---- | -----------
|
29 | number | BigNumber | Number of possible combinations with replacement.
|
30 |
|
31 |
|
32 | ## Examples
|
33 |
|
34 | ```js
|
35 | math.combinationsWithRep(7, 5) // returns 462
|
36 | ```
|
37 |
|
38 |
|
39 | ## See also
|
40 |
|
41 | [combinations](combinations.md),
|
42 | [permutations](permutations.md),
|
43 | [factorial](factorial.md)
|
44 |
|
\ | No newline at end of file |