Count all events for k distinguishable items in n distinguishable bins

117 Views Asked by At

I want to count all the possible cases that I can distribute k distinguishable items in n distinguishable bins, for example for 3 items and 2 bins I have the next n^k the possible cases are:

enter image description here

I want to sum all the events, i.e., enter image description here

In the end, one case must to happened and the answer should be a,b,c. There isn´t restriction for n and k, and I can have empty bins.

2

There are 2 best solutions below

2
On

I might be mistaken, but I think that the general solution is $n^k$, which may be proven by induction on the number of items.

For example, to each placement of $k$ items in $n$ boxes, one may add an additional item $a_{k+1}$ at the end of any of the $n$ boxes to obtain all placements of $k+1$ distinguishable items in $n$ boxes. Thus, the number of solutions is $n\cdot A(n,k)=n^{k+1}$, by induction hypothesis. (Here $A(n,k)$ is the number of solutions of our problem with $n$ boxes and $k$ items).

0
On

The number of ways to assign $k$ distinguishable items in $n$ distinguishable bins is given by the function $F(n,k)=n^k$: the first item can be placed in one of $n$ bins, so can the second, etc.

If the bins are distinguishable but the items are not, then this number is given by $\binom{n+k-1}{k-1}$.