[Math] Distributing identical objects into distinct boxes

combinatoricsproof-writing

The problem I'm trying to solve is: find the number of ways of distributing $r$ identical objects into $n$ distinct boxes such that no box is empty, where $r \geq n$. I've found conflicting answers to this in numerous searches, and I'm hoping someone might be able to point me in the direction of how to arrive at the correct one. Thanks so much!

Best Answer

stars and bars - represent the r identical object as r stars ****** you can divide them into boxes by placing bars in between stars so **|*|*** represents six objects split into three boxes with 2 in the first box, 1 in the second, and three in the third.

in general there will be $r$ stars , leaving $(r-1)$ positions to place the $(n-1)$ bars.

The total number of ways to position the bars is given by $\binom{r-1}{n-1}$