Distribute n identical objects into r distinct groups Is there a separate formula for calculating distribution of n identical objects into r distinct groups? I read this particular concept in a book but did not understand it. Any help would be thoroughly appreciated.
Also, what exactly do u mean by distinct groups? Does that mean that the groups differ on the basis of no of objects they contain? Or, if u think of groups as boxes, does it mean the boxes itself are different regardless of no of objects in them?
EDIT : How would the answer differ if instead of distinct groups/boxes, we have identical groups/boxes?
 A: This is called stars and bars method. suppose the stars are objects and space between bars represents objects corresponding to a certain group. Here is a visual representation:
$\underbrace{*****}_{\text{first group}}|\underbrace{******}_{\text{second group}}|\underbrace{*****}_\text{third group}|\underbrace{**}_\text{fourth group}$
Check each arrangement of bars provides a unique group separation and each group separation corresponds to a unique bar arrangement.Also check to seperate the stars in n groups only (n-1) bars are required.
then all you need to do is see how many bar arrangements are possible. Observe that when you have the $n-1$ bars and $k$ stars (assuming there are k objects to sort into n groups) then there are $n-1+k$ positions the stars and bars can take. So there are $\binom{n+k-1}{n-1}$ ways to chose the positions of the bars.

The problem gets harder when the boxes are identical, because for example: he following arrangements are the same: $*|***|**$ and $**|*|***$ In the problem where the boxes are different the answer would somehow correspond to distributing coins between people. When the boxes are identical however it corresponds to finding the number of partitions of the number into x or less non-zero parts. So if we define $p_k(n)$ to be the number of partitions of n numbers into exactly $k$ non-zero pieces then we get the number of ways to put n identical marbles into k identical boxes is $\sum_{k=0}^np_k$. However there is no pretty formula to calculate $p_k$ or $\sum_{k=0}^np_k$.
