Placing $n$ elements into $k$ boxes - combinations with repetitions - order of elements matters

220 Views Asked by At

Imagine such situation: We have $n$ uniquely colored T-shirts and $k$ drawers. Whenever we want to put a T-shirt in the drawer, we fold it and place on top of the previous one already placed in the drawer.
In how many ways can we distribute these T-shirts between $k$ drawers? Not all drawers have to be used. The pile Red->Green->Blue is not the same pile as Green->Blue->Red.

This problem has been puzzling me for a very long time. $k^n$ seems to be very close to the actual answer, however, it does not cater for the order. Namely, imagine that we have $3$ T-Shirts and $2$ drawers. The first one can go to $2$ drawers, so can the second one and so can the third one. Let's say that their colors are cyan, magenta and yellow respectively. Then, if we decide that all of them go to the same drawer, we will get this pile: Yellow->Magenta->Cyan - there is no way we can get Cyan->Yellow->Magenta.

Any hints will be most appreciated.

1

There are 1 best solutions below

1
On BEST ANSWER

We can divide the t-shirts into $k$ piles by using $k - 1$ identical pieces of cardboard as dividers. Thus, we have $n + k - 1$ objects to arrange, of which $k - 1$ are identical. We choose $k - 1$ of the $n + k - 1$ positions for the identical pieces of cardboard that will serve as dividers, then arrange the $n$ different t-shirts in the remaining $n$ positions in $n!$ ways. The t-shirts, if any, above the first divider go in the first drawer; the t-shirts, if any, between the first and second divider go in the second drawer. Continuing in this way, we place all $n$ t-shirts in the $k$ drawers. Hence, there are $$\binom{n + k - 1}{k - 1}n!$$ ways to place $n$ distinct t-shirts in $k$ drawers, given that the order of the t-shirts within a drawer matters.