4

Find how many solutions there are for $$ 3x_1+3x_2+x_3+x_4=30$$

I know how to solve this: $x_1+x_2+x_3+x_4=30$ and I read this link, but I am still not sure about my answer. I wrote: $x_4+x_3=30-3(x_1+x_2) $ then I get this: $0 \le x_1+x_2 \le 10$ (that I know to solve: $66$ combination) and now I'm not sure what to do with $x_3+x_4$.

V.G
  • 4,196
shir
  • 81

3 Answers3

12

Using stars and bars method, it is easy to establish this lemma:

Lemma. The number of solutions of equation $$x_1+x_2+...+x_k =n$$ where $x_1,x_2,...x_k$ are nonnegative integers, is ${n +k-1\choose n}$.


For each $k\in \{0,1,...,10\}$ the number of solution to $x_1+x_2= k$ is ${k+1\choose 1}=k+1$ and the number of solution to $x_3+x_4 = 30-3k$ is ${31-3k\choose 1} = 31-3k$.

So the total number of solutions is \begin{align}\sum _{k=0}^{10}(31-3k)(k+1)&=\sum _{k=0}^{10}(31 +28k-3k^2)\\ &=341 + 28\sum _{k=0}^{10}k-3\sum _{k=0}^{10}k^2\\ &=341 +28 {10\cdot 11\over 2} -3{10\cdot 11\cdot 21\over 6}\\ &= 726 \end{align}

nonuser
  • 90,026
6

If you are allowing $x_i$ to be greater than or equal to $0$ in the equation $\color{red}{3x_1}+\color{blue}{3x_2}+\color{green}{x_3}+\color{brown}{x_4}=30$, then if we consider the expansion $$\displaystyle \color{red}{\left((x^3)^{0}+(x^3)^1+(x^3)^2+\cdots\right)}\color{blue}{\left((x^3)^{0}+(x^3)^1+(x^3)^2+\cdots\right)}\color{green}{\left(x^0+x^1+x^2+\cdots\right)}\color{brown}{\left(x^0+x^1+x^2+\cdots\right)}$$

Then the number of solutions to the given equation will be the coefficient of $x^{30}$ in the above expansion (Why?).

Now we simplify it a bit, we know that $1+x+x^2+\cdots$ is a geometric progression whose sum equals $\dfrac{1}{1-x}$.

Using this, our expansion becomes, $$\dfrac{1}{\color{red}{(1-x^3)}\color{blue}{(1-x^3)}\color{green}{(1-x)}\color{brown}{(1-x)}}=(1-x^3)^{-2}(1-x)^{-2}$$

Now using binomial theorem, we can rewrite it as $$\left[\sum_{k=0}^{\infty}\binom{k+1}{k}x^{3k} \right]\left[\sum_{r=0}^{\infty}\binom{r+1}{r}x^r\right]$$

So coefficient of $\displaystyle x^{3k+r}=\binom{k+1}{k}\binom{r+1}{r}=(k+1)(r+1)$ and when $r=30-3k$, it is $(k+1)(31-3k)$ which is summed over from $k=0$ to $k=10$ which turns out to be the same summation as written by @Aqua, but note that with this, we can solve it even if there were restrictions on $x_i$, for example, if it were given that $1\le x_1 \le 5$, and rest everything the same, then we would only consider the product $$\displaystyle \color{red}{\left((x^3)^{1}+(x^3)^2+(x^3)^3+\cdots+(x^3)^5\right)}\color{blue}{\left((x^3)^{0}+(x^3)^1+(x^3)^2+\cdots\right)}\color{green}{\left(x^0+x^1+x^2+\cdots\right)}\color{brown}{\left(x^0+x^1+x^2+\cdots\right)}$$ and proceed accordingly.

V.G
  • 4,196
  • That is nice solution. – nonuser Feb 18 '21 at 18:23
  • @Aqua Thank you :) – V.G Feb 18 '21 at 18:24
  • @LightYagami He said natural numbers, which are the numbers 1 or greater – Some Guy Feb 18 '21 at 21:03
  • @SomeGuy: Thank you for telling me what are natural numbers. That is why I wrote about the condition in my first line. He only mentioned it in comments, and in the post he writes $0\le x_1+x_2 \le 10$ which means he was assuming $x_i,x_2 \ge 0$. I have also written that using my method, we can solve it even if we modify the ranges of $x_i$. So, if he wants to solve for $x_i \ge 1$, he can do so by applying the same method. – V.G Feb 19 '21 at 01:26
1

Warning: DISGUSTING CASEWORK AHEAD

Rewrite the equation as $3(x_1+x_2)+x_3+x_4=30$. Now, let $a=x_1+x_2$ and $b= x_3+x_4$. Thus, we have $3a+b = 30$. So, we can easily figure that each solution pair $(a,b)$ are $(2,24),(3,21),(4,18),(5,15),(6,12),(7,9),(8,6),(9,3)$. Note that $a,b \ge 2$ because each one is the sum of $2$ naturals, which are both $1$ or greater. Now, we examine each case.

For $(2,24)$, we can make $a=2$ with the pair $(1,1)$ and make $b=24$ with pairs $(1,23)$ through $(23,1)$, which is $23$ pairs. Thus for this case we get $23$ solutions by multiplying $1$ way to make $a=2$ with $23$ ways to make $a=24$.

For $(3,21)$, we can make $a=3$ with the pairs $(1,2),(2,1)$ and make $b=21$ with pairs $(1,20)$ through $(20,1)$, which is $20$ pairs. Thus for this case we get $40$ solutions by multiplying $2$ way to make $a=3$ with $20$ ways to make $a=21$.

Now you can see a pattern right? So far our sum is $1*23+2*20$. Let's continue this pattern on, because we can see a pattern in our cases $(2,24),(3,21),(4,18),(5,15),(6,12),(7,9),(8,6),(9,3)$.

Thus, we get a sum of $1*23+2*20+3*17+4*14+5*11+6*8+7*5+8*2 = 324$ solutions.

EDIT: I notice that some other people are including $0$ as a natural number, so here's a revised solution. Since we can have both $x$ be $0$, or one $x$ be $0$ ,that means we may have $a,b = 0 or 1$. Thus, our new cases are $(0,30),(1,27)(2,24),(3,21),(4,18),(5,15),(6,12),(7,9),(8,6),(9,3),(10,0)$. Also, before for case $(2,24)$, we had $1$ way to make $a=2$ using $(1,1)$. However, now that we can use $0$, we add $2$ pairs to get $(1,1),(2,0),(0,2)$. Similar logic can be used to add $2$ pairs to all ways to make $a,b$. Now, let's find our new sum.

For case $(0,30)$ we can have $a=0$ with $(0,0)$ and $b=30$ with $(0,30)$ through $(30,0)$ or $31$ pairs. Thus, the number of ways for this case is $1*31$.

For case $(1,27)$ we can have $a=1$ with $(0,1),(1,0)$ and $b=27$ with $(0,27)$ through $(27,0)$ or $28$ pairs. So we have $2*28$ total ways for this case.

Now that we have the base cases $1*31$ & $2*28$,we may use the logic we used previously to get our sum of $1*31+2*28+3*25+4*22+5*19+6*16+7*13+8*10+9*7+10*4+11*1 = 726$

Some Guy
  • 2,687
  • I hadn't read your answer thoroughly... probably due to the disclaimer ...(+1 was due to the effort you had shown), Now that I was about to write my own, I see that I arrived at the same logic and solution as yours... :~) not at all disgusting ;-) – Aatmaj Feb 20 '21 at 15:50