Ways to form n using the elements in [k] without repetition

36 Views Asked by At

Is there a closed formula for $f(n,k)$ where $f(n,k)$ is equal to the number of different ways to sum the elements from $[k] = \{0,1,2,3,...k\}$ without using the same element more than once to form $n$?

I am asking because I want to know what the probability distribution function of the $W_\pm$ in the Wilcoxon Signed-Rank Test, and I believe that knowing the different ways the ranks could be summed up to add to $n$ is the first step to figuring this out.

I first thought that if $k>n$ then $f(n,k)=f(n,n)$, and that $f(n,n)=\frac{1}{2}\sum_{i=0}^n f(i,n)f(n-i,n)$, but it then occurred to me that the first $f(i,n)$ will probably change the $f(n-i,n)$. Combinatorics is not my strong suit.

1

There are 1 best solutions below

0
On

It the coefficent of $x^n$ in the following expression \begin{eqnarray*} (1+x)(1+x^2)(1+x^2) (1+x^{k-1}) \cdots (1+x^k) = \prod_{i=1}^{k} (1+x^i). \end{eqnarray*}