How many solutions to the equation $\vert x_1\vert +x_2+x_3 = 16 .$ we also know that $x_1 \in\mathbb Z$ and $x_2,x_3 \in\mathbb N$ .
in our class, $0 \in\mathbb N$ .
the answer in the textbook is : 17+ $2 \cdot{17\choose 2}$.
Thank you!!
How many solutions to the equation $\vert x_1\vert +x_2+x_3 = 16 .$ we also know that $x_1 \in\mathbb Z$ and $x_2,x_3 \in\mathbb N$ .
in our class, $0 \in\mathbb N$ .
the answer in the textbook is : 17+ $2 \cdot{17\choose 2}$.
Thank you!!
Though this is brute force, you can numerate the solutions:
In total,
$$1+2+3+\cdots14+15+14+13+\cdots1=2\frac{14\cdot15}2+15=225.$$
Less brute force:
$x_2+x_3=n$ has $n-1$ solutions in $\mathbb N_{>0}$ (and $n+1$ in $\mathbb N_{\ge0}$).
Then $x_2+x_3=n-|x_1|$ has
$$\sum_{x_=-n+2}^{n-2}(n-1-|x_1|)=2\frac{(n-2)(n-1)}2+n-1=(n-1)^2$$
or, in $\mathbb N_{\ge0}$,
$$\sum_{x_=-n}^{n}(n+1-|x_1|)=2\frac{n(n+1)}2+n+1=(n+1)^2$$
solutions.
Assuming $0 \in \mathbb{N}$, we can find the number of solutions for $x_1+x_2+x_3 = 16$, say $A$, with $x_1,x_2,x_3 \ge 0$ and multiply them by $2$ (in order to count the solutions with negative values of $x_1$) and subtract the number of solutions for $x_1 = 0$, say $B$. (since we will be counting them twice). Long story short, we are seeking $2A-B$.
In order to find $A$ and $B$, we can make an analogy such that $A$ is the number of ways of putting $16$ balls to $3$ boxes without any restriction and $B$ is the number of ways of putting $16$ balls to $2$ boxes without any restriction. In order to find these numbers, we can use stars and bars or binary number representation. For example, if we put $1$ ball to $x_1$, $1$ ball to $x_2$ and $14$ balls to $x_3$, corresponding binary representation is $01010000000000000000$. So, total number of ways $A$ is the number of binary representations containing two $1$'s and sixteen $0$'s, which is $\binom{18}{2} = 153$. By similar logic, we can find $B$ as, $B = \binom{17}{1} = 17$. So the asnwer is $2A-B = 2 \cdot 153-17 = 289$.
Firstly, we know that $x_1$ holds for any integer from $0$ to $14$, since $x_1$ is possible for all integers. Now, $x_1$ cannot be $15$ or else, either $x_2$ or $x_3$ will be $0$, which is wrong. So for $x_1=1$(do note that we cannot start from $x_1=0$ here, as negative $x_1$ is negative $0$, which is the same as $0$), $x_2+x_3=15$, and $x_2$ can range from $1$ to $14$, giving us $14$ ways. When $x_1=1$, there are $14$ ways. We observe a pattern here. Finally, when $x_1=14$, there is only $1$ possibility. We sum up $1$ to $14$, getting $\frac{15\times14}{2}=105$. Negative values of $x_1$ hold here since $x_1$ is absoluted, so we multiply by $2$ to take care of there negative values. We have $210$ ways here. Not forgetting $x_1=0$, for that we have $15$ ways(since $x_2+x_3=16$, and $x_2$ and $x_3$ are greater than $0$). Summing it up, we have $210+15=225$ ways.