I'm failing to extend the "stars and bars" technique from Natural to integer numbers. HELP!
How many vectors $\mathbf{X}$ exist such that $\mathbf{X}$ is a vector of $D$ integer numbers where each element $\mathbf{X}(i)$ is between $-N$ and $+N$ and $\sum_{i=1}^D |\mathbf{X}(i)| = N$?
I'm looking for the combinatorial formula as a function of $D$ and $N$.
Thank you!
Start by ignoring all the negative options for the $X(i)$. Now you have a classic stars and bars problem that allows $0$ in the sum. Any sum that involves $k$ zeros and $D-k$ nonzeros represents $2^{D-k}$ solutions because you can negate all the nonzero items. You need to condition on the number of zeros.