Ways of selecting at most n objects from a set containing k distinct elements where each element can occur any number of times.

405 Views Asked by At

I have a box with a maximum capacity of n elements.

A state of the box is defined by the elements in it. There is an infinitely large heap which has k distinct elements; each element is available any number of times.

The box may be empty, have one element or full. Using elements from the heap how many states can the box be in.

1

There are 1 best solutions below

0
On BEST ANSWER

This can be replaced by selecting exactly $n$ objects from a set with $k+1$ elements, which has a standard formula $\binom{n+k}{n}$. The bijection is obtained in one direction by choosing exactly enough of the new choice to bring the total to $n$, and in the other direction by discarding all choices of the new element.