In how many ways 13 non distinguishable objects can be distributed among 7 persons so that every person get at least one object.

combinationscombinatoricspermutations

In how many ways $13$ non distinguishable objects can be distributed among $7$
persons so that every person get at least one object and atleast one person gets $4$
objects but not more.

My Approach: $x_1+x_2+x_3+x_4+x_5+x_6+x_7=13$

such that $1\leq x_1,x_2,x_3,x_4,x_5,x_6,x_7 \leq 4$

I used Generating Function Method that is

coefficient of $x^{13}$ in expansion of $(x^1+x^2+x^3+x^4)^7$

$\implies$ coefficient of $x^6$ in expansion of $(1+x+x^2+x^3)^7$

$\implies$ coefficient of $x^6$ in $\bigl(\frac{1-x^4}{1-x})^7$

$\implies$ coefficient of $x^6$ in $(1-x^4)^7 (1-x)^{-7}$

$\implies$ Coefficient of $x^6$ in $(1-7 \cdot x^4+…){7+r-1 \choose 7-1}x^r$

$\implies$ Coefficient of $x^6$ in ${6+r \choose 6}x^r-7{6+r \choose 6}x^{4+r}$

After putting $r=6$ and $r=2$, I got

=${12 \choose 6}-7\cdot {8 \choose6}=728$

Which Does not match with given answer

I Just want to know Why Am I not getting Answer with this method. I know other method to solve the problem

Best Answer

As mentioned in comments by JMoravitz, your solution distributes identical objects to persons such that each gets at least one object and maximum of $4$ objects. What it does not ensure is that at least one person gets $4$ objects. There are multiple ways to fix it, one of them being -

$ \text {Coefficient} [(x+x^2+x^3+x^4)^7, x^{13}] - \text {Coefficient} [(x+x^2+x^3)^7, x^{13}]$

$ = 728 - 357 = 371$

The second term gives you all arrangements where no person gets $4$ objects and we subtract it from number of arrangements without this specific restriction.