1

I have $n$ distinct objects, namely {$n_{1\le i \le n}$} with an infinite supply of each of them, and I have $k$ identical, indistinguishable urns to place the objects in. Each urn will contain exactly one item.

Let $P(n,k)$ be the number of ways to do it.

$P(2,2)=3$. There are 3 different ways to do it: {$n_1,n_1$}, {$n_2,n_2$}, {$n_1,n_2$}

$P(3,3)=10$ because: {$n_1,n_1,n_1$}, {$n_2,n_2,n_2$}, {$n_3,n_3,n_3$},{$n_1,n_1,n_2$}, {$n_1,n_1,n_3$},{$n_2,n_2,n_1$}, {$n_2,n_2,n_3$}, {$n_3,n_3,n_1$}, {$n_3,n_3,n_2$}, {$n_1,n_2,n_3$}

Note that I do not constrict myself to $n=k$ although these were my examples. What is the general formula/solution to $P(n,k)$ if such one exists?

Thanks in advance.

Asaf Karagila
  • 405,794
Matan
  • 821

1 Answers1

1

This is a non-standard rewording of the usual Stars and Bars problem (please see Wikipedia). Let $x_i$ be the number of urns that will contain an object of Type $i$. We want to find the number of solutions in non-negative integers of the equation $x_1+\cdots+x_n=k$.

The number of solutions is $\binom{k+n-1}{n-1}$, or equivalently $\binom{k+n-1}{k}$.

André Nicolas
  • 514,336
  • I was thinking.. What if the urns are distinct as well? – Matan May 29 '15 at 17:38
  • Then it is the number of functions from a $k$-element set to an $n$-element set, so $n^k$. – André Nicolas May 29 '15 at 17:47
  • Ah, indeed, was too stupid to see this lol. – Matan May 29 '15 at 17:53
  • The question in the comment, just like the question in the OP, is an unusual verbal "twist" on a familiar problem. – André Nicolas May 29 '15 at 17:56
  • Hey, I'm still having a little trouble.. Take $P(2,3)$ for example. We have 2 objects, and 3 urns. I count the following: {$n_1,n_1,n_1$} , {$n_2,n_2,n_2$} , {$n_1,n_1,n_2$} , {$n_2,n_2,n_1$}. The binomial in your answer gives $\binom {4}{2} = 6$. I'm guessing it also counts the following: {$n_1,n_2,n_1$} , {$n_2,n_1,n_2$}, but I don't want it to, because as I said, the urns are identical, so the order does not matter, and hence these two are copies of the 3rd and 4th firstly-mentioned arrangements. So.. Is there another solution to what I need? Hope I explained myself better. – Matan May 30 '15 at 21:59
  • For your example, we have $n=2$ and $k=3$, The formulas in my answer give $\binom{4}{1}$ or equivalently $\binom{4}{3}$, which is $4$. – André Nicolas May 30 '15 at 22:04