Counting the sets with elements satisfying $k_i\ge0$, $\sum_i k_i=K$, $\sum_i i k_i=N $.

183 Views Asked by At

Let $(k_0,k_1,k_2\dots) $ be an ordered set of non-negative integer numbers. Let $A (N,K)$ be the number of distinct $k $-sets such that $$\sum_i k_i=K, \quad\sum_i i k_i=N.\tag{1} $$

Is there a special name for $A (N,K)$ and what is the most effective way to compute its value for given $K$ and $N$? Is there an effective way to construct all $k$-sets satisfying (1).

The following table shows $A(N,K)$ for $0\le N,K\le11$:

$$ \left(\begin{array}{rrrrrrrrrrrr} 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 0 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 0 & 1 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 & 2 \\ 0 & 1 & 2 & 3 & 3 & 3 & 3 & 3 & 3 & 3 & 3 & 3 \\ 0 & 1 & 3 & 4 & 5 & 5 & 5 & 5 & 5 & 5 & 5 & 5 \\ 0 & 1 & 3 & 5 & 6 & 7 & 7 & 7 & 7 & 7 & 7 & 7 \\ 0 & 1 & 4 & 7 & 9 & 10 & 11 & 11 & 11 & 11 & 11 & 11 \\ 0 & 1 & 4 & 8 & 11 & 13 & 14 & 15 & 15 & 15 & 15 & 15 \\ 0 & 1 & 5 & 10 & 15 & 18 & 20 & 21 & 22 & 22 & 22 & 22 \\ 0 & 1 & 5 & 12 & 18 & 23 & 26 & 28 & 29 & 30 & 30 & 30 \\ 0 & 1 & 6 & 14 & 23 & 30 & 35 & 38 & 40 & 41 & 42 & 42 \\ 0 & 1 & 6 & 16 & 27 & 37 & 44 & 49 & 52 & 54 & 55 & 56 \\ \end{array}\right) $$ By numerical evidence the following recurrence relation applies: $$ A(N,K)=A(N,K-1)+A(N-K,K),\tag{2} $$ with the convention $A(N,K)=0$ for $N<0$.

2

There are 2 best solutions below

0
On BEST ANSWER

$A(N,K)$ can be interpreted as the overall number of possible outcomes of putting $N$ indistinguishable balls into $K$ indistinguishable bins, $k_i$ being the number of bins containing $i$ balls.

Thus, $A(N,K)$ is nothing else as the number of partitions of $N$ into $K$ non-negative summands.

The bijection between the integer partitions of $N$ into $K$ non-negative parts and $k$-sets can be established as follows. Let $n=(n_1,n_2,\dots,n_K)$ be such a partition ($\sum_{j=1}^K n_j=N $). Introduce function $f:\ n\mapsto(k_0,k_1,k_2\dots)$ which for all $i\ge0$ assigns $k_i$ to the count of occurrences (multiplicity) of the number $i$ in the partition $n:\ k_i=\sum_{j=1}^K\delta_{in_j}$. By construction $k_i\ge0$, $\sum_{i\ge0 }k_i=K$, and $\sum_{i\ge0 }i k_i=N$. Obviously the function is bijective.

The described procedure represent probably the most efficient way to construct $k$-sets for given $N$ and $K$ provided an effective method to partition integer numbers into non-negative (or positive) summands.

The proof of the recurrence relation (2) can be carried out as follows. $A(N,K)$ is the number of partitions of $N$ into $K$ non-negative parts. The partitions can be subdivided in those which have at least one summand equal to 0 and those which have only positive summands. In the latter case we can subtract 1 from every summand to get the partition of $N-K$ into $K$ parts. In the former case we can consider 0 as a given part and reduce the problem to partitioning of the number $N$ into $K-1$ parts.

1
On

Old answer

It is the coefficient of $x^K y^N$ in the function \begin{eqnarray*} \prod_{i=0}^{\infty} (1+x^{k_i} y^{ik_i}). \end{eqnarray*} Not sure if this has a special name, but the above gives a method to compute $A(K,N)$.

New answer

Edit: (In light of the updated question & Alex Zorn's comment)

Consider the infinite product \begin{eqnarray*} \prod_{i=0}^{\infty} \frac{1}{(1-x y^{i})} =&(1+xy+ \cdots +x^{k_1}y^{k_1}+ \cdots) \times \\ &(1+xy^2+ \cdots +x^{k_2}y^{2k_2}+ \cdots) \times \\ & \ddots \\ &(1+xy^i+ \cdots +x^{k_i}y^{ik_i}+ \cdots) \times \cdots \end{eqnarray*} The coefficient of $x^{K} y^{N}$ will give $A(K,N)$ where $A(K,N)$ is the number of partitions of $N$ into $K$ parts. $k_i$ counts the multiplicity of the value $i$ in the partition represented by the product that gave a specific $x^{K}y^{N}$ term.