finding the values for $x_1+x_2+x_3=5$ by restriction

67 Views Asked by At

Let $x_1+x_2+x_3=5$ and $1 \leq x_1 \leq 4$ , $0 \leq x_2 \leq 4$ , $0 \leq x_3 \leq 4$ .

How many $x_1$, $x_2$, and $x_3$ are there?

Firstly i found the all cases such that $C (4+3-1,4)=15$ but i stuck in the rest.I could not make inclusion exclusion part. Can you help me? The correct answer is $14$.

2

There are 2 best solutions below

1
On BEST ANSWER

You can use a generating function. The answer is the coefficient of $x^5$ in $$(x+x^2+x^3+x^4)(1+x+x^2+x^3+x^4)^2,$$ which is the coefficient of $x^4$ in $$(1+x+x^2+x^3)(1+x+x^2+x^3+x^4)^2.$$ Expanding yields $$1+3x+6x^2+10x^3 + 14x^4 +\cdots,$$ so the answer is $14.$

0
On

Generating functions are the easiest way, but I know absolutely nothing about them. So I'll illustrate how I might go about this problem. Assume $x_1, x_2,$ and $x_3$ are allowed to be in the range of integers $[0,5]$. Then the total number of cases can be found via a stars and bars calculation, and is $$\frac{(5+3-1)!}{5!(3-1)!}=21$$ Now we need to subtract for the cases where $x_1, x_2,$ or $x_3$ are $5$. There are exactly $3$ of these. Now we need to subtract the cases where $x_1=0$. This is another stars and bars calculation and the result is $$\frac{(5+2-1)!}{5!(2-1)!}=6$$ However since this includes the $x_2= 5$ and $x_3=5$ cases that we already subtracted, we need to add them back in. So our answer is $$21-3-6+2=14.$$