## Combinations With Repetitions FunctionMath Probability Class

```Public Function CombinationsWithRepetitions( _
ByVal vNumber As Variant _
, ByVal vChosen As Variant _
) As Variant```

### Combinations of N things taken C at a time, WITH repetitions.

Summary: Function returns the number of possible ways of arranging C objects chosen from N objects when the order of the chosen objects does not matter (such as in playing card games) and when the same object can be chosen multiple times (unlike in most playing card games).
Examples:
```    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) = 4292145```
```    Combinations Function
```    Factorial(N + C - 1) / (Factorial(C) * Factorial(N - 1))