1

Count the number of group of possitive variables of equation $x_1+x_2+...+x_k=n$ $\forall$ $1\le x_i\le m$, $1 \le i \le k$

For examples:

  • $x_1+x_2+x_3=5$ $\forall$ $ x\le 2$ the answer is 3 because we have 3 groups $(1,2,2), (2,1,2), (2,2,1)$

  • $x_1+x_2+x_3+x_4=10$ $\forall$ $ x\le 4$ the answer is $4!+\frac{4!}{2!*2!}+\frac{4!}{3!}=34$ because we have permutation of groups $(1,2,3,4), (4,4,1,1), (3,3,3,1)$

I have no idea to solve the condition of the equation. I have tried to use opposite event for all variables like: $x \le 2$ change to $x \geq 3$ then set $y=x-3$ change equation to $y_1+y-2+...+y_k=n-3*k$ at both side of equation but it does not true

Any help would be appreciated

Becker
  • 123

1 Answers1

1

Hint:

The coefficient of $y^{n}$ from

$$ \left(\sum_{j=1}^{m}{y^{j}}\right)^{k} $$

Another approach will be inclusion - exclusion.

$$ \sum_{j=0}^{\left\lfloor\frac{n-k}{m}\right\rfloor}{\binom{k}{j}\binom{n-1-jm}{k-1}\left(-1\right)^{j}} $$

Basically calculating all positive integer solutions and then substracting the number of solutions which have any $x_{i}>m$

acat3
  • 11,897
  • can you explain it more detail please? What does $y^i$ mean? – Becker Mar 11 '20 at 05:29
  • you have mentioned about "coefficient", does that mean the formula above is generating funciton? – Becker Mar 11 '20 at 06:24
  • @Becker yes You can say so. For Your first example, we want to find the coefficient of $x^{5}$ from $(x+x^{2})^{3}=x^{3}(1+x)^{3}$ which is $\binom{3}{2}=3$ – acat3 Mar 11 '20 at 07:38
  • Is there any other approach? I am finding information about it and try to understand because I haven't learnt about generating function – Becker Mar 11 '20 at 07:48
  • @Becker added the inclusion - exclusion, You may want to read about inclusion - exclusion from other source too – acat3 Mar 11 '20 at 08:02
  • I think the second solution is more difficult than the first one =)). Anyway thanks for your help – Becker Mar 11 '20 at 08:22