How many integer solution to $y_1+y_2+y_3+y_4\leq184$with $y_1>0,\,0<y_2\leq10,\,0\leq y_3\leq17 $ and $0\leq y_4\leq 19$

756 Views Asked by At

How many integer solution to the inequality $$y_1+y_2+y_3+y_4\leq184$$with $y_1>0,\,0<y_2\leq10,\,0\leq y_3\leq17 $ and $0\leq y_4< 19$

MY try:For two variable I could try to solve by graphical method but for this, I don't know.Thank you

2

There are 2 best solutions below

1
On

For given values of $y_2$, $y_3$, and $y_4$, there are $184-y_2-y_3-y_4$ valid choices for $y_1$, so the number is $$\sum_{y_2=1}^{10} \sum_{y_3=0}^{17} \sum_{y_4=0}^{19} (184-y_2-y_3-y_4).$$

We simplify this as follows (using triangular numbers): \begin{align*} & \phantom{={}} \sum_{y_2=1}^{10} \sum_{y_3=0}^{17} \sum_{y_4=0}^{19} (184-y_2-y_3-y_4) \\ & = \sum_{y_2=1}^{10} \sum_{y_3=0}^{17} \sum_{y_4=0}^{19} 184 - \sum_{y_2=1}^{10} \sum_{y_3=0}^{17} \sum_{y_4=0}^{19} y_2 - \sum_{y_2=1}^{10} \sum_{y_3=0}^{17} \sum_{y_4=0}^{19} y_3 - \sum_{y_2=1}^{10} \sum_{y_3=0}^{17} \sum_{y_4=0}^{19} y_4 \\ & = 10 \times 18 \times 20 \times 184-18 \times 20 \times \tfrac{10 \times 11}{2}-10 \times 20 \times \tfrac{17 \times 18}{2}-10 \times 18 \times \tfrac{19 \times 20}{2} \\ & = 662400 - 19800 - 30600 - 34200 \\ & = 577800. \end{align*}

We can verify this by generating all of them using the GAP code:

count:=0;;
for y2 in [1..10] do
  for y3 in [0..17] do
    for y4 in [0..19] do 
      for y1 in [1..184-y2-y3-y4] do
        count:=count+1;
        Print(count," ",[y1,y2,y3,y4],"\n");
      od;
    od;
  od;
od;

whose output ends with:

577797 [ 135, 10, 17, 19 ]
577798 [ 136, 10, 17, 19 ]
577799 [ 137, 10, 17, 19 ]
577800 [ 138, 10, 17, 19 ]
0
On

The generating function $f(x)$ with coefficients $[x^k]f(x)$ that enumerate solutions to

$$y_1+y_2+y_3+y_4\le k$$

under said conditions (the ones in the title not the details) for the $y_i$s is

$$f(x)=x(x-x^{11})(1-x^{18})(1-x^{20})\cdot\dfrac{1}{(1-x)^5}$$

it is straightforward to expand the binomials to give the answer in terms of binomial coefficients but I just used this line in sage

taylor(x*(x-x^11)*(1-x^18)*(1-x^20)/(1-x)^5,x,0,184).coefficient(x^184)

which returns:

577800    

Using the conditions in the details, instead you use the generating function with different $y_4$ upper limit:

$$g(x)=x(x-x^{11})(1-x^{18})(1-x^{19})\cdot\frac{1}{(1-x)^5}$$

sage input:

taylor(x*(x-x^11)*(1-x^18)*(1-x^19)/(1-x)^5,x,0,184).coefficient(x^184)

output:

550620