Public Function CombinationsWithRepetitions( _ ByVal vNumber As Variant _ , ByVal vChosen As Variant _ ) As Variant
CombinationsWithRepetitions(1, 1) = 1 CombinationsWithRepetitions(2, 1) = 2 CombinationsWithRepetitions(2, 2) = 3 CombinationsWithRepetitions(4, 1) = 4 CombinationsWithRepetitions(4, 2) = 10 CombinationsWithRepetitions(4, 3) = 20 CombinationsWithRepetitions(4, 4) = 35 CombinationsWithRepetitions(21, 9) = 10015005 CombinationsWithRepetitions(9, 21) = 4292145See also:
Combinations Function Permutations Function Factorial FunctionvNumber: The number of non-unique items from which combinations can be constructed. Function returns Null if vNumber is Null, cannot be interpreted as a number, or is less than zero (<0). vNumber will be rounded down to the nearest integer.
Factorial(N + C - 1) / (Factorial(C) * Factorial(N - 1)) Combinations(N + C - 1, C)v1.5 Pro Note: The argument names and the implementation of this function has changed.
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.