Logic of MARBLE problem

can u explain some math behind how this is n-1 C k-1 .

@Affan-Mokarram-202031887744398
Using a method that’s often called “stars 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.
so if we have to divide every marble as of single group or total n group we need (n-1) bars but we need only k group so we need (k-1) bars out of these (n-1) bars.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.