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

1.0 KiB

Function combinationsWithRep

Compute the number of ways of picking k unordered outcomes from n possibilities, allowing individual outcomes to be repeated more than once.

CombinationsWithRep only takes integer arguments. The following condition must be enforced: k <= n + k -1.

Syntax

math.combinationsWithRep(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 Number of possible combinations with replacement.

Throws

Type Description

Examples

math.combinationsWithRep(7, 5) // returns 462

See also

combinations, permutations, factorial