MARBLES PROBLEM

HOW IT GET n-1Ck-1 agter assigning feash marbles one

hello @epic007

are u familiar with stars and bars ?

I am not familiar with star and bars

We draw n
stars in a row to represent the cakes, and k−1 bars to divide them up. All of the stars to the left of the first bar are cakes of the first type; stars between the first two bars are of the second type;

**|***||*|

Here’s an example with n=6
and k=5. We’re getting 2 of the first type, 3 of the second type, 0 of the third type, 1 of the fourth type, and 0 of the fifth type.
In order to solve the problem, we just need to reorder the stars and bars by choosing the k−1
spots for the bars out of the n+k−1 total spots, so our answer is:

(n+k−1 ) C (k−1)

((n-k)+k-1)C(k-1) => (n-1)C(k-1)