Suppose you have 7 coins. How would you distribute these coins into 4 buckets? We will use a "stones and sticks" diagram to give us a visual aid. These circles (or stones) represents the coins:
We will add 3 sticks in between some of the coins:
The sticks divide the coins into groups. According to the diagram above, the first bucket contains one coin and the second, third and fourth buckets contains two coins. Let's consider a different diagram:
According to this diagram, the first and fourth buckets contains no coins, the second bucket contains five coins and the third bucket contains 2 coins. We can represent these diagrams as a bit strings:
How many ways are there to arrange the 1's and 0's in a bit string. According to this article, a bit string of length 10 and weight 3 can be arranged in \(\binom {10} 3\) ways.
We can generalize this and say that if we want to group \(x\) items into \(y\) buckets, then there are \(C^{x + y-1}_{y-1}\) ways of doing so.