1

How many solutions over $\mathbb{Z}$ to the equation $|x_1|+|x_2|+|x_3|+\dots+|x_{k-1}|+ |x_k|= n$?

Notes:

  1. The order does matter. For instance, $1+2+3$ is different from $3+2+1$.

  2. To avoid misunderstandings - $|x_1|$ denotes absolute value and $0 \in \mathbb{Z}$.

Please any help. I honestly don't know how to approach this one. Thank you

Ashuv Halim
  • 213
  • 1
  • 8
  • Here's how to count them with only positive solutions. https://math.stackexchange.com/questions/31562/number-of-ordered-partitions-of-integer . Multliply each solution with $k$ parts by $2*k$ to count the possible sign combinations. – Ethan Bolker Feb 08 '18 at 14:30
  • 1
    @EthanBolker $0=-0$ How do you deal with that? – ajotatxe Feb 08 '18 at 14:32
  • If you allow $0$ as a summand you must be working with a fixed $k$, else there will be infinitely many solutions. If that's the case, multiply by $2^j$ where $j$ is the number of nonzero summands. No more back and forth in comments, please. It might help if you edit the question to write out all the solutions you want to count for $n=3$. – Ethan Bolker Feb 08 '18 at 14:35
  • @EthanBolker I apologize for this back and forth comment, but... note that I'm not the OP. – ajotatxe Feb 08 '18 at 14:37
  • @AshuvHalim Your problem seems to assume that $k$ is fixed, that is, the answer should be a function on $k$ and $n$. Please confirm. – ajotatxe Feb 08 '18 at 14:44
  • Indeed. The answer depends on $n$ and $k$. – Ashuv Halim Feb 08 '18 at 14:49

2 Answers2

2

The solution for positive integer ${<}x_i{>}$ is relatively simple; inserting $k{-}1$ separators into $n{-}1$ gaps, $\binom {n-1}{k-1}$. Then allow those integers to be negative producing a multiple of $2^k$.

Then we have to allow the ${<}x_i{>}$ to also be zero; between $1$ and $k{-}1$ of them. So we choose the zero elements, then repeat the above calculation, and sum across all those.

This gives $$\sum_{i=0}^{k-1} \binom ki \cdot 2^{k-i} \cdot \binom {n-1}{k-i-1}$$

Joffan
  • 39,627
0

As a start, if $k=2$: $$\begin{align} (0,-1),(-1,0) \ \ & | 1 | \ \ (0,1),(1,0); \\ (-2,0),(-1,1),(1,-1),(0,-2) \ \ & | 2 | \ \ (0,2),(1,1),(2,0); \\ (-3,0),(-2,1),(-1,2),(0,-3),(1,-2),(2,-1) \ \ & | 3 | \ \ (0,3),(1,2),(2,1),(3,0); \\ \cdots \\ 2n \ \ | n | \ \ n+1 \Rightarrow 3n+1. \end{align}$$

farruhota
  • 31,482