Number of solutions to $n=\sum_{i=1}^{r} x_i ;\forall i, 1\le x_i\le k; \exists i ,x_i\ge d$ for $r\in \mathbb N$

78 Views Asked by At

Given an integer $n$ we need to partition it into ordered tuples of variable length such that they consist of integers from $1$ to $k$ and atleast one of them greater than $d$ such that sum of them is equal to $n$, example:

$n=4,\;k=3,\;d=2$
$(1,1,2),\;(1,2,1),\;(2,1,1),\;(1,3),\;(3,1),\;(2,2)$
Sum of each tuple is 4 and there exists atleast one number greater than $2$ and every number is from $\{1,2,3\}$.
Total 6 such tuples.

Now here is what I have tried, let us consider all ordered tuples (of length $r\in \mathbb N$ such that sum of them is $n$ and integers from $\{1,2,..k\}$, which will be coefficient of $x^n$ in: $$\sum_{r=1}^{\infty}(x^1+x^2+...+x^k)^r=\sum_{r=1}^{\infty}\left(x\frac{x^k-1}{x-1}\right)^r=\left(x\frac{x^k-1}{x-1}\right)\frac1{1-\left(x\frac{x^k-1}{x-1}\right)}=\frac{x(x^k-1)}{(x-1)-x(x^k-1)}$$ Similarly the ones which do not qualify are all those which have $x_i$ less than $d$, i.e. coefficient of $x^n$ in: $$\sum_{r=1}^{\infty}(x^1+x^2+...+x^{d-1})^r=\sum_{r=1}^{\infty}\left(x\frac{x^{d-1}-1}{x-1}\right)^r=\left(x\frac{x^{d-1}-1}{x-1}\right)\frac1{1-\left(x\frac{x^{d-1}-1}{x-1}\right)}=\frac{x(x^{d-1}-1)}{(x-1)-x(x^{d-1}-1)}$$

Thus the required ones are the coefficient of $x^n$ in: $$\frac{x(x^k-1)}{(x-1)-x(x^k-1)}-\frac{x(x^{d-1}-1)}{(x-1)-x(x^{d-1}-1)}\\ =\frac{x(x-1)(x^k-x^{d-1})}{[(x-1)-x(x^k-1)][(x-1)-x(x^{d-1}-1)]}$$

Any help?

1

There are 1 best solutions below

0
On BEST ANSWER

Your computation of the generating function looks good. You seem to be asking how to extract its coefficients. To avoid repetition, let's just consider the part of your generating function that appears in both terms $$g(x)=\frac{-1}{(x-1)-x(x^\ell-1)}=\frac1{1-2x+x^{\ell+1}}$$ and call this $\sum_{m\ge0}a_{m,\ell}x^m$. (You have $\ell$ being $k$ and $d-1$.) Then in terms of the $a$'s, the coefficient of $x^n$ in your generating function would be $$a_{n-1,k}-a_{n-k-1,k}-a_{n-1,d-1}+a_{n-d,d-1}.$$ So, the problem is reduced to finding a good formula for $a_{m,\ell}$. There are a couple of ways to do this, either approximately or exactly.

In the approximate method (for large $\ell$), notice that the smallest singularity of $g$ is slightly larger than $\frac12$. By one iteration of Newton's method, this singularity is approximatley $\frac12+\frac1{2^{\ell+2}}$. Expanding $g$ in its partial fractions decomposition and throwing away the terms from larger singularities, we get $$g(x)\approx\dfrac1{1-\dfrac x{\dfrac12+\dfrac1{2^{\ell+2}}}}.$$ So, $a_{m,\ell}\approx\left(\frac12+\frac1{2^{\ell+2}}\right)^{-m}$.

If you prefer an exact formula, notice that \begin{eqnarray*} % \nonumber to remove numbering (before each equation) g(x) &=& \dfrac1{1-2x\bigl(1-\frac12x^\ell\bigr)} \\ &=& \sum_{n\ge0} 2^nx^n\bigl(1-\frac12x^\ell\bigr)^n. \end{eqnarray*} Expanding the factor of $\bigl(1-\frac12x^\ell\bigr)^n$ with the binomial theorem, we get \begin{eqnarray*} % \nonumber to remove numbering (before each equation) g(x) &=& \sum_{n\ge0}2^nx^n\sum_{j=0}^n\binom nj\frac1{(-2)^j}\,x^{j\ell} \\ &=& \sum_{j,n}2^n\binom nj \frac1{(-2)^j}\,x^{n+j\ell}. \end{eqnarray*} Extracting the coefficient of $x^m$ here, we get the exact formula $$a_{m,\ell}=\sum_j (-1)^j 2^{m-j(\ell+1)}\binom{m-j\ell}{j}.$$