A famous counting problem is to calculate the number of ways $n$ identical objects can be put into $m$ identical bins. I know that this problem is somewhat equivalent to Partition problem. There is no closed formula to compute this number, but I found the following formula somewhere (my source is not in english): $$\sum_{j=1}^{\min(m,n)}\sum_{i=1}^j\frac{(-1)^{i+j}}{j!}C_{i}^{j}i^n $$ And here is the explanation from the source:
We first suppose that bins are not identical. Then we do the counting for when only one bin is not empty, then when only two bins are not empty and so on. In each case, we have to divide the resulting number to the number of permutations of the non-empty bins. In the end, we take a summation over all such numbers.
But I don't get the formula. Where does the $(-1)^{i+j}$ part come from? Why it has to be a double summation?