Permutation: solutions to linear equation: Compute the number of all solutions $(x_1, x_2,\dots, x_n)$ of the equation $x_1+x_2+\dots+x_n=k$

355 Views Asked by At

Compute the number of all solutions $(x_1,x_2,\dots,x_n)$ of the equation $x_1+x_2+\dots+x_n=k$ in the case where $x_i\in\{m,m+1\}$, $i= 1,2,\dots,n$, for some natural number $m$.

I believe this is solutions to linear equations, and I think the order matters without repetition since $x_i\in(m,m+1)$, $m\in\Bbb N$. Wouldn't there be just one we can choose the $k$ variables in $\binom{n}{k}$ ways?

I am confused.

1

There are 1 best solutions below

4
On

One way to look at the problem is to let $y_i=x_i-m$ for $i=1,\ldots,n$. Then $y_i\in\{0,1\}$ for $i=1,\ldots,n$, and $x_1+\ldots+x_n=k$ iff $y_1+\ldots+y_n=k-nm$. Thus, the problem is equivalent to counting the solutions to $y_1+\ldots+y_n=k-nm$ such that $y_k\in\{0,1\}$ for $i=1,\ldots,n$.

Clearly there is a solution if and only if $0\le k-nm\le n$, and in that case $k-nm$ of the variables $y_i$ are $1$, the rest being $0$. How many ways are there to choose the $k-nm$ variables that are $1$?