0

I want to find the number of positive integer solutions of the equations given by $$\sum_{i=1}^{10} x_i=30,\text{ where } 0 < x_i<7, \forall 1\le i\le 10.$$ I know the case that, for any pair of positive integers $n$ and $k$, the number of distinct $k$-tuples of positive integers whose sum is $n$ is given by the binomial coefficient ${n-1}\choose {k-1}$.
But, in my case there is a restriction of solutions that, for all $i$ we must have $0<x_i<7$, where $x_i$ are positive integers. Please help me to solve this. Thank you.

abcdmath
  • 1,933

2 Answers2

1

Following my comment, you can use Principle of Inclusion Exclusion. First find all ways (no upper bound on $x_i$), then subtract off number of ways given $x_1 > 5,$ given $x_2 > 5, \dots,$ given $x_{10} > 5,$ then add back number of ways given $x_i, x_j > 5$ for every $\{i, j\},$ then subtract off number of ways given $x_i, x_j, x_k > 5,$ you get the idea.

Display name
  • 5,144
1

Computing $(x+x^2+x^3+x^4+x^5+x^6)^{10}$ with Wolfram gives a coefficient of $2930455$ to $x^{30}$.

Eric
  • 6,348
  • Hooray for generating functions! I believe they are the simplest and most powerful way to address questions like this – H. sapiens rex Sep 04 '23 at 22:53
  • @H.sapiensrex However, a case can be made that such a use of generating functions is pointless, because (apparently) there is no elegant way of completing the problem without computer assistance. Then, if you compromise and allow computer assistance, you can simply programmatically loop through all possible ordered $~k$-tuples, where each $~k$-tuple represents the values assigned to $~x_1, \cdots, x_k.~$ From my perspective, either you are using computer assistance or you're not. My comment following the original posting provides a link to a completely analytical approach. – user2661923 Sep 05 '23 at 02:26
  • Generating functions are often the best approach. I agree an analytical approach would be better (not sure if your link applies since you never actually give a full formula that I could compute, though if you could calculate like 40 binomials without a computer, then I guess your approach might work). A neat hybrid approach would be to to compute $(x/(1-x)-x^7/(1-x))^n$ as a binomial sum (equivalent to PIE) and then substitute for the $1/(1-x)^j$ terms with a sum of binomial coefficients (like stars and bars). – Eric Sep 05 '23 at 04:26
  • 1
    Separately, it’s little odd to comment on other answers saying that yours is better - we should probably just close the question if this is a duplicate. – Eric Sep 05 '23 at 04:29
  • @Eric The point of my comment is that if you are going to post an answer involving generating functions, then at least some attempt should be made to provide an analytical method of computing the corresponding coefficient. At MathSE, there seems to be a pervasive trend towards generating functions as a replacement for [Stars and Bars + Incl.-Excl], without any discussion of some analytical means of computing the corresponding coefficient. ...see next comment – user2661923 Sep 05 '23 at 07:50
  • @Eric In this particular case, all of the upper bounds are equal. This means that when you compute $~T_j~$ it will automatically be $$\binom{k}{j} \times |S_1 \cap \cdots \cap S_j|.$$ This is not the first time that I've attempted to draw MathSE attention to the generating function difficulty of analytically computing the corresponding coefficient. In general, my attempts are ignored, and MathSE responders continue to advocate the generating function approach. – user2661923 Sep 05 '23 at 07:53
  • Because generating functions are not strictly worse - just different. My way gave me the answer in about 10 seconds and using generating functions plus your general idea gave me an analytic answer with another minute of work. If you’re curious how to approximate generating coefficients in general (and lots of creative ways of manipulating them), see Sedgewick’s Analytic Combinatorics. I didn’t bother with a general thing initially, because the original problem had a specific $n$ and as you pointed out (and never even gave a total closed form), it’s messy. – Eric Sep 05 '23 at 12:26