-6

How to count the number of nonnegative integer solutions to $x_1 + x_2 + x_3 + x_4 = 21$ such that $x_1$, $x_2$, $x_3$, $x_4 ≤ 7$

  • Count the solutions if you don't care about the upper bound. Apply inclusion-exclusion based on if any violated the upper bound conditions noting it is possible for multiple to violate simultaneously. – JMoravitz Feb 08 '21 at 19:51
  • Two reasons why I can't give a meaningful hint/answer: [1] You have shown no work [2] All of the concepts that I would utilize have been captured in the pre-existing comments of J Moravitz and Dietrich Burde, above. What I can comment is that this Stars and Bars article will be helpful. – user2661923 Feb 08 '21 at 19:55
  • I have counted $120$ solutions. – Raffaele Feb 08 '21 at 19:56
  • 1
    @user2661923 Why? It is just a comment. It should lead to a wider partecipation of OP who seems like vanished. I am Notheist, tho :D – Raffaele Feb 08 '21 at 20:00
  • @DietrichBurde I deleted my comment - you're right. I incorrectly assumed that the person giving the comment was the OP, and reacted in frustration. – user2661923 Feb 08 '21 at 20:01
  • @user2661923 No problem, this happened to me several times, too. I will delete my comments, too, if you agree. – Dietrich Burde Feb 08 '21 at 20:01

1 Answers1

1

If you think about it you can see that you want the coefficient of $x^{21}$ in the expansion of $(1+x+x^2+\cdots + x^7)^4.$ I don't know an easy way to get that, but on a symbolic algebra calculator the coefficient is $120.$

coffeemath
  • 7,403
  • 1
    There are generally two approaches to this type of question, Stars and Bars (as suggested by the comments following the query) and generating functions. I know that Stars and Bars (+ Inclusion-Exclusion) yields the following computation, and I suspect that generating functions does as well: $$\binom{24}{3} - 4\binom{16}{3} + 6\binom{8}{3}.$$ Note that $\binom{24}{3}$ represents $\binom{n+[k-1]}{k-1}$, and that if more than 2 of the variables exceed $7$, then the sum can not be less than $24$. – user2661923 Feb 08 '21 at 21:56
  • 1
    In the above comment, the expression $\binom{16}{3}$ represents $x_1 + \cdots + x_4 = 21$ and $x_1 \geq 8$ which bijects to $x_1 + \cdots x_4 = 13$ and each of the variables is non-negative. The coefficients $\binom{4}{1}$ and $\binom{4}{2}$ represent the number of ways of selecting which single variable or which pair of variables will violate the constraint by each being $\geq 8.$ – user2661923 Feb 08 '21 at 22:02
  • @user2661923 I see what you're getting at. – coffeemath Feb 08 '21 at 22:14
  • @user2661923 Just checked and your method also gives 120. Thanks. – coffeemath Feb 08 '21 at 22:17