combinationsWithRep.md (1033B)
1 <!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. --> 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 ### Throws 33 34 Type | Description 35 ---- | ----------- 36 37 38 ## Examples 39 40 ```js 41 math.combinationsWithRep(7, 5) // returns 462 42 ``` 43 44 45 ## See also 46 47 [combinations](combinations.md), 48 [permutations](permutations.md), 49 [factorial](factorial.md)