In how many ways can I distribute ten identical breadcrumbs to four ducks if I don’t necessarily care about fairness?
This appears in a speed test, and if I had enough time I would be able to list out all the possible combinations for ducks a,b,c,d and use permutations, but it takes way too long. Is there any faster way to do this?
Imagine placing the ten crumbs in a row and now you have eleven spaces between them (including the left and right ends).
Now you need to place three partitions in the eleven spaces, so you can use combinations. Crumbs before the first partition go to duck 1, crumbs between the first and second partition go to duck 2, and so on.
There are some cases where the partitions can coincide also. Maybe the Wikipedia link has a better approach; I'll see it too.