Combinations of balls and slots

balls-in-binscombinations

Lets say I have 4 balls (numbered 1, 2, 3, 4) and 15 slots.

Each of the 15 slots can hold minimum 0 balls and maximum 4 balls.

It is not necessary to place all balls in the slots. i.e. We can put only 1 ball, or only 2 balls, or even 0 balls in the 15 slots.

The order in which the balls are placed in the slots does not matter.

For example –

Slot    Combin 1    Combin 2    Combin 3    Combin 4    Combin 5    Combin 6
1       1,2,3,4     1,2,3       0           1,4         1           0
2       0           0           3,1,2       0           2           0
3       0           0           0           0           3           0
4       0           0           0           0           4           0
5       0           0           0           0           0           0
6       0           0           0           2,3         0           0
7       0           0           0           0           0           0
8       0           0           0           0           0           0
9       0           0           0           0           0           0
10      0           0           0           0           0           0
11      0           0           0           0           0           0
12      0           0           0           0           0           0
13      0           0           0           0           0           0
14      0           0           0           0           0           0
15      0           4           0           0           0           0

How many unique combinations are possible? Which formula would be applicable for this scenario?

Thanks!

Best Answer

There are $15$ choices of slot for each ball, and these choices are made independently for each ball, so they can be made in $15^4=50,625$ ways. Equivalently, you’re just counting the possible $4$-tuples of slot numbers, where $\langle 1,1,1,1\rangle$ represents your first combination, $\langle 1,1,1,15\rangle$ represents your second combination, $\langle 1,6,6,1\rangle$ represents your fourth combination, and so on.

Related Question