nmultichoosek
nmultichoosek is a combinatorial function that counts the number of ways to choose k elements from an n-element set when repetition is allowed and the order of selection is irrelevant. Equivalently, it counts the number of multisets of size k drawn from an n-element universe.
For nonnegative integers n and k, nmultichoosek(n, k) equals the multiset coefficient binomial(n + k - 1, k)
In mathematical practice, nmultichoosek can be interpreted as the coefficient of x^k in the expansion of (1
Examples: nmultichoosek(5, 3) = binomial(7, 3) = 35, and nmultichoosek(4, 2) = binomial(5, 2) = 10. Applications include counting multisets